Speed up runtime/game speed?

Is there any python script to change ingame speed, like using cheat engine for “speedhack”?

You mean that everything runs faster/slower?

No.

There are two ways to achieve such an effect.

A) stop the scene. This results in larger time steps. You will get 1:1, 1:2, 1:3 etc. (frame play : frames on hold). This will not be very smooth. Faster running is not possible. See the Frame-by-Frame Debugger

B) Design your game to allow that.
–> play your actions with configurable speed
–> Adjust the physics that it looks like the time is faster (you can’t tell the physics engine to use smaller time steps).
–> Adjust the logic to act like faster time (e.g. counter should count in larger steps).

In 2.77 and newer:


import bge

bge.logic.setTimeScale(0.5)

The number inside it works like this:
n < 1: slower
n == 1: default speed
n > 1: faster

If you plan to make time manipulation part of your game you should build it in from the ground up. Messing about with skipped frames or such can cause sensors to fail or physics to go wrong.
Although the new feature might make this work ok.

The good thing about building your own time control is that you can alter time selectively for only some agents. In my latest game I included a potion to freeze or slow enemies. This worked by changing the speed (and turning speed) of all agents except the player. You also need to adjust animation speed, easy if you’re using python since playAction has a speed argument.

One way to do this is to have each agent check a global dictionary entry for global speed for every action.

you could do


bge.logic.setLogicTicRate(100)

60 is default. > 60 is faster and < 60 is slower

Well, I’m not really planning to do anything fancy with it. I’m just going to use it for testing purposes, I hope that can’t be too bad.

Thanks a million. :wink:

Combining your and adriansnetlis code seems to have solved my problem perfectly, thanks you two!