Friday, 9 April 2010

Small rooms

The problem with passages was that it had another bug that made the passage routine exit before it had reached the destination. Now it should work. Added more round rooms and small rooms. Now we're getting somewhere:
I think it's something I wanted, but it's going to have some stuff added before it's ready. The important thing now is fix the corridor routine between actual rooms. I have no clue how it works at the moment. It's supposed to connect closest rooms, but look at that long corridor made across the level. Not what was planned. Looks like the connecting logic is broken. Also looks like one of the room is left without connection.

The connection logic is more complicated than it appears, because you can't just connect all rooms from one to another. It will create a messy web of corridors. It's better try to connect closest rooms and then create additional connections which connect every room together in some way.

Thursday, 8 April 2010


The slowness of cavern creation was actually a bug in passage routine (a simple corridor). Also fixed small room bug that gave wrong locations for rooms, now they are created again. There is just one problem with passages:

A rogue passage not connected to main dungeon. You would think this kind of routine is easy to do, but it looks like you can fail in that. I mean how hard it is to draw corridors between caverns?

Then there is that issue with round rooms and corridors that can't find a proper wall. Guess I need that pathfinding for corridors after all.

Tuesday, 6 April 2010

Caverns revisited

I'm refactoring cavern class to create more natural looking caverns. I tried to use Teemu's source code for that, but caverns in Kaduria are much bigger and needed other type of strategy. Then I noticed that I could use Area class to create caverns itself. It almost worked right away. The neat idea in flood filling was that I'm sometimes using 2x2 seeds to make the shape more irregular. Damn it's slow, but look at this:

The round things are actual rooms added after caverns. They don't have corridors yet. The passage routine between caverns is actually buggy, but I guess it could look ok after small rooms (to be added later), because small rooms attach themselves in free areas just like those loose corridor ends. I like the result, although those long straight corridors don't look that good. Maybe this theme needs more caverns after all.

Friday, 2 April 2010


The dungeon generator of Kaduria is such an entity that it's hard to keep it in condition. When something is changed the generator can go bananas. This is what I got today:

It's trying to create a room in bad location, but it can recover from that and doesn't crash. I've made the map routines check out of bounds internal so it can't fail that way, but there can be areas that are disconnected. There is still some serious stuff to do with corridors and how they are connected. Corridors are always the problem.