Showing posts with label dungeon generation. Show all posts
Showing posts with label dungeon generation. Show all posts

Friday, 6 June 2008

Do you dais?

New textures, and removed much of the complexity from the walls and floor. Added some cheese to handle raised areas - with some ramps and fiddling, I want ziggurats! Beginning to like the result anyway, at least as a framework for more interesting stuff. Coarse wall features can be added fairly easily later, and it's definitely a good contrast to the natural rock.


Note the very annoying black bow-tie in the lower right. That's an edge vertex with broken normals. Wonderful, innit? There are a few places the edges of chunks are highly visible now, this being just one of 'em. Still, it's an improvement I guess.

The next step? Hmm. I think a better abstraction is needed for interesting features in the density function. I'd like to add things like ramps, wells, arches and pillars to the built areas, and rubble, potholes and the like to the natural bits, but without excessively complicating the basic generator. I think a more efficient method of obtaining data from the map would also be good, as it's used many, many times during density evaluation. There are also some weird problems with the natural parts, with walls developing holes and being rather bland. This needs to be fixed as much as possible.

Optimisation is going to be important. It takes far too long to generate a mesh chunk currently, on the order of ~10 seconds per 5x5 tile chunk. This isn't acceptable for a small, confined level, let alone large streaming areas. I'm pretty sure there's plenty of low-hanging fruit here though, and I'm not too worried.

Once the dungeon's looking acceptable and being generated in a sane timeframe, I think I'll concentrate on getting some placeholder meshes in for the player and monsters. The spheres really detract from my sense of satisfaction, far more so than the lack of 'furniture'. Once that's done, maybe it'll be time to start implementing game mechanics again!

Thursday, 5 June 2008

Built dungeon areas

Fiddling with the density function for walls to try to get nice big blocks. This may not be that useful in the long run as it's entirely possible that some nice textures will entirely suffice, leaving the density function to handle larger features. Good practise though.

I also changed the way normals are calculated. Rather than using the gradient of the density function, vertex normals are calculated in a conventional manner by averaging the normals of all triangles containing the vertex. This removes many very nasty artefacts caused by the low sampling rate of the mesh generating step. The big problem is that it causes some new artefacts at the borders of mesh chunks, because some of the triangle information is not available.

I could generate extra polys purely for the purpose of sorting out these normals, or I could revert to using the density gradient at the edges of a chunk. Neither option fills me with glee.

Behold, new walls, broken floor, and some visible seams where the normals on adjacent chunks don't match (especially visible where it bisects blocks on the wall to the right). I also boosted the brightness and contrast in this image, for no real reason other than to make everything a bit clearer. I have to say, the first person view feels really pants without a ceiling. I really should try to decide where I'm going and either put the ceiling back, or stop using the free camera.