Thursday, November 15, 2007

Caves

I said I wouldn't add new features until the first release, but if I do only debugging and balancing, my motivation rapidely decreases... So I started adding some little things to keep the project going forward.
Here is an early implementation of the "cavification" algorithm : how to transform a dungeon with clean rectangular rooms and straight corridors into a twisted cave. It's based on a cellular automaton and it's still very bugged (lights inside rocks, unreachable dungeon parts, ...). The transformation is applied in the BSP algorithm (see "Basic dungeon generation") between the room generation and the corridors generation. (screenshots made with an "All seeing eye" hack...)

Dungeon without cavification


Dungeon with cavification

I also slightly improved the chasing AI (but it's still very rudimentary... Now, mobs try to find you even when they don't see you anymore. But there's only a single behaviour : attackOnRange (the creature attacks you if you're closer than its attack range). While this can be enough for rats and spiders, I definitely need something more elaborated for humanoid creatures.