pioneerspacesim / pioneer

A game of lonely space adventure
https://pioneerspacesim.net
1.62k stars 374 forks source link

Weird system where a planet's reference frame includes its star #5885

Open lolo101 opened 1 month ago

lolo101 commented 1 month ago

Observed behaviour

I just jumped into system GJ1057 and my ship is immediately in the reference frame of GJ1057 d Furthermore, planet GJ1057 d has a moon GJ1057 d 3 that orbits at 0.75 AU from its planet, whereas the planet itself is at 0.71 AU from its star.

Also the autopilot behaves strangely

Expected behaviour

In a system, when the ship is closer to the star than to any planet it should be in the frame of the star. A planet should not have moons that orbit further from the planet than the planet is from its star

Steps to reproduce

Just load the saved game

  1. The ship is 0.04 AU from the star (0.41 solar masses)
  2. The ship is 0.65 AU from the planet (10.29 earth masses)
  3. The frame of reference is the one of the planet :shrug:

My pioneer version (and OS):

20240314 (Linux)

My output.txt (required) and game save (optional, but recommended) output.txt lolo1.gz

lolo101 commented 1 month ago

Actually it looks like the whole system is in the reference frame of GJ1057 d

lolo101 commented 1 month ago

Not sure that's related but when I ask the autopilot to send me to one of the stations on Boer's claim, it sends me right through the planet (and the ship doesn't crash, but the autopilot is unable to get out of the planet)

lolo101 commented 1 month ago

And it's impossible to land on the station. The ship simply goes through the landing pad and into the planet (still without crashing)

bszlrd commented 1 month ago

I think this is related to #5830

fluffyfreak commented 1 month ago

I think that our system generation has gone a little awry, I added some code to export the system to a json file that can be loaded and edited by the system editor and this is a screenshot from it showing that GJ 1057 d has moons in orbits that overlap with the main star of the system! image

fluffyfreak commented 1 month ago

@impaktor @Web-eWorks Does the Frame sysytem work purely off of the distance of the main bodies distance from the centre of the system? It's not very easy to understand, but it seems like the GJ 1057 d bodies Frame has a vast radius that encompasses all of it's moons orbits, those moons shouldn't exist as they overlap with the orbits of other planets and indeed the main star.

fluffyfreak commented 1 month ago

This is also the same bug as in #5839

Web-eWorks commented 1 month ago

Frame is entirely based on distance, yeah. It's a glorified sphere test. The problem lies in the system generation code - I introduced this bug, though it was rare enough I didn't see it before we shipped the update. The system generation "should" be bounding the maximum radius for a body's children, but somewhere in there it broke.

If you want to take a crack at this - systems in general should be bigger, the system generation code has a very nasty (and mostly unchanged by me) habit of cramming 5-10 satellites into <1AU around even very large stars.