Flight model / Overspeed issue
-
The fact that fps changes between cockpit and external make the time step of the RK4 algorythm change , which can play a significant role in convergence at the edge of the model
The fact that the phenomenon happens in a certain view and not another is just a consequence of this time step change .
Could you do the aero calculations in another thread and put the results back into the sim that way? As a way to make that particular set of calculations time step be independent of the FPS? Obviously that would introduce the issues of multithreading though.
-
Could you do the aero calculations in another thread and put the results back into the sim that way? As a way to make that particular set of calculations time step be independent of the FPS? Obviously that would introduce the issues of multithreading though.
What happens when the display frame rate changes and the sim is operating at it’s fixed frame rate? You’ll get temporal aliasing, objects will jump across the screen as their aero calcs are feed into render. Not to mention when you start multi-threading there are a host of other issues. You’ll need to buffer and store your interpolations, then send the position updates to the render. Then there is fact that falcon 4 is 18 years old and would need to be rewritten entirely to make use of multi-threading. The increased number of instructions and buffer, eat up cycle time and memory, so there may not be a huge performance gain for the effort involved in an edge case.
There are some other solutions to this issue. One involves locking the frame rate and this is easy to do in game, Just turn on Vsync. People tend to not like it, as it has a habit of locking the frame at the lowest multiple of their refresh rate. The second is a bit more complicated, get your dt from the render and then intergrate using a step of that dt. You end up with accumulating time, which you store as a variable. This variable is used to interpolate the current physics state from the last, thus smoothing out any errors due to the variable frame rate. You send this lerped physics state to the render to be displayed.
I can see why you wouldn’t want to use this approach as you’re not really simulating the given variables at any moment. You’re lerping between last state and current. Which is why it appears that mav’s approach is to increase the time step in the integration. He’s actually simulating the forces at a given moment and sending it the rendered and advancing a head. Which is why you can end up with edge cases where the accelerations and frame variance produce positioning error.
Here’s one the basics of Integration and physics sim, if you want to understand rk4.
http://gafferongames.com/game-physics/integration-basics/And another that covers time step and render times. This provides a better explanation of the approach described above with easy to read code examples.
http://gafferongames.com/game-physics/fix-your-timestep/ -
There are some other solutions to this issue. One involves locking the frame rate and this is easy to do in game, Just turn on Vsync. People tend to not like it, as it has a habit of locking the frame at the lowest multiple of their refresh rate.
This is exactly what my buddy and I did to fix the problem. With a stout enough system and a good monitor it will lock in at 60 FPS no problem. I’d much rather have 100% stability in flight and 60 FPS than have 110+ and wing rock.
-
If we could confirm that actually too many fps are the problem for high speed I could increase the time step as well in those cases !!!
And if you wonder why BMS fm is so smooth compare to others sims , now you start to get it adaptative RK4 with full physics in is a bitch
-
If we could confirm that actually too many fps are the problem for high speed I could increase the time step as well in those cases !!!
And if you wonder why BMS fm is so smooth compare to others sims , now you start to get it adaptative RK4 with full physics in is a bitch
Well from my testing years ago the lowest FPS I had at the worst duplication of this problem was 50 FPS all the way up to 100+ so I’d say that is definitely part of the problem. That being said since you can simply turn on VSync and tame this I’m not sure if adjusting this would be a worthwhile venture if it has any possibility of causing issues with lower performance systems.