upbge
upbge copied to clipboard
Object timer properties and tick rate depend on the framerate
I recently tried switching my game to UPBGE and most things worked fine, except for the tick rate and timer properties. They seem to depend on the framerate, e.g. if my game runs at 30 fps on my laptop, all timers are also slowed down by half. The countdown takes twice as long, etc. Is there anything that has been changed that I need to adapt my game to? I built the most recent version from git.
Some of my functions already take the rate of logic ticks into account. Adapting more wouldn't be a problem for me, however, I doubt that object timers should depend on the frame rate and slow down.
Maybe I'm missing something, I'd be glad for any clarification.
I thought about making speed
variables, which depend on current frame rate.
Framerate chages - speed
changes according them.
Timer is a timer. Needs to count the seconds and the milliseconds not the frame-rate. It should be completely independent from the frame-rate. You can have variable frame-rate from system to system but you don't want to have a variable timer. Just my 2 cents.
In the BGE, there is the concept of "Real Time" vs "Simulation Time". I guess in this case timers must represent the time elapsing in the simulation.
https://pythonapi.upbge.org/bge.logic.html#bge.logic.getRealTime
On the other hand, in modern engines, the delta time between two frame calls is given to the scripts, so that they can adapt whatever they were doing to the call frequency getting slower.
I guess i was talking about the real-time timer.