Kerbal Space Dev
The Story of KSP — KSP 0.2

So, continuing our revisit of all the old versions, here is KSP v0.2:

As you can see, quite a lot changed on this update. Some things for the better, others, well, everything was a ‘placeholder’ back then.

This version saw the first appearance of a game system to control rocket staging. You can see it on the bottom-right corner there. It was a very crude, very placeholder-ish thing that created a blue tab for each stage it detected on the ship. You could move stages up and down, but it wouldn’t affect the sequence. There was also a ‘Launch’ stage, that was there until you hit space for the first time. There were a LOT of bugs on this system, but it worked, kinda.

This version also got a movable camera on Flight Mode, so you could pan around and see to the sides, but the flying was still restricted to the XY plane. You couldn’t go forwards or backwards, only up or down, left or right.

But the main goal with this update was to create a spherical gravity system. One that allowed the ship to orbit a planet. On most games, the world is a flat place, and gravity pulls you downwards. But here, the world was about to become round, and ‘downwards’ would become a very relative term.

But modifying gravity is, in itself, quite straightforward enough, you just apply an acceleration to the ship in the direction of the planet. But it was around here that we had our first encounter with floating-point inaccuracy issues, a set of problems that would pose a challenge to development from then on.

The floating-point problem, or ‘distance shakes’, is caused by the limited precision of the numbers the game engine uses. Every game can potentially suffer from this, but most games restrict the playing area to a human-sized playfield, and they’ll never see these problems.

What happens is this: Let’s think about numbers representing distances. For distances near 0m, say about 100, these numbers are precise enough to tell the difference between 100.0000 and 100.0001 meters quite accurately. But what happens if you shift (or float) that decimal point towards the right, to get a 100,000.0 and a 100,000.1? as you can see, there is no more room for extra decimal cases, because the limited single-precision ‘float’ will only hold so much.

This is a rather crude example, because the way floats work internally is quite a lot more complex and boring, but it does paint the picture: At distances like 1,000,000.0m, the finest detail the floating point can tell apart is on the tens of centimeters scale. That means it can no longer know what happened in the space between that, and the result is a visible shaking in the game.

Now, space is big, mind-bogglingly big. A million meters is peanuts to space, so you can imagine, after a million kilometers, just how much precision we would be losing. Your ship’s parts could be anywhere inside a 100m-wide radius. 

Floating-point imprecision affects everything. Not just positions. If you make an object too big, it will start breaking the game engine, that can’t render it properly, can’t keep it’s textures mapped well enough, lots of issues. 

But we still needed a spherical gravity system here. And the game’s project called for a planet 1/10th the radius of Earth. That was our goal at least, and we were forced to compromise. The very first version of Kerbin was only 20km big, and it was nothing more than a very big sphere.

It was enough though, to allow us to build a spherical gravity system, and to enable orbiting. We even set down a smaller sphere some way away, to be a moon, and test out transfer flights and things like that.

Around this time, we felt a very serious need for some notion of what was going on while you were flying, and we had no UI to the game yet. So I quickly rigged up a very crude, barely useful panel which showed your orbital trajectory as you went along. It’s that ghastly black square you see at the top-left corner there. Note that there is no indication of the planet’s surface. The line would turn red where it went below the surface, and that was it.

This helped with visualizing the ship’s trajectory, but the ship was doing other things internally as well, and we couldn’t see if a tank was about to run out of fuel, for instance.

We now needed a proper way to display game information, and that’s what we set out to do on the next update.

Cheers

Blog comments powered by Disqus