- Home /
Consistent and deterministic replays
Is there a way to lock unity to a certain frame rate? I have seen Application.targetFrameRate, but it states "tries to", which is vague at best.
What I want is to be able to make a replay system and/or inbuilt TAS support, that is, have a file that states what input are being pressed every frame, so that the same replay/tas file will always produce the same game play consistently.
I don't mind if the game HAVE to slow down due to not being able to process a frame fast enough, but I don't want it creating inconsistent gameplay. Imagine finishing a level super fast only to see your replay showing you falling in the very first jump due to being inconsistent.
In any case, Application.targetFrameRate does not help, it tries to reach 60 fps but it won't lock Time.DeltaTime to 1/framerate.
I can make all of my scripts in the FixedUpdate, that would do the trick (If I set the fixed update to my target fps that is). However, that still does not completely solves the problem, since although I can make all of $$anonymous$$Y scripts running on FixedUpdate, I can't do anything about any library or built in Unity feature that is not on FixedUpdate