7
\$\begingroup\$

I want to create a small rocket-launching game, inspired by Kerbal Space Program.

Since there's nothing in orbital mechanics, that I still don't know. I decided to make this as close to reality as possible. The only moment I needed to discover is how to implement aerodynamics.

Well, this became a very problematic, since I discovered the way the fluid is simulated. My first idea was to implement small virtual aerotube, which collects data from solid object and calculates it aerodynamical properties, in dependency of its form. I want to collect this data as a part of build rocket process.

This is hard-but-possible-to-implement part, since there are lot of information of how to make incompressive fluid solvers. But rockets fly at supersonic and hypersonic speeds, so I need to discover how to calculate this forces in apropriate conditions. But, I can see, that implementing incompressive flows is a kind of almost-impossible-to-solve-problem.

So, I decided to ask a very generous question. How did those guys implemented aerodynamics in Kerbal Space Program game? And how usually people modelling it when things are getting little further than "basic understanding".

For me sub-sonic aerodynamics (in games) now seems almost clear. But trans-sonic, supersonic and hypersonic, seems like "Have no idea what to do".

\$\endgroup\$
4
\$\begingroup\$

Kerbal certainly didn't go for the realism you're seeking. For a game, it's much easier to just fake it.

While the ships designed in Kerbal are configurable, the parts are predefined in a very detailed way. Just look at what goes into making a part. That's a pretty big hint. All the parts have their drag defined. So, it's really just a matter of summing up the drag of the parts defined, factoring in their orientation, then using that value in your drag equation.

You can do some raycasting from the heading of your craft to see what parts are "visible" to that velocity. Include those parts in your sum of drag, factor in the atmosphere density and speed.

Improving the simulation is to not sum the force of drag and apply to the whole craft, but instead apply it to the individual parts producing the drag and let your connection system figure out how to distribute the forces. Further improvement means adding elements like heat, and shearing forces for damage. Finally you can add features such as lift to your model. This is really just a matter of adding perpendicular forces based on the forces that part is already experiencing. If you want things to get hairy at higher speeds, add some noise to your lift forces to simulate turbulence.

\$\endgroup\$
3
  • \$\begingroup\$ The newest aerodynamics model in stock KSP is a bit more involved than that, from what I understand. \$\endgroup\$ – PearsonArtPhoto Jan 31 '16 at 14:34
  • \$\begingroup\$ @PearsonArtPhoto Not really, I think it was just considerably less involved before. For example, prior to the aerodynamics update, nose cones had no effect (other than to increase the mass and complexity of the ship) \$\endgroup\$ – MichaelHouse Jan 31 '16 at 14:39
  • \$\begingroup\$ LOL, I thought, that they implement good real physics. \$\endgroup\$ – Vasiliy Stavenko Feb 1 '16 at 6:44
2
\$\begingroup\$

The stock KSP model is known to be quite poor, especially in versions prior to 1.0. In 1.0, they replaced it with a semi-accurate model, where essentially the effectiveness of various parts varied depending on the speed. The best Aerospace model for KSP is a mod known as Ferram Aerospace Research, which has a very detailed description on their page. What they do includes mainly varying the effectiveness of parts depending on the speed. This includes wings, fins, etc. The code is open sourced, feel free to take a look.

\$\endgroup\$
1
  • \$\begingroup\$ I tried. There're a lot of magic numbers in that sources. Seems, like they had some calculations and took some approximated results in sources. I couldn't find the story behind those numbers. \$\endgroup\$ – Vasiliy Stavenko Feb 1 '16 at 6:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.