

Distant regions could map to single points that expand into multiple points as you move closer to them. It doesn't have to know what else is there, or even exactly where it is, if it's far away minor errors in position won't be noticeable.įrom that point, they would just have to know what regions are adjacent, how those should look, and which ones to load as you zoom in / out or move around the map. If you select that point from the distance, it can just grab one of the stars from that cluster and tell you that's the one you selected. You could break space into regions, stuff that's far away can simply represent a cluster with a single point. They probably don't actually show you all the stars.

There's a few ways to cheat (re: optimize) this I can think of offhand. I'm not sure what they're doing with the double, maybe the actual rendering part needs to be double? Or they just didn't want it to look like integers?Īnd equally impossible to have a central database of 2^56 star locations with the relevant information, because the amount of storage space required to hold such a vast database. And they just used 10,000,000 because it fits into 32 bits and when divided by 100 fits into a double without losing precision. So, I speculate that they're using integers to do the generation math, because it's faster, then casting to double to store the output. Which you can round that last digit to get -93149.476563, which is what's stored in that JSON file.
#Spaceplan keeps becoming non responsive at launch 32 bit
If you took a 32 bit int, say -9314948 divided it by 100 to get some fractional value, and stored that as a double, it's what you'd get. The JSON values for "position" ( -93149.476563, -16197.441406, -32570.207031 ) all have 6 decimal places, which looks like they just took a double and rounded it.

You take the xyz coordinates (you'd probably want to use double-precision (64-bit) floating point for that, not 16 bit), you round them down to nearest integers. The simplest way to do it, suppose you have up to 1 star per cubic light year, you measure everything in light years.
