I have begun work on the terrain system for DaggerXL. I read and parse the WOODS.WLD file and the CLIMATE.PAK file.

WOODS.WLD stores the global altitude map as a 1000×500 grayscale map. This will be used as the global, large scale altitude for the terrain. The lowest altitudes indicate where water exists. Obviously the real height in game for smaller bodies of water need to be determined by the height of the surrounding terrain.

DXL_HeightMap

This file also contains the “noise” data which determines the roughness of the terrain (how much the terrain undulates), which I’m storing but not using yet. Daggerfall natively doesn’t appear to use the altitude data but instead the noise is scaled by the altitude. So instead of generating large scale altitude changes, Daggerfall generates larger undulations about the zero plane. DaggerXL will also support this, if you want true Daggerfall emulation. However, DaggerXL will use the altitude map for large scale height and then modify that by the noise, scaled to reasonable values, by default.

The CLIMATE.PAK file contains the climate data for the world. This determines which texture set is used for the ground, what sky textures to use and what the foliage looks like. It will also modify the textures used for exterior, interior and dungeon blocks. Here is the climate data render based on the climate type. Note that I colored the water areas blue, although the data in the Climate.pak is one of the 4 main climate types here too.

DXL_ClimateMap

To get a more intuitive view of the terrain shape, I generated a Normalmap based on the Heightmap and apply some simple lighting. So smooth out the 8 bit height transitions, I apply a filter where the strength of the filter is based on the altitude of the center pixel – so that the coastlines are preserved. This was done at runtime with shaders, it’ll look much nicer when everything is combined – including high resolution details and better smoothing (fix up coastlines, raise lakes to the surround terrain instead of having them generating giant sink holes, etc.).

DXL_TerrainCheesyLighting

I’ve also started to use this data in the world itself, though at the very coarse 1000×500 scale right now. You can see a crude coastline in the screenshots below. Please note that this is still using 1 texture per terrain cell and is very, very coarse. But it’s just the beginning. 🙂

DXL_RoughClimate1

DXL_RoughClimate2

Advertisements