Archive for June 2010

Many Changes

I have decided to change the direction of my world generation project slightly. I am quite happy with most of the results I have created so far. I would like to expand these to work mapped onto a sphere instead of a plane. There are a few reasons for doing this:

  • I prefer the use of hexagons to squares for any game I eventually build on top of it.
  • The hexagons are superior for simulation of many things like wind or tectonic plates.
  • Haven’t seen many other projects doing it.
  • Seems like an interesting challenge.

The first step of this process is to create the base geometry for the world and its cells. I based my algorithms for this off of material collected from this link about Discrete Global Grids. To summarize I started with an Icosahedron and implemented 2 different methods to subdivide it. The next step is to subdivide into a Truncated Icosahedron. From there I can continue to subdivide using either method until I reach the desired resolution.

Subdivision Samples:

The next step is to develop a decent camera control for navigating and zooming on the map. After this is complete I will begin to port my code that I have developed in Java to C++ and use the new world structure. For now I am just coloring faces to denote different information. Eventually I plan to make it more interesting visually but that is a long ways off.

The other change I have made is switching languages from Java to C++. Currently I am using Boost and SFML with it. Some of my reasons for making this change are:

  • Make my program more accessible. Many of the results as seen with the Tiled maps are difficult to output to an easy to view format because of the scale of the data. This way I can just post executables and data files that are more suited to viewing my results.
  • People won’t need to download a JRE.
  • Access to Boost library.
  • More flexibility when tweaking for performance.
  • I do plenty of Java development at work, this keeps things interesting and sharpens my skills.

Tiled & New Features

Over the last couple days I got around to writing an encoder for my world generator to write files for Tiled. This gives a lot more detailed view of what the world looks like compared to the bitmaps i had been using previously. I created a pretty basic tile set which is similar to the one used by dwarf fortress for the overland map. I hope to find/make more attractive tiles at some point.

If you download these two files the .tmx file can be loaded and viewed in Tiled:
Tiled .tmx file
Tile set.

If you don’t have Tiled:
Warning ! Big Image (5.73 MB 16384×16384 Pixels)
Rendered Image

I have also been adding the ability to place special features on the map based on different criteria. Some of these are already in the map above:

  • Glaciers : Placed in mountain regions where there is a river source.
  • Swamp/Marsh: Placed along rivers in all biomes that have vegetation. Swamps for forest biomes, marshes for grasslands biomes.
  • Flood Plain: Placed where rivers empty to the ocean for grasslands and desert biomes.

The next steps are to add more features to make the map more interesting. Some of these features include Plateau, Valley, Oasis, Volcano, Waterfall, Pond, Peak, Dry Lake, Frozen Lake. After I run out of land form features to add I will start working on placing civilizations. Not sure yet if I want to just place them in patterns that are reasonable or evolve them over time to build a history as well.