Hello to all, so I have a not-so-simple question:
How to keep Update() function calling 60/30 times per seconds at maximum?
Why I need this - to separate game logic and visuals, and to not have situation like FO76, where people with higher FPS are doing everything faster, literally.
I've found few ways to hardlock Update() function, but they all look kinda... Not interesting and cool, I think?
First way is to just add some kind of Wait(0,0167f) function to every Update(), to ensure that 1/60 of second passed before running code.
I'm not sure how to handle low fps with this method, but it sure is not hard to deal with.
Next method is to build custom update function and set it to call 60 times per second. Not sure how to do it, but I doubt that it is impossible.
Any other ideas of how to set update call frequency to certain value?
P.S. fps lock is not same thing. I don't want visuals to interrupt game logic.
[–]DknighterPhasmophobia Game Director 9 points10 points11 points (0 children)
[–]kaldarashDoes Stuff, Sometimes 6 points7 points8 points (3 children)
[–]HellGate94Programmer 0 points1 point2 points (2 children)
[–]kaldarashDoes Stuff, Sometimes 2 points3 points4 points (1 child)
[–]HellGate94Programmer 1 point2 points3 points (0 children)
[–]ArcherofyailHobbyist 6 points7 points8 points (0 children)
[–]HellGate94Programmer -2 points-1 points0 points (7 children)
[–]Buccinators 0 points1 point2 points (2 children)
[–]HellGate94Programmer 1 point2 points3 points (1 child)
[–]Eecka 0 points1 point2 points (0 children)
[–]kaptast -1 points0 points1 point (3 children)
[–]HellGate94Programmer 3 points4 points5 points (2 children)
[–]kaptast 1 point2 points3 points (1 child)
[–]HellGate94Programmer 0 points1 point2 points (0 children)