Thursday, October 20, 2016

Oct updates catchup - Fixed time step and Max FPS

Fixed Time Step Rates - So one of the latest discoveries that I really should have thought about was to apply a Fixed Timestep to anything that measures values that are piped through a tickrate. What I mean by that is anything that's relying on Tick updates (updates per frame) like TurnRates, Speed changes, etc.

Since latest testing and optimizations allowed me to achieve FPS heights of over 300 in dead areas and perhaps <60 FPS in some extreme PFX/Light heavy areas, this wild variation in FPS made it very noticeable that Updates per frame were also being affected quite drastically. Relying on Frames when they aren't consistent will make those rate play differently both on the upper end or lower end.

FPS Difference in turn rate

As you can see in the quick video above, you can see the difference in turn rate between an unlimited FPS (turning super fast), vs a limited frame rate of 30 FPS (turning much slower). Easily made sense when you think about it. If the game only has 30 Frames per Second to process an X turn rate, then it would only update 30 times per second vs the 200+ FPS I was getting.

As you can imagine, alot of people might be thinking "Well, force limit your FPS to 30-60 and everything will run just fine", and this is perfectly acceptable to use when doing console development (Xbox, Playstation, etc.), but I refuse to limit my FPS when playing. Personally I would rather have an unlimited FPS so I might enjoy a smoother experience in my titles so there had to be a way around this. The answer that comes with this is to create frame rate independent comparisons with my rates to my Delta Time of the frame.

A great article can be found here...

https://www.scirra.com/tutorials/67/delta-time-and-framerate-independence

What this has allowed me to do is now allow for any FrameRate to occur in the game while making sure my values of things like "TurnRates" can remain at a particular speed I want for the Player to feel, eliminating FPS as either a Play advantage or disadvantage.

Frame Independent TurnRates




No comments:

Post a Comment