6th
Pile of Kittens: Day 10
http://stttutter.com/pileofkittens-contest/flash/PileOfKittens.html
Submitted! Unity’s preview Flash support proved uniquely challenging in quite a few different ways at the last second, so I only have four levels and a special new “100 kittens” level now, unfortunately. As far as I can tell everything ended up looking remarkably polished despite the number of surprises on the way there; I’ll have to see if that holds up to another day of scrutiny.
It’s very impressive to be able to create this kind of thing in Flash, but here are the things that went wrong with me for the Unity 3.5 Developer Preview and Flash:
- 2D Audio didn’t work and I had to scramble to reimport all of my sounds as 3D and update my audio sources accordingly.
- My AI-controlled CharacterControllers would jitter and wreck the game with NaN coordinates after a couple minutes, only in Flash. I switched all of my enemies over to Rigidbodies tonight. Debugging this took a good few hours.
- I couldn’t key bind to shift or ctrl! I wanted do use both of these keys for mine, but now I’m stuck using WASD + Q and E, which conflicts on some keyboards.
- Putting code in FixedUpdate() caused terribad performance in Flash. Moving the same code to Update(), which actually gets called more often since it’s not the “Fixed” physics update, somehow improved performance. I eventually throttled those calls to further improve performance, which ended up being pretty important.
- Performance in general is much worse in the Flash build, but still putters along on most machines after optimizations. I’m a bit worried this means that rendering is more CPU-bound in the Flash version of Unity than the standalone. I imagine they’re already working on fixing that, though.
- I couldn’t remove Rigidbodies and Colliders from objects at runtime in Flash. This meant that I couldn’t disable my kittens as colliders ever, which leads to some kind of weird but awesome jump boosts if you pick up a kitten just right while jumping. It seemed like the collider and the rigidbody had a slightly more explicit ownership/binding to each other than in other implementations, given this rather rad debug log that came out of Flash:
Can’t remove SphereCollider because Mono’s disabled (MonoBehaviour), Mono’s disabled (MonoBehaviour), Mono’s disabled (MonoBehaviour), Mono’s disabled (MonoBehaviour), Mono’s disabled (MonoBehaviour), Mono’s disabled (MonoBehaviour) depends on it
I’ve once again chosen to use music by Connor Humphreys, “Artist of the Fortnight”. This time it was from some of his earlier CC-released work. I think it works very well.
It’s time for sleep. Parts of me are starting to break down. My teeth hurt.