Game Design, Programming and running a one-man games business…

Separate updates for rendering and processing

All my previous games have had quite a simple main loop to them, in theoretical terms, because mostly they were turn based, so you are responding to GUI events or doing end of turn processing. Even my old space game StarLines INC adopted the simplest system in each loop tick which was this:

ProcessStuff()

DrawStuff()

over and over again.

The new games ‘real-time’ bit, has a LOT of stuff going on, and there is a whole bunch of stuff that really doesn’t need to be processed every frame. Lots of it only needs doing five times a second at most.

So today I split things up into

CheckIfWeNeedToProcess()

DrawStuff

CheckIfWeNeedToProcess()

DrawStuff()

etc. of course, the stuff like ship movement and animation all gets processed every frame, otherwise there is no change and you are wasting time, but stuff like updating target selection and checking shield status is now only done 5 times a second. This speeds things up a lot.

The problem I still need to solve is that I do all that processing in one chunk, which might stutter older PC’s. ideally it would be a seperate thread, but that might be a total nightmare to code and debug. I’ll probably split the data into chunks and manage it in discrete subsystems at some point tomorrow.

I also added a new spaceship graphic, and I’m getting the hang of making them look less like stock models now :D


2 thoughts on Separate updates for rendering and processing

  1. So, a guestimation of the release would be june/july??? am i even close??? no rush, i enjoy all your other games, be nice if a new starlines game was made, but whatever. Anything is better than more time management games (diner dash anyone???)

Comments are currently closed.