I'm working on a 2D game which involves firing projectiles around a solar system and having the path of the projectile change based on the gravitational pull of solar bodies.

I've been trying to find an explanation for how orbital mechanics work, at least in this simplified 2D scenario, but so far haven't found anything other than theoretical high-math documents.

I know that there are some existing games that do this already in 3D space, namely Planetary Annihilation and Interplanetary, but I haven't been able to find any references to how they did it. The Planetary Annihilation devs did a livestream demo of it once, but I haven't been able to find it since, and I don't think it went into much detail.

Whether by explanation or reference, does anyone know how 2D orbital mechanics work for the purpose of a game? How or where can I learn this?

  • \$\begingroup\$ Have you searched other questions about orbital calculations? Can you clarify what specific information you're looking for that's not in these existing answers? Is it safe to assume you understand Newtonian gravitation (ie. ||F_g|| = G*m1*m2/(r^2) ) and the use of physics integration? Or are you trying to model Kepler orbits for an "on rails" 2-body solution rather than integrating every time step? \$\endgroup\$ – DMGregory Nov 12 '15 at 17:05
  • \$\begingroup\$ @DMGregory This is a new topic for me, so I don't actually know any of that. I will do some more searching with the terminology you mentioned, thank you. \$\endgroup\$ – Nairou Nov 12 '15 at 17:38

Browse other questions tagged or ask your own question.