Elemental Modding: Maps, Continents, Environments and Terrain

Published on Monday, October 12, 2009 By Brad Wardell In Elemental Dev Journals

Having spent the weekend modding up Elemental I was able to find some weaknesses in our data driven system that I think we need to address sooner rather than later. 

This technical blog will discuss how worlds are made using the Elemental engine.

Maps

Map data in XML (e.g. mapsizes.xml) defines:

  • Name of the map type (e.g. “Really big”)
  • Map size in tiles (100,25)
  • A default amount of land vs. water ratio (that can be adjusted by the user) as a % (e.g. 75% water).

Map Style

Map Styles (e.g. mapstyles.xml) determine how land is prepared for the map and includes:

  • Name of the style (e.g. “islands”)
  • Seed range (e.g. 5 to 7) to determine the number of seeds to start from
  • Number of continents range (e.g. 5 to 7) to determine the number of total continents there should be at the end.

Environments

The environments (e.g. coreenvirnments.xml) controls where different types of terrain will ultimately be placed.

Examples would include arctic, temperate, tropical.

Environments would include where in the map they can exist (i.e. between 20% from the top to 40% from the top for temperate).

Terrain

Terrain is where things start to get very interesting and complicated.  Mountains, Swamps, Desert, Grasslands, Plains, Hills, and lots of different iterations of these would be types of terrain.

One would imagine inside of a coreterrains.xml things examples like:

Arctic_Hills which includes these controls:

  • What environment(s) it can be placed in
  • Its defensive value
  • Its movement value (1.0 for normal, 0.5 for 50% movement penalty, etc.)
  • Its Influence Type (e.g. “neutral”, “good”, “evil”, “smurfy”, whatever)
  • Its cloth map icon
  • Its 3D tile image (taken from tile editor)
  • Its rarity value (0 to 100%) – what % of the tiles are going to be seeded with this.
  • Its growth rate for N, S, E, W, NE, SE, SW, NW (i.e. growth.se 33.0  which would mean there’s a 33% chance that the tile to the SE of this seed will also be given this terrain type).
  • Its classification (forest, mountain, etc.) if there is something notable about this tile you can classify it (normally you wouldn’t need to do this but forests can be logged and you might want to have 20 different types of forests that all can be logged).

When two terrains compete for the same tile, the rarity value determines which one “wins” the tile.

Now, the reason all this is important is because we (Stardock developers and you guys) as a team are going to want many many months of monkeying around with this data.  We want people to be able to come up with not just “forests” in the generic sense but redwood forests, pine forests, deciduous forests, etc.  We don’t just want “plains” but a zillion different types of plains. 

On the cloth map, it’ll look pretty much the same.  But when we get to the 3D engine, this will matter because, over time, as people submit their own tile creations from the included editors, the worlds will continually get richer and richer and better and more interesting.

For example, in the beta you have right now, there are no hills.  As a modder, I should be able to add hills.  Hills are obvious.  I’m sure there are people reading this who have traveled and seen some great stuff that could be put into the game.

So that’s what’s been assigned out to get into by Beta 1D.