Infinite Maps

Posted On 22 Aug, 2013

If you were to look at the project bio, or watch any of my videos, or read any of my other blog posts you would have gotten the impression that this game was about exploration. So what is there to explore anyhow? Until now the game has been an empty room with a backdrop where you can spawn some stuff.

Well, lately I have been hard at work fixing that problem by constructing an infinitely large map.

Of course, like all the other games that boast infinite procedural maps Wayward Terran Frontier won’t technically have an infinite map. What I am building instead is an almost-to-scale map of a full galaxy. It will be around the same size as the Milky Way. So while the map may very well be finite, I don’t expect anyone to ever use all of it. You will definitely not run out of places to go.

I’ll address some of the finer points below.


The game world is broken into discrete grid spaces only for the sake of keeping the object positions small enough to fit inside a single precision floating point number. That means you can look at everything inside your grid at once without seeing strange artifacts. When you reach the upper edge of one grid you are instantly placed on the lower edge of another grid. The plan is to make this as seamless as possible, the backdrop will change between grids but otherwise it is relatively invisible. There is no loading screen;

There is also a world map that will show you some of the larger objects in different regions from far away, mainly stars, black holes and nebulae (so far only stars). The world map will only show you individual grids when you zoom in very close to the stars and otherwise it will be seamless as well. It took a hell of a lot of math to get that to render correctly and I am quite proud of it.

Huge…yet tiny

The galaxy is broken up into 4194304 regions, and each region contains a grid of 268435456 * 268435456 different areas. Each area is the same size as the session you currently get when you tell the game to enter empty space. That is to say, a session is measured in half meters with each pixel being half a meter wide; A session is then 100000 meters wide since it spans from -100000 to 100000 which is 200000 half meters. If you add all that together you get about 54 quadrillion meters which…infuriatingly is actually only about the distance to Proxima Centauri ~ 4.2 ly (thank you wolfram alpha)

Since I think reality can take a hike and accurate scale in a 2d game is a silly goal, I have opted instead to scale the galaxy to somewhere between 100000 and 1000000 to 1. What this means is that in order to fly from one side of the game world in Wayward Terran Frontier to the other side would take about as long as it would take to fly from Earth to Proxima Centauri in real life: about 4 years at the speed of light. Of course, in real life you would see a lot of nothing during those 4 years, while in my game you will get to see lots of interesting places and explode lots of interesting people.

Also the scale factor could probably be explained away by…

Faster than light travel!

Q. Will your ship ever travel faster than the speed of light?

A. No, that’s silly, you can’t go faster than the speed of light.

Q. So then how will exploration be possible in a human life span?

A. Simple: we will increase the speed of light for you.

As detailed in a previous insane blog post the speed of light in each region will vary with the optical density of space, and thus you can move faster by having better dark matter sensors on your ship.

The practical implications of this is that you will activate “travel drive” which will drastically increase the acceleration and max speed of your ship and you will fly between stars the normal way: by incrementally visiting each location along the way. I promise you will get to see some interesting places before dying of old age.

Ships with better sensors will increase the speed limit in every grid they enter

High speed interactions

Q. But George, how will we ever interact with other players if we are all flying at such high speeds?

Well I considered that, and fortunately for us imaginary future technology comes with some HORRIBLE drawbacks! Specifically, the reactors on all ships cause a sort of inertial dampening field as a byproduct of their energy generation process. That means that flying too close to other ships limits your maximum speed unless those ships are in a “group” which is like a party and they have the frequency of their reactors tuned or some made up garbage like that.

You may have noticed that your reactors seem to create energy (and apparently mass) without any need for refueling. That sort of thing is necessary if you want to generate enough energy to travel between stars and shoot a lot of plasma balls for no reason, but how does it work? Certainly not even fusion or matter-antimatter reactions would fill those criteria of being able to create unlimited mass (and therefore energy at E = mc2) forever.

The answer is that they use resonant spacial distortions to stretch space until it is so warped that it functions similarly to the event horizon of a black hole, except you get access to both sides of the event horizon. Turns out that empty space isn’t really all that empty, and the event horizon causes virtual particles to break into real particles on either side of the membrane. These particles are then collected by the unfortunately named “injectors” and energy is created through common everyday matter-to-energy conversion devices(because why not).

Of course this creates a byproduct of lots of useless negative energy particles which can be safely jettisoned to space using the unfortunately named “radiators.” It also causes space around your ship to be warped and contorted in interesting ways which prevents things with reactors from moving very fast relative to each other.

Jeez, they should pay me to write this stuff.

Finding interesting things

One problem with infinite procedural maps created using noise functions is that no matter how fancy your math is, the maps are still just a representation of a noise function. That means you get a repetition and a trillion bland variations on “hot barren world without life”

That’s why the next step after this is to create a server executable. The server’s job will primarily be to fill this empty void with dynamic content so there is always something to explore. The procedurally generated world will be just that: a world, and the content will be separate. I have some big plans for how I intend to keep things interesting, but I suppose that’s material for a future blog post.

Of course the other aspect of a world is the people that live there, and this is supposed to be a game about a frontier after all. The idea is that the algorithm creates a world for you to modify and shape yourself. I guess that means I’m just making backdrops again. Oh well.

Speaking of next steps, I just wrote a huge wall of text and now I need to get back to work programming the things listed above.