Space is Big

External SplatteringRam

As I start to program multiple objects on screen at once, it turns out we need a more robust movement system than merely relative to the ship.. Specifically, I need a way to pinpoint an object's location within the solar system, whether it be a planet, ship, or player. And, after some testing to determine the smallest change in location visible to the naked eye, I worked out that we need to do it to within a tenth of a millimeter.

To quote Douglas Adams' HitchHiker's Guide to the Galaxy, "Space is big. You just won't believe how vastly, hugely, mind- bogglingly big it is. I mean, you may think it's a long way down the road to the chemist's, but that's just peanuts to space."

For example, it's about 5,000 AU (747,989,353,500 or about 748 Billion kilometers) to the start of the oort cloud, and it finally peters out around 100,000 AU. If we do the math, that means the diameter of our solar system is roughly 600 quitillion tenths of a millimeter. 600,000,000,000,000,000,000. That's a lot of zeros.

This presents us with two big problems.

Problem One - Space is Big.

Allot's Praepotens 2

Accelerating at 3 G's (~30m/s/s, which may actually be too high to sustain ), covering that distance would take almost exactly one year of constant acceleration. We need travel times on the order of minutes, not years.

There are several solutions to this problem:

We could scale up our accelerations - But allowing humans to withstand 100's of G's of acceleration would wildly affect combat. We could make time go by faster or slower - But a multiplayer game demands all players be on the same time scale. We could introduce system-internal warp jumps - But this would make for a less fun game, where players had a difficult time interacting with one another, and the high speeds attainable would make combat much less realistic.

My favorite solution is simply to scale down the size of the solar system - Scaling it down by a factor of 100,000 turns a 120 AU Pluto-to-Pluto transit into a 40 minute epic quest, and places the close-in planets and asteroids mere minutes from each other. Keeping the ratios the same allows more accuracy than any other the other solutions, while ensuring that fun doesn't take a hit for it. It's worth noting that this solution is nearly the same thing as merely scaling everyone's time by a similar factor.

At the same time, let's chop off the oort cloud and restrict ourselves to the Kuiper belt - At 5,000-100,000 AU, there's no method of scaling that will allow the Oort cloud to be easily reachable without making the rest of the solar system absurdly close together, and we can still access Oort cloud objects through comets. So instead of 100,000 AU, we merely need around 60 AU to reach to the far edges of the Kuiper belt.

So from our original starting point of needing 100,000 AU (600 Quintillion tenths of a millimeter), we now only need about (60*2 AU)/100,000, or 1.8 Trillion tenths of a millimeter.


That's a significant reduction!

Problem Two - Computers are less Big.


The largest number I can easily represent in C is somewhere along the lines of 4.3 Billion (4,294,967,295). That's a far cry from 600 Quintillion OR 1.8 Trillion - We're not out of the woods yet!

The naive solution to this problem is to use a larger variable in a slightly different language - C99, for example, gives us access to a 64 bit number instead of a 32 bit number, expanding our range to
over 18 quintillion! (18,446,744,073,709,551,615) That's more than big enough.

However, this method has a problem - Namely, hit detection. If I were to lump all objects in the solar system together, I would need to check to see how close each one was to each other one. Since I need to do this about 30 times per second and there may be thousands or tens of thousands of objects, this solution is likely to eat up a ton of CPU time.

However, there's a better solution - Chop the system up into Sector, SuperSectors, and MegaSectors.

Each Sector is 10,000 kilometers (1 billion tenths of a millimeter) per side - For scale, Earth is 12,756 kilometers wide. This means that a straight line drawn through our shrunken solar system would cross about 1.8 million different sectors. I told you space was big.

By adding sectors to large structures (SuperSectors and MegaSectors) I can construct an easy method of having enough sectors to do the job. Now, instead of needing to check for collisions against all other objects, I merely need to check in the nearest sector or two!

I've already got this system partially implemented, and have had some success making the ship fly around independently of the human character. The next steps are bug fixing and implementation of multiple objects. (Such as the sun and planets)

Click here for demo and purchase info


P.S. This article contains a lot of math and sometimes I miss things. So let's have a contest: Whoever spots the first major math error (Anything besides a typo or rounding error.) in this article gets a free copy of ScrumbleShip!


This seems pretty solid of a plan. you really know what you are doing and do a great job keeping us all in the loop. keep up the good work! Although it would be nice to be able to keep the solar system to scale, i understand the need to shrink it. Will you be scaling the planets and suns as well? also, i remember reading that players would be able to host their own solar systems. Will all solar systems be modeled after ours? i know you were mentioning the kuiper belt and such from our system.

