Wednesday, 4 June 2008

Rooms and stuff

Natural caverns do not a varied environment make. With this in mind, terrain generation now creates two sets of geometry. One is the natural cavern, the other encompasses built features. Both use the same marching cubes set and are generated from the text file map format, but the 'built' portions use much more boring density functions and will eventually have matching textures.

I'm increasingly getting concerned at the sanity of having a flat text file as my only map representation. For the moment, the key looks like this:

[#] => rock wall

[.] => rock floor
[n] => rock platform
[v] => rock ditch
[~][=] => rock pool (shallow and deep, resp.)
["]['] => vegetation (not implemented)
[:] => rubble (not implemented)

[%] => built wall

[,] => tiled floor
[_] => tiled platform
[+] => archway (not implemented)
[o] => pillar (not implemented)

Continuing to use different-but-similar characters for natural and built terrain features could be a pain in the arse. One possible solution would be to make this implicit, for example [~] could be represented as a rocky pool when surrounded by [.][#] but by a decorative water feature when surrounded by [,][%].

Speaking of water, I added yet another hack to the shader to colour areas below water level light blue. This should help with generating valid dungeons with water areas, and eventually should help debugging water meshes.

Anyway, a view of the 'room' bit of the dungeon with new geometry, moat and hideous textures:

No comments: