What numerical integration method is used, and could RK4 be implemented?

0

Hi, I am looking into building a flight dynamics library for flight simulation in Lumberyard and am trying to determine what integration method the physics currently uses. Is it possible to use RK4 (Runge–Kutta) for higher fidelity physics, or would that require completely custom physics implementation?

Thanks! :)

asked 7 years ago190 views
6 Answers
0
Accepted Answer

Hi @REDACTEDUSER

It is possible to use RK4 within the engine! There is an integrator flag within the CryPhysics section that when set to 1, should automatically change the rigid-bodies to use RK4. However, that said, you may also wish to choose to add your own implementation - feel free to do so! If you haven't checked out:

http://docs.aws.amazon.com/lumberyard/latest/developerguide/component-entity-system-pg-gems-code.html

This will help you get started with adding your own gem, if you choose to do so. You may still wish to have a different physics set up in terms of integration for aircraft and cars, so feel free to experiment.

Let me know if this helps!

answered 7 years ago
0

Hi @REDACTEDUSER Thanks for looking into this! =D

From my experience, the Euler method (which I assume is used currently) is fine in games for vehicles, especially at higher physics update rates. Where RK4 (or RK5) really comes into play is when you are working with high velocity objects (aircraft/spacecraft) or the physics update rate is low and/or there are inconsistent delta time steps, so for flight simulation it is required. My only concern is when a game's physics relies so much on Euler that it is often impossible to use another method (Bullet physics for example), requiring custom physics implementation. Because it is best to have all entities use the same base physics, optional integration methods for entities requiring higher fidelity physics would optimal, instead of having completely separate physics for vehicles and aircraft.

Cheers!Uriah

answered 7 years ago
0

Hey @REDACTEDUSER

This is a great question -- let me see what I can gather for ya on this topic!

answered 7 years ago
0

Hello @REDACTEDUSER Thank you very much for the reply!

For anyone else interested the include for this is: Code\CryEngine\CryPhysics\rigidbody.h

int integrator; // 0 - explicit Euler, otherwise Runge-Kutta

One question I have related to this is, what will happen to CryPhysics? Will it become depreciated soon or in the near future? Hoping physics will receive some much needed attention soon.

I am currently evaluating the functionality and limitations of the current physics to determine if a custom physics implementation is necessary, I am hoping it is not. A few limitations such as not being able to set the center of mass or moments of inertia are leading me to think it might be necessary. I may need to strip out anything that would effect physics except for collisions and start from there so I have complete control.

My plan is to implement a full C++ flight dynamics library class for the Lumberyard community that would be available for everyone to utilize. For now there is a lot more experimentation necessary before I get to that point. Expect many more questions on the subject! =D

Thanks again!

Regards, Uriah

answered 7 years ago
0

Hi @REDACTEDUSER

The Physics team is hard at work to improve the experience for all users, and we hope to have more updates for you in the future!

That being said, I highly encourage you to implement such a flight dynamics library, and add it as a gem. You can never go wrong by giving people more options when it comes to physics simulations, and we love to see our community get involved!

And we are always happy to answer questions, so feel free to add more discussions in the future!

answered 7 years ago
0

Hey there @REDACTEDUSER

That's awesome to hear!

Based on my initial findings there are only a few critical limitations which I think could be fixed by your team quite easily.

I started a discussion this morning over-viewing my design of a Flight Dynamics Library for Lumberyard based on my experience over years of professional work with flight simulation. With a little help from you guys I hope to bring these capabilities to the community and am looking forward to hearing suggestions and feedback as I move forward with the detailed design.

Thanks for all your hard work! Regards, Uriah

answered 7 years ago

This post is closed: Adding new answers, comments, and votes is disabled.