My Random Dungeon approach (looking for feedback)


Hi all.

As you might saw some of my earlier posts I was wondering about systems for random dungeons and I decided to go the easy way, the pseudorandom based on different templates.

This is what I have and I’m looking for feedback.

First of all, most of it is stored in MySQL for easier management.


I have different areas. In the database I save the resref of the area, plus the tileset type (cave, dungeon …) plus a value of 0 to 3 depending on:

0 - single level dungeon, it has only one entrance
1 - first level dungeon, has an entrance and a transition going down (stairs, ramp …)
2 - middle level dungeon, has a transition to go up and a transition to go down
3 - bottom level dungeon, has only a transition to go up.

Bottom level dungeon can be used for dungeons of only 1 level where you enter going down.

I have several designs of each one, however I’m currently only using single level dungeon because is easier to create 10 caves, 10 crypts … etc than 40 (10 for each level) as I have some sort of variety.

When you enter a dungeon, the transition is empty and there is an onclick event that checks for:

  • Number of levels
  • Type of enemies (it can be totally random)
  • Type of dungeon (tileset)
  • Name of the dungeon
  • Tag of boss item (the boss can drop a specific item if needed for a quest).

Then a new dungeon is instanced for the player. Whenever you enter a dungeon you enter your party leader’s dungeon or your own if you are not in a party, the leader does not have an instance or you are the leader.

It can happen that you enter your own dungeon becaues your leader has no instance, then he creates his own instance and then you exit your dungeon and then enter again and end up in your leader’s dungeon.

One of the things that I have to do is that whenever a new instance is created for you, your old instance(s) are deleted. This can lead to you being the leader of a party, entering a new dungeon and having to delete an instance with players in it. In this case they are moved back to the entrance. This should not happen often but is needed to avoid having tons of areas instanced and not played. Also instances are cdkey based and not player based.

This is ok in my action setting as RP is not forced so this things can happen.

My question here, how do you see that scenario? When you are sent out of a dungeon because the owner started another instance? It shouldn’t happen a lot but I want to keep the module free of useless areas.


This I’m working on at the moment looking for the most optimal solution.

Right now, I have level 1 creatures using the wizard, a couple of goblins, orcs etc … and I spawn whatever I need and level them up accordingly. I also add some effects like regeneration or more damage for more high level creatures.

My idea was to have level 1 templates of, Animal, Fighter, Barbarian, Rogue, Wizard, Druid, Cleric … and then change appearance and sound but I don’t know if is possible to change the voiceset of a NPC without using NWNx (I’m on Windows) so I might need more templates (one for each race basically) which makes the module bigger.

I can always remove the voiceset and script the onattack so it plays some sounds depending on the creature.

My question here is how would you do it so is the most optimal? Having 4 templates for goblins (fighter, rogue, druid, wizard) and 4 for orcs (the same for example) and 1 for wolves and 1 for bears … because I cannot change the voiceset or just generic and use some scripts to play some sounds?

Thanks for the feedback.


It seems very complex.

Instead of deleting your old instance when you load a new one, why not have the instance be deleted when the last person exits? And why not just have only areas that exit in all 6 directions? You can always make the script say the passage is blocked or flooded or whatever if it exceeds a cap. That’s what I do.

I don’t know about spawns. Haven’t gotten to that, yet.