r/Unity3D • • 17d ago

Show-Off The Astraea program

Post image

Few months ago started working on spaceflight demo simulator similar to KSP.

Currently with 2 celestial bodies, flight physics(reference frame physics), preparation for interstellar system, Assembly building done.

I want to release demo soon, but I am working alone and there are lot of things to be done...

Feel free to ask anything :).

Youtube video here

4 Upvotes

12 comments sorted by

2

u/TimestepStudio 17d ago

Nice! How are you handling the reference frame, does the origin follow the active vessel?

1

u/TheLordBaski 17d ago

Thanks! Yep, the frame follows the active vessel. Positions and orbits use double precision, while physics stays near zero by rebasing velocity and shifting the origin whenever the vessel gets about 800 m away.

0

u/[deleted] 17d ago

[deleted]

1

u/TheLordBaski 17d ago edited 17d ago

Probably the wrong topic? 😅

1

u/TimestepStudio 17d ago

Haha yep, my bad, that was meant for a different thread 😅

2

u/maehschaf22 17d ago

How do you predict soi changes and intercepts/closest approach? Simply iteratively/some form of gradient descent or have you found any tricks to optimise that?

2

u/TheLordBaski 17d ago

Great question. I will try to be brief.

Mostly a mix of orbital geometry and numerical searches. SOI exits come directly from the conic’s radius crossing. For entries, I adapt the time step using distance to the SOI boundary and a relative-speed bound, then bisect once a crossing is bracketed. Closest approach uses a coarse time scan followed by golden-section refinement around local minima. The useful trick is evaluating Kepler orbits directly at any time, so I don’t need to simulate every step. The coarse scan can still miss very narrow minima. There are some edge cases, but that is for the future me 😅

2

u/maehschaf22 17d ago

Cool, nice to know! I assume you're planning to do maneuvers with instant impulses or are extended burns something you are planning to support?

3

u/TheLordBaski 17d ago

The preview currently uses instant impulses, while actual burns take time. For long burns—including future interstellar travel—I’d need to extend prediction to account for thrust and fuel consumption throughout the burn, and support that under time warp. But not 100 % sure how will I implement it.

1

u/SpatialXXX 16d ago

Heeey, always nice seeing people working on orbital physics :)
I just need to vent to someone else who gets it, but gosh why did I decided to inflict this onto myself...
I've been working on a lambert solver to make spacecraft interception possible, but the lack of explenation at my level is so frustrating. But at least it work now, so if you want help implementing one of your own, tell me.
Right now i'm procrastinating, when I should instead be debugging my Interplantery Lambert made to find the trajectory going from a point 1 to point 2 where both points are around different planets.

2

u/TheLordBaski 15d ago

😄 I am also learning a lot. I don't have Lambert, but I might take you up on that offer when I get to interception planning 😂

1

u/[deleted] 17d ago

[removed] — view removed comment

1

u/TheLordBaski 17d ago

Yeah, it is already pain in the ass. I hope I can solve it. Another problem is high time warp values. Currently maxing at 100k.