Sunday 19 June 2011

Maincraft Dev Diaries, part Un

Random Terrain Generation (or pseudorandom, more accurately) is a staple of many popular games, like Minecraft. And rightly so, because it adds realism to the game. It also adds variation, because the RTG is unpredictable.

The one I use in Maincraft is very simple:

  • Create a row of bedrock at the bottom of the map.
  • Make the bedrock randomly go up and down, to make it 'bumpy'
  • Place a seed block of stone. X and Y are generated from an algorithm based on the CPU time.
  • Allow the seed block to grow, by making everything in its von Neumann neighborhood turn into stone, for 5 steps.
  • Randomly turn stone into ores by checking a number generated from an algorithm based on the CPU time.
  • Create dirt in all empty spaces up to 3 blocks above the stone.
  • Turn dirt that is not in the shade (underneath a stone block) into grass.*
  • Create lava above any block of bedrock exposed to
  • Create two seed blocks of saplings. X and Y are generated from an algorithm based on the CPU time.
  • Allow the saplings to move downwards, until it collides with a block. If that block is grass, then it grows into a tree. Otherwise, it teleports to a random position.
  • Place a seed block of water. X and Y are generated from an algorithm based on the CPU time.
  • Allow the water and lava to grow in the same way it does in Minecraft classic.*
  • Turn all grass near water into sand, and kill plants that are underwater. *
* = Repeat this once every 1-2 seconds.

This creates a nice looking 2D world, as you can see from this screenshot:

Post any methods you might have in the comments!

--Thomas

Olaf Stapledon

It's really hard thinking of stuff to write.

Well anyways, if you see the bookshelf on the right, you will see the book 'Star Maker'. I'm going to talk about that book.

It starts with some guy. He's sitting on a hill, when, all of a sudden, his immaterial consciousness flies off into space. He starts hopping around planets, eventually finding one.
This planet is inhabited by these people. He keeps on jumping around them for a year, before he finally finds one he stay in. They both fly off into space together, and find various alien races. There's plant men, who eventually go extinct because they slept for too long, and symbiotics.

These symbiotics are made up of some sea thing and some land thing, and they go into space and build planet sized starships and stuff.

Then, they try to build an intergalactic ship the size of a solar system. The stars are unhappy (they are sentient!), and go supernova, killing almost everyone.

Then, some he-larious capers occur and every being in the galaxy bonds together as one consciousness. They die out due to the stars dying, being replaced by little white-dwarf worms that feed off dying stars. These all bond together into one, universal, consciousness, and go off to meet the Star Maker (a god). The star maker shoots them down or something, and the guy has a sudden revelation about the nature of the universe, called the 'Ultimate Moment of the Cosmos'. Then he goes back in time, and meets some nebula, and then goes back home.

The End.

Along the way, he also mentions another of Olaf Stapledon's awesome books, Last and First Men.
All in all, it's a very good piece of fiction and an excellent portrayal of alien culture.




--Thomas