I decided to take a break from the AI coding and focus on one of the things that has been on my TODO list for some time: Change the game from frame based rendering to time based rendering.
What is frame based rendering?
Frame based rendering works in the following way:
First you lock the game to how many frames / second it shall run in, say 60 FPS.
Then you let X number of frames pass before you do something.
This will limit to game to not run any faster than 60 frames / second, and some older computers might not be able to handle the game.
What is time based rendering?
You set timers for everything that needs updating. For example: Move enemy, Input from the user for moving the player, update gravity on objects etc.
The game is no longer needed to run at a locked speed (60 FPS). The game will run with as fast as you computer can handle. On todays computers the game will run in around 90-150 frames / sec.
Since everything is time based, things will run at the same speed even down to 30 frames / sec, and still look fluent on older PC's.
I'm now 99% done with the conversion to Time Based Rendering, I only have some minor things to tweak (set the right millisecond delay on things) and I'm done.
See you next post!