An Old Draft of the Solar System

Solar systems are procedurally generated using statistics gathered by NASA on over 400 solar systems, including our own. A solar system is seamless, which means that there should be no loading screen when traveling from one side of the solar system to the other, through 57 million x 1039 cubic km3 worth of space.

This video represents an older version of the framework that is currently in use. I’m still writing to improve some very basic issues such as multiplayer behavior. And I’m also still undecided as to the combination of heightmap, meshes and voxels I want to use for planets/moons.

Advertisements

Overcoming Float Precision

One of the first issues I’ve had to overcome in my quest to expand my digital universe was that a numeric value is limited by the size of its data type.

PnZ2a

In Unity, a Vector contains an array of float values. Any non-float data type passed through it will ultimately be converted to float. There are ways to change this behavior, but the result wouldn’t be worth the trouble. More importantly, the behavior doesn’t need to be changed, because it is the most performance friendly of the float precision data types, and because it already grants me 99,99 x 2 km to work with, unhindered, on all axes, which is more than enough if I can just find a way to expand upon it. And I have.

But, how?

The short answer: With exponentiation.

asd

The long answer: A solar system is basically a large cube with x*y*z amount of smaller cubes inside it. I refer to the small cubes as “Solar Bits”, and the large cube as a “Galactic Bit”, or a “Solar Byte”. The range of a Solar Bit is capped at 90 km from the center, and an object such as a player is not allowed to travel beyond this boundary. Once the player reach +90 km on the x-axis, the player’s position resets to -90 km on said axis, and a function counts that the player has moved +1 time past 90 km on that axis. To a player, it may seem like they’ve moved 53200 km from the center, but mathematically, the player is still in and around -90 and +90 km, multiplied by the amount of times they attempted to move from the center.

What can be made of this?

Similar to how Solar Bits make up a Galactic Bit, Galactic Bits make up a Cosmic Bit, and a Cosmic Bit can stretch as far as 830,103,482,543,835,709,620 km from the center. That’s 175 times larger than the Milky Way.