Representing Positions in Space #114
Replies: 3 comments 1 reply
-
|
I think that having interstellar coordinates being separate from in-system coordinates makes sense. For in-system travel, there could be two sets of coordinates - one designating a particular volume (maybe a cubic meter or kilometer), and the other representing more precise coordinates within that area (meters or centimeters depending on the size of larger volume). But I'm not sure it's worth the extra hassle, and I agree that 602 AU is probably more than sufficient. |
Beta Was this translation helpful? Give feedback.
-
|
I thought through the interstellar coordinates system that Horizons uses, and while it is compelling, there are two major flaws: you can't name individual solar systems, and you can't easily move all objects in a solar system. In Thorium Nova Prime, it's possible to create a solar system with a specific name, say Alpha Centauri, and then put multiple stars into that star system for binary and trinary systems. This is important, as evidence shows there is a high percentage of non-unary solar systems in our galaxy. I don't know if it's possible to represent non-unary star systems in Horizons. Based on the XML files used to create systems, the data about the star is tied to the solar system itself, which implies one star per system. In fact, Horizons does the solar system encapsulation thing too - planets are positioned based on their parent star, not a combination of interstellar and local coordinates. Same thing for objects and vessels - their position is baed on a referenced planet. So, unless there are any objections, the decision is that we will represent positions in a similar way to Thorium Nova Prime. I think the implementation will be slightly different, but the idea will be that there are specific places in interstellar space - solar systems, points of interest, where the crew can set course to. While traveling through interstellar space, the player ship's position is represented in very large units - somewhere between kilometers and light years (light minutes are a compelling option). Once the crew gets within a certain radius of their destination, their interstellar position is flagged with the ID of the solar system that they've entered and they begin tracking their position with the local coordinate system. And the same speed considerations will apply as well, outlined here: https://thoriumsim.com/blog/distances-engines-and-speeds Namely:
The above only talks about warp speed because impulse (sub-light) speed is way too slow to get anywhere without being absurdly fast in its own right. I defined impulse speed as 1500 km/s, which is insanely fast. At that speed, you can get from Earth to the moon in just over 4 minutes. All of these numbers are configurable, actually, so if folks want to make their own engines that go at whatever the crap speeds they want, they totally can. Anyway, I think that's all. If anyone has any objections or other considerations, post them below. I'll close out this discussion in a few days. |
Beta Was this translation helpful? Give feedback.
-
|
The 3 level system in Horizons is to allow for much more flexibility at all three levels. And in truth there will ultimately be 4 soon, with the planetary surface coordinates coming into play. It's important to understand, from an engine standpoint that you only actively are modifying one of those at a time. Meaning if you are moving around at the galactic level, the others are zeroed out. If you are moving around a the System level, the Galactic position never changes, and so on. So the player will transfer from one level to another, but never be 'active' in more than one. This also allows for a critical game mechanic... Loading resources as you transition. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
How should positions be represented in space?
Naturally, every object gets an X,Y,Z coordinate. To make it possible to represent small objects, we either need to have the scale be on the centimeter level, or we need to support decimals in the position values and run the risk of floating point errors.
JavaScript has a 53 bit max signed integer space (from -9007199254740991 to 9007199254740991). In practice, this means integer operations are accurate so long as the numbers you are working with are within these limits. In meters, that's 60,209 AU, which is 0.86x the distance from the sun to the solar system's Oort Cloud.
Even centimeters gives us 602 AU, which is 6x the distance from the sun to the heliosheath, which could also be considered the edge of the solar system. For reference, the Kuiper belt is 63 AU from the sun, which is 1 / 10 our allotted distance. Frankly, that's good enough for me. I doubt anyone would mind these limits for solar systems.
But that means we can only model a single solar system with JavaScript's limited number system. We also want to model interstellar movement.
Thorium Nova Prime approached this by having two stages - an interstellar stage that was measured in light years with decimals and each solar system was its own planetary stage. When a ship enters a system, Thorium figures out the direction of entry into the system and places the ship at the perimeter of the system. The outer limit of the system is determined as being just a little bit further than the furthest permanent object so the ship doesn't have to cross a bunch of dead space once they enter the system.
This means the ship's position has two components: in ID for the system the ship is in or
nullif it is in interstellar space, and an XYZ coordinate which is either in centimeters or lightyears depending on the stage the ship is in.Starship Horizons, another 3D web-based bridge simulator, uses a three-stage coordinate system: Interstellar, System, and Planetary. I'm not sure how the number limits work or what happens when the player ship crosses those limits. @LordAuric can talk more towards that.
To the best of my recollection, none of the other bridge simulators model interstellar space. I'm sure with scripting it's possible to emulate it by tracking whether the ship is outside of a certain range and dynamically resetting the objects in the map. This is how Dreamflight Adventures does interstellar travel.
I'm rather partial to the way Thorium Nova Prime did it, but I can also see the benefits of Starship Horizon's approach. For one thing, it would be nice to not have to deal with the position component having different units based on context.
I would love other thoughts, suggestions and proposals. Remember, we're limited by JavaScript's max safe integer and need to model both movement through interstellar space and the small movement of a small object.
Beta Was this translation helpful? Give feedback.
All reactions