in game timers with blitz3d

Blitz3D Forums/Blitz3D Programming/in game timers with blitz3d

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

@John, it's a software coded interupt/timer.

Imagine the example above where the person (i'm too lazy to read back and see who) executed their logic at 40fps and their 3D world at whatever the computer could run at.

Well this method does the same thing, but only to the specific code encapsulated inside the interupt while{} structure.

In my above code snipper the interupt variable is being increased by the delta time delay, then the while{} structure starts which reduces it by 5 per execution (1000/5=200fps) therefore executing the code inside at a constant rate, yet still maintaining compatability with the delta timing principle.

This method allows the programmer to get all the advantages of delta timing, and overcome its shortcomings by combining it with constant rate mathematics - interestingly, the programmer can make particular tasks faster than others too so in a car race sim you could make your acceleration run at 200fps, but your AI decision making might run on a 10fps interupt.