Devlog 2: Kerbal Gravity Program (KGP)
KGP is a mission planning tool I’m building for KSP players and actual aerospace engineers to map out complex trajectories. It’s loosely based on libraries like Skyfield, Poliastro, and trajectorize. The ultimate goal is to make it easy to plot out massive interplanetary trips, whether you’re trying to reach Jool and Sarnus (with the Outer Planets Mod) or calculating a real-world journey out to Neptune.
What I did today
Today was way more math-heavy than I expected. I spent most of my time building out the core infrastructure:
-
The
Orbitclass to actually handle orbital mechanics. -
The
Bodyclass for celestial bodies and barycenters. -
The
absolute_positionfunction to figure out the exact coordinates of an object in a nested system, tracking it all the way back to the root central body as the origin.
What I learned
- Planet tracking is wild: The sheer amount of math required to find the exact position of a planet at a specific timestamp is honestly mind-boggling. It took a lot of staring at equations, but once I finally understood the logic, implementing it became a lot smoother.
- The heavy lifters are terrifying: The core system is going to rely on a Lambert solver and an RK4 integrator. I’ll be honest—these algorithms are so intensely complex that it looks like scribbles on paper.
Anyway, here is a small test run of the Python prototype in action:
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.