Sunday, April 5, 2009

World Generation


Started working on the overmap world generator. Right now it's in a very basic state. It generates a single main continent by taking the cross-section across the center of a 3D sphere and perturbing the resulting 2D map with some noise turbulence to get the general shape of the continent. Additional fractals and various tweaks are applied to generate areas of mountain, forest, desert and grass. In the works is to add river generation.

Each cell of the map is parameterized so that it contains various values: water content, vegetation level, mountain-ness/rockiness, etc... In a later stage of development, I will construct a system for taking these parameters along with a seed generated based on the world's seed in conjunction with the XY cell location, to create a 'sub-map' location that is a smaller scale version of that map cell. The parameters as well as information about a cell's neighbors are used to determine the algorithm and contents of the sub map. During play, the player will wander about on the overmap. But in certain places, encounters may happen: entering a city, being ambushed by trolls in the wilderness, running across a traders' caravan, etc... These take place within the sub-map of the cell where the encounter is determined to happen. Any combat or interaction with other entities takes place within the sub-map regions.

I am also in the midst of applying the generated parameters in the construction of a mini-map, an image of the overworld where 1 pixel = 1 cell or tile of the map, for purposes of navigation.

No comments: