Unicorn Heads Popping Off!!
Thanks to some hard work from my collaborator, I now have a model of the unicorn with its head separated. When a unicorn gets hit with a shotgun and dies, its head pops off (every time for now, will be one of a few different death sequences eventually.)
Sorry for the poor video quality… and sorry for the messy room, mom! ;)
Implementation:
When the unicorn dies, we actually replace the animated alive model with a new prefab, setting the position and rotation information to match the alive model. We then delete the alive model. This switcharoo lets us have two pieces of geometry (the head and body) where there used to only be one (the whole unicorn.) This will let us have more alive unicorns on the screen at once, because the alive model is easier for the iPhone to render. The decapitated prefab also has some physics. We give the head a spherical collider so the rigidbody’s center of gravity will be correct. Then, we apply some Force, randomizing the strength and angle within a reasonable range to keep the head-popping interesting. Random.Range for the win!
Lesson Learned:
Overlapping colliders make bad things happen. I was getting inconsistent and unexplained motion of the head. I deleted all my Force scripts, tried restarting Unity and even reconstructing the decapitated prefab, all to no avail. So, I started working backwards to the last “known good” state. Eventually I figured out that the behavior was only happening when both the head and the body had colliders. The colliders where both spherical because they are the most efficient collider (center + radius instead of complicated poly bounds calculations.) It turns out that simulating the overlap of the colliders made the physics engine assume there was some form of collision going on, so it tried to separate the colliding objects. Normally, this is exactly what we want to happen. If somehow in our simulation the feet of our unicorn get into the floor, it should get bumped out because two things cant occupy the same space at the same time. One solution would have been to have the objects on separate layers, but after some thought I realized there was no need for the body to have a collider at all.
Conclusion:
So, the lesson once again is YAGNI (ya ain’t gonna need it.) If I had added the colliders only as-needed, then I would have a) avoided the problem, perhaps forever and b) instantly realized what was causing the problem if it did come up AFTER the system was known to work with only one collider.
I think my roomba is losing a fight with something on the floor in the other room, so I have to go tend to that.

Posted: July 31st, 2009
at 8:52pm by Aaron Blohowiak
Categories: Effects, Halt Yablonski: Unicorn Hunter, Prefabs, Unity3d
Comments: 1 comment
Lighting in Unity3d for the Unicorn Hunter game
Lighting is hard. Really hard. It can drastically change the look and feel of a game, a movie or your family portrait ;)
With Halt Yablonski: Unicorn Hunter, we want to have a dark feel, so the player understands the seriousness of the situation and becomes immersed in the dark reality that Halt faces on his quest to clean up the streets.
Here are some experiments:



As you can see, each variation gives us a slightly different feel. The first is brighter overall, but we lose that stark high-contrast effect. The second has bright highlights and dark low-lights, but feels very unnatural. The last is somewhere in between, but the details of our hero are kind of lost. There’s definitely a lot more work to be done until we get it right!
Feel free to drop me a line and let me know what you think!
Posted: July 26th, 2009
at 11:09am by Aaron Blohowiak
Categories: Halt Yablonski: Unicorn Hunter, Lighting, Unity3d
Comments: 2 comments
Introducing Halt Yablonski : Unicorn Hunter
I have been developing the concept for a game about a gruff hero that is out to clean the streets of drug-dealing unicorns for a couple months now. I’ve decided to open up my progress to keep my fans, friends and peers up-to-date on my progress. So far, I’ve mainly been making decisions and sourcing talent, software and infrastructure. The game’s art will primarily be the work of a very talented friend of mine. He has a great background, having worked on various movies and games, and is a real pleasure to work with, I hope he has as much fun as I do!
We have some initial assets imported into Unity and I’ve started coding the controls.
Additionally, I’ve started playing around with weapons:

Halt Yablonski plays with his Flamethrower
Don’t worry, mom, I will keep a fire extinguisher nearby. ;)
I’ve also been starting with level design and lighting:

Halt attacks Unicorns on the iPhone.
My plan is to apply to speak at GDC2010, submit the game to IGF and remain open and transparent about developing the game. Should be a fun ride!

Posted: July 25th, 2009
at 5:18am by Aaron Blohowiak
Categories: Halt Yablonski: Unicorn Hunter, Unity3d
Comments: No comments