Hi,
I’m trying to make a 2D game simulation in order to utilise it for automated tests.
I’ve managed to make the game run on it’s own and simulate players behaviour.
However this runs at normal game pace, which is too slow for any meaningful amount of tests.
I want to speed up the game simulation, while keeping all the calculations (especially physics) precise.
That includes but is not limited to:
- consistent impact of two objects colliding (regardless of simulation pace)
- consistent movement trajectory (regardless of simulation pace)
- consistent relative velocity and motion of all entities
What I tried:
- Increase Physics Ticks Per Second: this doesn’t speed up simulation, it only increases the number of motion equation samples
- Increase Max Physics Ticks Per Frame: this doesn’t speed up simulation but increases the number of samples
- Disable V-Sync, disable rendering, set unlimited FPS, disable low processor optimisation. This makes the game run faster but it has no effect on physics. Since all motion equation is tied to physics processing this solution does not work
- Increase time scale. This speeds up everything, including physics simulation, however it introduces many problems, such as: physics becomes inaccurate (way less samples due to delta becoming a bigger value), magnitude of physical properties (such as velocity) also increases, which obviously leads to a whole lot of other problems (like collision impact strength)
So far I have not found a way to make the game run exactly the same as it would run in a normal way but at a much faster pace. Basically, what I want to achieve is the same effect you get when playing video at X2 speed. I don’t need any rendering or network features, I don’t need to wait for CPU and GPU to sync.