September 2009

The work on the terrain system continues. Each terrain “tile” (16×16 quads) is currently textured based on the climate derived from the climate map. Since the climate map is only 1000×500, each tile is actually only a small part of the pixel – which makes the climate and texturing very coarse right now. However I can travel throughout the whole world and the terrain textures and foliage change properly based on climate.

All the screenshots show the world map, with climates color coded. The white dot is the location of the player.

Below you can see 2 of these climates:



Note that some of the plans aren’t properly scaled yet, fixing that is on my to-do list.

In addition I’ve started incorporating the altitude information to generate varying heights. The base height is generated from a specially filtered version of the 1000×500 altitude map, where the individual vertex height is calculated from the neighboring large scale heights using bi-cubic interpolation. Heights tend to change slowly, for the most part, using this large scale map so I also add some noise to this base height. This noise is scaled based on the overall altitude generating larger perturbations at higher altitudes and smoother terrain near the coasts. Obviously this must be generated at run-time, whenever the terrain tiles in view are updated, so the noise uses the parametric tile interior as the fractional part and the tile location in the world as the integral part. This means that the noise is generated independently for each terrain tile but it still lines up without having to do any post processing. There are still a lot of work to do, such as making sure plants are on top of the terrain (instead of at height zero) and collision detection. In addition there are some seams due to the method of generating the normals but that will be fixed soon. Also note that the polygon density for this terrain is exactly the same as vanilla Daggerfall. However the noise is more coherent (multi-frequency Improved Perlin Noise), the view distance is further and gouraud shading is used instead of flat shading. I will implement a version that is more like the original terrain, with flat shading and simpler height changes later, for those that want a more authentic experience.

Here’s a sneak peek at the bumpy terrain:





Work continues but the terrain is coming along nicely. 🙂


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.


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.


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.).


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. 🙂



This is the last monolithic demo, which is why I’m now calling it the “Pre-Alpha”. From now on, builds will be incremental – smaller and more frequent. Many things have been added since my last post, including simple fast traveling, levitate, horse travel – implemented as a fast run for now, a title screen, interior doors with sound effects, dungeon music, a cheesy quick save/load and more. For the next incremental build, I’ll start working on real terrain system – so expect more exciting updates. 🙂

Note that the dungeon gameplay hasn’t changed much, not all the sound effects have been implemented – though the system is in place, terrain is a flat plane for now, NPC’s sometimes go through buildings (I have to offset their movement grid still)… this is very much a work in progress.

Don’t forget to look up the controls for casting levitate, fast travel, quick load and quick save. Also remember that the travel mode button on the full UI works as well.

Visit the downloads page to get the latest build.

The build is now ready for download!

The build has been updated to version 0.13.
Version 0.11 removes the ‘F’ and ‘G’ debug keys, as was originally intended, and adds support for texture replacer mods.
Version 0.12 fixes a texture replacer bug dealing with indices. Use this version if you want to see mods.
Version 0.13 fixes a crash when hitting “I” (which is no longer hard-coded). Also fixes 320×200 mode so it works in exteriors.