0

Right now, I'm making Dungeon Master like game. The game have to be more sword-and-magic-related than Legends of Grimrock; something like Corridor Wizardry 8. I'm going to make some decent graphic look so I'm thinking about the right cell system algorithm.

First I was thinking about BSP. I get some info from these links

but I don't know. BSP in its basic form is useful only for 2D-rogue-like dungeons.

I'm using C# XNA so I'm thinking about my own system defining cell by cell in xml, first their positions in space (making some tunnel-map system), then all of their details such as textures. But then, I'm afraid of placing "mapfile" generated objects like torches on the walls, treasure boxes, secret buttons, traps another items etc.

I want to know, which way should be the best to fulfill my in-game requirements and I don't want to spend months by exploring BSP and then choose another way.

Community
  • 1
  • 1
  • Dungeon Master and Legends of Grimrock both are 2D roguelike games at their core. They simply give you a 3D view into the world. BSPs are quite often used in 3D game engines (most famously in the Quake series, though plenty of games have used them), so it might be a good option for you. – Merlyn Morgan-Graham Apr 26 '12 at 09:33
  • But I'd personally go for a very simple grid based system, and not worry about optimization at all until it becomes a problem for your video card on your dev box :) At that point you'll have a good idea of how your game objects map in your world, so you won't be fighting two thought battles at once. – Merlyn Morgan-Graham Apr 26 '12 at 09:36

1 Answers1

0

In general, what you would be after for this purpose is Maze Generation Algorithms of which the BSP is one way of doing it.

However, you should decide on how are you going to represent your world first.

If you want to create a set of "linked areas" then you could go for a DFS type of algorithm which would attempt to link the individual areas in a complex way. (Think of it like the areas you navigate in MUD type games)

Otherwise, if you would like to go for one big solid Maze representing your dungeon then you could generate a simple bitmap with one of the algorithms in that wikipedia link and then use this as your "floor plan". This can then be extruded upwards to create the walls and give you a very basic "Doom"-like space which you can then enrich with torches / textures / any other objects.

I hope this helps.

A_A
  • 2,326
  • 18
  • 27
  • Well, i have no problem with making the dungeon predefined, by editor or raw edit some data file. My biggest problem is, how to place object in dungeon comfortably when i will have basic map with cells. So its more question on how to store the map data, how to design the structure. I will check the references from your answer, thank you. – Tomáš Sýkora Apr 26 '12 at 09:50
  • A "map with cells" could be constructed as N individual little rooms with doors or teleportation spaces. Once players go through a door (or teleportation device), they are sent (instantly) to the next cell / space. Therefore, each cell would have to have its own 3D definition (for example, a 4 wall room with objects). In this case the "cells" are a concept, you don't have to actually build your 3d world out of cells. You only need to know which cells are connected with which (and through which door) to be able to navigate amongst them. – A_A Apr 26 '12 at 10:47
  • yes and the connection of cells i describe by some grid. And each cell in cellsdatafile will have specific ID to be placed. So the most important now is the cell design. Ok thanks – Tomáš Sýkora Apr 26 '12 at 10:56