Wednesday, May 28, 2014

Making Planets

When I set out to create planets I had two goals:

a) I wanted the planets to be totally random, so that when I play the game they are just as new to me as they are to the other players.

b) I needed an application that could do this in significant volume, there is a need for about 375,000 planets.

So I offer a screen shot of a program I call Planet Builder. Using a handful of numbers, the tool creates randomized planets at a rate of about 1 per minute. Luckily I am able to run 5,000 iterations of the tool at a time making it possible to create all the planets needed in less than a day.

The example shown is actually only a partial planet. What you see is a water based planet (all the blue) with the solid land masses defined. Black is just plain land and the white are mountains.

Additional passes would be made in the tool to create resource areas. For example, parts of the map may have gold, iron, platinum, diamonds, etc that players can setup mining camps to harvest.

In terms of gameplay the concept is pretty simple. Speaking only for advanced players with significant skills, it is possible to scan a planet remotely with a probe that will return a list of materials that are available on a planet. If it is decided that there are desirable materials then the player can explore the planet with a landing craft. Flying around the planet the player can survey areas of the planet for specific classes of materials like metals, gems, gasses, etc. The survey computer will then return maps that indicate the areas that could be mined for resources.

The player would then send out additional probes to sample the quality of the resources to determine if it is worth mining.

Players have a choice in the level at which they wish to collect resources. Casual players may use robots to harvest materials, this inexpensive method would return enough material for a player to make some lightweight items for their own use but would be too slow if you plan to build items in mass for resale.

Alternatively you could build a mining camp. Camps have some requirements including security, power sources, transports for the materials, employees and the mining equipment. Other expenses may play a part such as life support for the employees if food is not easily obtainable on the planet or if there is no atmosphere. But the investment may be well worth the extra effort involved in creating a mining colony.

In case you are interested in what parts of the interface mean:
drops = the number of land masses created though the way land is generated 2 drops could run into one another and appear as one drop
passes = the number of moves the tool makes once the cursor hits the canvas
range = a random number is generated between the two numbers and acts as the distance between the current cursor location and the next
size = the brush size that is drawn on the cursor location

In the upper right the numbers refer to the randomness that takes place. Without some alterations to favoring the direction the cursor randomly heads in next, the numbers are even. But it is possible to manipulate it so that the cursor tends to "go south" more than "go north" which can help create planets with funky patterns. 

In practice most numbers in the interface will be randomized within a set of constraints for all planets that are created. Again, I want to play the game and experience every planet seeing them for the first time like any other player. So there are likely to be some really strangely laid out planets in the game. 

Multiple passes are made which draw the planet in a random sort of smudge pattern. The canvas is 1200px square (though this image only shows a 516px version of the app). 

When players locate planets they want to land on or survey an image will be offered that is 300px square (because that's the size of the interface onboard the ship that allows you to view terrain of a planet). The same small image will be used as a "mini map" when traveling on the planet. A horizontal and vertical line will overlap the mini-map to indicate your current position. Even though the planet is displayed as square, what you see if the entire planet flattened out, so when you travel to the right and reach the end, you start back all the way on the left so simulate the square being a round planet. 

Yes, it is a little unrealistic that all planets are 1200x1200 but things can change over time.

As far as exploring the planets, 1 pixel will equal 50px of terrain where your crew takes up 1 pixel. This means that planets are essentially 60k units square. This means that it would take about 15 minutes to circumnavigate a planet in your landing craft and about 3 weeks to walk around it on foot (assuming you can, there's no swimming allowed). 

No comments:

Post a Comment