dirkson dirkson's picture

If I scaled earth by the same factor as general space, it'd be a sphere 120 blocks across!! We are truly a mote of dust hanging in vast emptiness. I think I'll be leaving planets and asteroids mostly unscaled, if I can manage. Suns I may have to shrink - I haven't done the math on them yet.

I read breaking science yesterday that suggests that at least one other solar system has a kuiper belt - We measured it through the dust a large planet kicked up as it passed through it. Still, I think I'd like to randomize things - Set up systems with 1-4 asteroid belts, 2-5 gas giants, 3-8 rocky planets, and so forth. I suspect I'll allow the server owners to pick the numbers themselves, with a maximum cap. Star color/size too.



could you possibly make it's scale dependent on server/host choice?

I mean, possibly make it take a few (2-3) hours to reach an Oort cloud?
Maybe have "teleportation-gates" that deconstruct objects and send information via laser-communication beam to another station. taking more time the bigger an object is.

romey romey's picture

I did a little research and found out (don't know if true). Gs in a vaccum are different than on earth since your not working against a force or matter with a ratio of about 1 - 100 but you can't ever get no Gs without having a unverse without matter .


Ho there! I'm new here, so plz don't shoot, but I have something to say:

Having read a few "sciency" sci-fi novels, the obvious solution to the scale vs possible acceleration problem would be some sort of (sadly un-sciency) inertia dampning. Of course the problem with battles would still be there, but there could be several solutions to that:

*Scaling up battles. Spaceship battering away at a few KMs distance from each other might look pretty, but with no atmosphere or significant gravity and advanced computer targeting systems weapons could be effective at seemingly ridiculous ranges. Light-based targeting and weaponry could probably work at light-second distances, and moving even a single such from a relative rest at your proposed max accel (3 gees) would take over six minutes unless i fail at basic math ... :)
Edit: ofc I can't even get an elementary integral right. It's actually more like an hour+

*Putting some sort of arbitrary limit on accel in combat. Having some sort of powerful shielding tech that doesn't work with the "high-speed" engines, restricting you to much slower "tactical" engines if you don't want a few measly hits to break you apart. Of course you could still manage your momentum to get away, or have better tactical engines to outaccel, but it would keep the scale of things more manageable.

*Can't think of anything else just now, brain is slightly gooey from math exam ^_^


I think fuel consumption would be a concern,

think about it, unless you wish to follow the orkish hulk model of spacecraft, a heavy spacecraft will need to have either a pilot good at navigating gravity wells, or fuel to slow down, and change its velocity.

Revanchist Revanchist's picture

Is there going to be a technical limit to ship size (not in the sense of YOU HAVE PLACED ENOUGH BLOCKS, YOU MAY NO LONGER PLACE MORE, but in the sense that most computers couldn't handle working ships of that size?


I think that another solution of the travelling-problem could be these inter-solar-jumpgates. If you say now.. Maan this would reduce fun and you could get through the solar system without the ris of getting shoot. Wrong. Look at the game "Freelancer". If you dont know the game i will explain how intersolar jumping worked there.

If you where jumping throug a intersolar gate you where just accelerated.. There where many gates in a row accelerating you in a direct line. It was like a big highway. Between the gates you where getting slower and slower and at the naxt gate-- wooosh.

Now the safety thing. When jumping through the gates you can cancel you jump immediatly so you can rest somewhere in space.. If you know that there are an anomaly or something.. But other players for excample could interrupt you jumping with the right equipment..

What do you think ?

PS: these scanning before jumping and that larger ships has to be scanned longer is a great idea! :)

(im german and so pls excuse my english.. school english isnt made to talk in reallive. :/ . )

Garmine Garmine's picture

I found a math error, at least I think so:

The article says "100,000 AU = 600 Quintillion tenths of a millimeter" in multiple places.

Google: "100,000 au in millimeter" -> "100 000 Astronomical Units = 1.49597871 × 10^19 millimeters"

Now that's 1.49597871 × 10^20 tenths of a millimeter, which is ~149.597871 Quintillion tenths of a millimeter, not 600. That's a miscalculation by a factor of four!

We're The Borg. Every resistance is futile.
I went outside one day, the graphics were amazing, but the gameplay sucked...

Ryulord Ryulord's picture

Garmine seems to be correct...