Thursday, May 7, 2015

Day One: Motion


I cracked open Unity again and it felt pretty good! Making a bunch of these guys spawn and bounce off the walls was easy enough.
So I went a bit further, started putting in UI. A game speed slider that goes from 1x to 256x, and a separate "Pause" button, like the old flash version. It's important that I don't just increase the speed of the morgs. At higher speeds, the morgs could zip right by each other without interacting, producing a totally different simulation at 256 than at 1, and I don't want that. I use sub-steps. All the morgs' motion is under a for loop that iterates S number of times per frame, where S is the gamespeed. So, at 256x the morgs are going through every single incremental movement they would have at 1x, they're just doing it 256 times before the program renders a frame. 256 seems to be about the limit beyond which I can't detect if it's actually going any faster. It does get choppier though, which must mean it's dropping frames. Have to look into that if I really want to have a 256 speed and still be able to say the simulation will play out exactly the same...
Also, added a highlight marker thing so you can follow around a particular morg. When you're focused on one, its individual stats will probably be displayed somewhere eventually. That's a feature the flash version didn't have, and it seems obvious now...

No comments:

Post a Comment