Friday, February 8, 2013

Super fast!

 Downloaded the game to the iPad last night and it ran approximately 4 times faster than I want it to. So the scroll goes whizzing by and the enemies trigger at heroic speeds.

It seems I need to alter the game code slightly to prevent faster than desired gameplay. I tend to think of this running fast problem as a good thing, as it is Always easier to slow code down than it is to make it run faster, and optimizing code is something I have done now for 20 years. So of all the performance problems to have, well, I would take this one each time. It also means I can add a helluva lot more eye candy to the game without worrying about slow down.

I was going to take some video to show this problem off, only.... It simply looks like gameplay footage played back at a faster rate. Should I or should I not bother, well, maybe later today.

There are generally two ways to fix my speed up problem. One is to pass along the time delta for this update to your update code and multiply it into speeds and timers etc. This has a great effect of smoothing out the frame rate from every angle. However all those dang multiplies add up (they do in my mind, I have developed on some crappy machines I can tell ya). I usually go this route and have for my last 7 games or so, be them on the Xbox, WinPhone7, Android or iOS devices.
 This time I am going to go a different way. I am going to collect time and when a 30th of time has been accumulated I will pass through and call my update (logical) routines. The benefit of this is it really makes writing the logical code so much simpler. Time can actually be counted in frames as well as erm.. time.

The best part is the whole game looks fine apart from the speed it runs at. It looks exactly like the emulator, except for some reason better all over. I am not sure why, maybe it is the quality of the iPad screen or something.

Da Voodoochief

No comments:

Post a Comment