Is there a way to repeat the event on the exact same timing?

Hi all,

I’m currently working on a physics-driven puzzle game and trying to set up a custom replay system to prevent cheating without confirmation by a human. (i.e. game logic should be filtering the cheated sessions on its own.)

What I planned was simple. Implement fixed physics timestep, record a player’s action(which actor he or she chose, which got activated, etc) and then run a simulation on the server to check if the gameplay result(score, time, etc) is legit.

I’ve finished physics part and recording part, but while I was trying to simulate the original gameplay, I noticed I can’t catch the exact timing to fire an event.
For example, during the gameplay, a certain action A gets recorded with the time indicating “2.09698112853…”

When I execute the recorded event during the simulation, I can get close to that timing(“2.09300985…”) but never the same value. And surprisingly that little difference(usually less than <.002) changes behavior of a physics actor much more than I expected, resulting in a different result.

I strongly believe if only I can find a way to execute events exactly when it should, the system would work as I intended.

Is there any way to accomplish this?

So far I’ve tried timer(looped by .00001 second), tick(frame interval chopped up to 100000+ iterations), delay node. None of them worked.

I am afraid even you find a way to solve your problem on your own machine none of your friends or customers are able to to play this game.

I suggest you change the entire logic

I’m sorry, but I don’t follow. Could you elaborate?

Trying to make a non-deterministic physics engine deterministic is pretty much impossible.

It sure is. I’m just trying to do everything I can.

Have you looked into how other games do replay systems?

Either each frame or every fixed interval of time (0.1s, 0.25s, etc., depending how accurate you need the data), they basically drop an invisible dummy actor where that object was, that contains its location, rotation, velocity, and adds them to an array. Then, when the “replay” kicks in, they read that array backwards (if you want to rewind), or from the last 30 seconds, your choice.

Here’s an example: Reversing Time Tutorial (Intermediate) -Unreal Engine 4 - YouTube