Time scaling is a feature in Construct that allows you to change how quickly time is passing in the game universe relative to the real world. It allows for slow-motion effects, effective pausing, and even fast-motion effects.
Setting a time scale
Use the system action 'Set timescale'. A value of 1.0 corresponds to normal time. A value of 0.5 means time in the game passes at half the normal rate.
How timescaling works
Setting a time scale affects:
- The values returned by Time Delta.
- As a result, all behaviors in Construct, which rely on TimeDelta, are also affected.
- The frequency with which the system condition 'Every X milliseconds' triggers.
- The rate at which the system expression timer increments.
- The pitch of sounds played by the XAudio2 Object, which speeds up and slows down playback according to the time scale.
Timescaling will affect the entire playback of your game, providing it uses Time Delta. Any motion not coded with Time Delta (eg. moving an object a distance every tick) will not be affected - this is why it is important to use Time Delta throughout your game if you plan on using time scaling.
Set the time scale to 0.1 and your game proceeds at 10% the speed of normal, creating a very convincing and effective slow-motion effect. Since the framerate is not affected by timescaling, motion still proceeds very smoothly and the result can be very pleasing.
Alternatively, you can set the time scale to a number greater than 1. A timescale of 2 means your game proceeds at double the normal speed.
Set the time scale to 0 and the game will come to a halt, since game-time is frozen. However, the framerate is not affected, and events continue to run. This can allow you to control a pause-menu or allow other commands to be carried out while the game is paused.