I’ve been creating my game using the principles of framerate independence (time.deltaTime).
However, after extensive testing I realized my game mechanics just won’t work within a framerate independent setup. There are highly sensitive timing issues where I need things to play out over a specific range of frames with 100% consistency.
Analysis of games in somewhat similar territory (fighting games, lets’ say) shows they also run at locked framerates.
My temporary solution is to continue coding as if it’s framerate independent, but wrapping deltaTime behind a property that can set it to a constant value instead.
This is just so I can keep developing without it all breaking in the end. But I don’t see any way of shipping this game with a framerate independent setup, so I’m only doing this to cover all of my bases.
Everything is working fantastically if I treat it as non-framerate independent, but modifying that property relative to a specific framerate. So if it were 120fps, the property would return half of what it returns at 60fps. Everything works deterministically and great! If framerate slows a bit, the game slows. No big deal, the crucial input timing windows are still preserved.
However, if I set targetFramerate to 60fps, but allow Vsync, when I build the project the Vsync FORCES the game to run at 120fps (my monitor refresh) and everything goes twice as fast!
The solution seems to be to force 60fps (which just about every display out there respects as a valid rate), but I can’t seem to do this while allowing users to Vsync. Or, possibly they will just override vsync anyways in their graphics settings. I just can’t seem to figure the way out of this even though plenty of games ship that only respect a very specific refresh rate. Any help would be greatly appreciated!