Putting the 'role' back in role-playing games since 2002.
Donate to Codex
Good Old Games
  • Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

Why have dungeon crawlers either thin or thick walls?

Rincewind

Magister
Patron
Joined
Feb 8, 2020
Messages
2,480
Location
down under
Codex+ Now Streaming!
If your engine can represent "wall style", it can represent everything, because like I said: Thinwall is the superset of all of these. All thickwall maps are just thinwall maps with spaces unused. If your engine supports thinwall maps, it supports thickwall maps with zero modifications of anything: All you do is build the map with the space unused. Presumably you can then trip the player up by hiding mechanisms and secrets in there. Alternatively, if you give the player the opportunity to breach walls, breaching a faux-thickwall-map results in putting a hole through the wall and hitting a sewage line, resulting in the player being showered in shit, or a power line, resulting in electrocution.
No disagreements there, and that's how I'm doing it. I picked a format that's a superset of all different map styles I've encountered (minus Obitus).

Interestingly, when I started thinking about this data format, I was categorising maps into the said three categories for myself. And from the player's perspective, Eye of the Beholder is really just tunnel-style; it does not matter for the player what else could the engine technically represent.

So yeah, you can look at it in two ways: what the engine is technically capable of, and how the maps look like when just look at the images and know nothing about programming. In my documentation I chose naturally the latter; it's written for regular gamers, not programmers.
 

Norfleet

Moderator
Joined
Jun 3, 2005
Messages
12,250
So yeah, you can look at it in two ways: what the engine is technically capable of, and how the maps look like when just look at the images and know nothing about programming. In my documentation I chose naturally the latter; it's written for regular gamers, not programmers.
The PLAYERS never need to see the rules of that. You merely present the world to them, you don't have to inform them the engine is capable of doing more, and then once you've established that false expectation for them, you can proceed to violate it like a schoolgirl in a Japanese cartoon at the moment it will most shock and inconvenience them.
 

Rincewind

Magister
Patron
Joined
Feb 8, 2020
Messages
2,480
Location
down under
Codex+ Now Streaming!
So yeah, you can look at it in two ways: what the engine is technically capable of, and how the maps look like when just look at the images and know nothing about programming. In my documentation I chose naturally the latter; it's written for regular gamers, not programmers.
The PLAYERS never need to see the rules of that. You merely present the world to them, you don't have to inform them the engine is capable of doing more, and then once you've established that false expectation for them, you can proceed to violate it like a schoolgirl in a Japanese cartoon at the moment it will most shock and inconvenience them.
I like your thinking. Bit like one of the Silent Hill games when your "safe room" suddenly starts attacking you. Now go and write a dungeon crawler around this idea!
 

Lord of Riva

Arcane
Patron
Joined
Jan 16, 2018
Messages
2,806
Strap Yourselves In Pathfinder: Wrath
That assumes that the game itself is placing them. Most maps are hand-designed rather than procgen, so if the map designer simply does not render an area accessible, the engine doesn't have to do anything special to "support" it. The player simply cannot go there. And most games will not be entirely made of 100% space-filling maps in either case.

It also assumes that the instinct of people doing a labyrinth is doing it with "thick" walls. If I were to do it I would use checkered paper (?) and use them as coordinates as either wall or not. Doing it with an open room first, then adding the walls on one (or more ) sides of the cooridnate is counter intuitive.
 

Chris Koźmik

Silver Lemur Games
Developer
Joined
Nov 26, 2012
Messages
414
So, overall it's a superior system.

Wrong, thin-wall dungeon crawlers have usually much more complex and interesting dungeons than any thick-wall based ones, so thin-walls are superior
Tastes can't be disputed :) If you like thin walls system and wish more games were to use it and find it superior and more appealing and everything that's perfectly understandable and perfectly valid. No one tries to argue this.

I was just trying to reply to the original question, from the point of view of game development. Thick walls system is technically superior and allows you to do more things than thin walls system and is overall superior, that's why games switched to it over time.
Note that there was a reason why they decided to switch from "thin" system of M&M 2 to "thick" in M&M 3-5. If these were equally good or thin system was better for their needs they would not do it.
 

Grauken

Gourd vibes only
Patron
Joined
Mar 22, 2013
Messages
12,803
Note that there was a reason why they decided to switch from "thin" system of M&M 2 to "thick" in M&M 3-5. If these were equally good or thin system was better for their needs they would not do it.

M&M 3-5 are very special cases of TB-based dungeon crawlers, as they have monsters roaming around in a physical plane making them more akin to real-time dungeon crawlers, hence the switch. It's the exception to the rule basically
 

LarryTyphoid

Scholar
Joined
Sep 16, 2021
Messages
2,233
I first noticed this distinction when playing the first 3 Ultima games, which pretty clearly use the "one grid per cell" approach to implementing the maze. Even doorways are an entire block, and when you enter one, you enter a sort of "door mode" in which you can only move forwards and backwards, and can't turn. Seems primitive when compared to Wizardry, but it didn't seem like intricate dungeon design was a big priority for Richard Garriott. If I recall correctly, I think even U4 and 5 use the same method of dungeon design, except the weird doorway thing is eliminated because every dungeon door in U4 and 5 leads into a top-down combat encounter (except secret doors), so you never notice the weird way doors are when compared to pure blobbers.

In designing my own blobber I've been having some trouble thinking of how to implement the thin-walls approach (which seems superior in every way). I was thinking of maybe brute forcing it by just doing the grid per array element approach, with a table of values that would determine the layout of the walls surrounding that texture, the same way you would implement doors and other unique tiles. It'd probably be really over-complicated and inefficient, though, like a lot of brute force solutions.
Rincewind mentioned how he used a matrix of structures to do it, which does seem more intelligent than integer values like I was thinking. I'll have to try that.

Is there a record of the very first game to do first-person mazes? I've heard that Wizardry took some inspiration from previous 3D maze games (accounting for how sophisticated Wizardry's layouts are despite being such an early game), though I don't know if they were any on home computers or exclusive to stuff like PLATO. It'd be interesting to see how that game approached this "thick vs thin" problem.
 

Rincewind

Magister
Patron
Joined
Feb 8, 2020
Messages
2,480
Location
down under
Codex+ Now Streaming!
@Rincewind mentioned how he used a matrix of structures to do it, which does seem more intelligent than integer values like I was thinking. I'll have to try that.

Gridmonger is open-source, you can check out the relevant bits here, e.g.:

Cell & CellGrid
https://github.com/johnnovak/gridmonger/blob/master/src/common.nim#L158-L171

The trick is to *only* ever interact with your cell grid "oversized" by +1 row and +1 column via helper functions that completely abstract away this quirk of the underlying data (that cells technically only have North and West walls). For example:

newCellGrid
https://github.com/johnnovak/gridmonger/blob/master/src/cellgrid.nim#L51-L62

setWall & getWall
https://github.com/johnnovak/gridmonger/blob/master/src/cellgrid.nim#L67-L87

Is there a record of the very first game to do first-person mazes? I've heard that Wizardry took some inspiration from previous 3D maze games (accounting for how sophisticated Wizardry's layouts are despite being such an early game), though I don't know if they were any on home computers or exclusive to stuff like PLATO. It'd be interesting to see how that game approached this "thick vs thin" problem.
That would be Oubliette from 1977 on the PLATO. The CRPG Addict has covered it very well; there are screenshots that show the wireframe 3D and a map of a dungeon as well (wall-style, just like Wizardry).

https://crpgaddict.blogspot.com/2013/10/game-12-oubliette-1977.html

EDIT: No, it was Moria from 1975, also on the PLATO.

I found it in this timeline, this is really awesome!

https://entropypump.wordpress.com/dungeoncrawlers/

The author of the list uses the term "dungeon crawler", and categorises games as "Wizardry-like", "DM-like", "M&M-like", *and* completely avoids the retarded "blobber" term. I fully approve of all that!
 
Last edited:

Alex

Arcane
Joined
Jun 14, 2007
Messages
8,753
Location
São Paulo - Brasil
As far as implementation goes, I think one of the simplest (but still efficient) ways of storing walls is using a two-dimensional array. Assuming we have an m by n map (that is, a rectangular map with m tiles on the 'x' axis and n tiles on the 'y' axis), then we will need two arrays, one m+1 by n for the vertical walls and one m by n+1 for the horizontal ones. I did a crummy drawing trying to illustrate this here:

edges-in-a-tiled-map.png


Note that you get six rows of 7 vertical walls each in this example, and 6 columns of 7 horizontal ones. Also note that the walls on the border are coloured differently (red for vertical ones and yellow for horizontal). The border walls might, in some games, be unnecessary. The game code could just assume that all border edges are walls, so you wouldn't need to store them. Some games, however, might not. You might want to load another map if the player walks beyond the edge of the map, for instance. Or you might want to be able to store different types of walls, such as a wall with a switch or a niche or even just have more than a single artwork for the wall. Anyway, if the smaller array was to be used, you would need an m-1 by n array and an m by n-1 array.

It is also possible to make our solution more space efficient by using a "sparse" array, that is, an array that doesn't need to store every value, but has an assumed value (usually 0) if a specific one is not found. One way to do that is by creating a heap-sorted array of wall indexes. Since (usually) the size of a specific map is constant, although we usually think of wall positions as a two dimensional array, it is possible to convert it to a single, unique index. In a 0 based array system, a vertical wall on position (x,y) (assuming position (0,0) exists) could be given the index (y*(m+1))+x-1. By storing these indexes in a heap-sorted array, it is possible to find a given index in O(log((m+1)n) operations, which is still a loss from the immediate indexing of the simple 2d array, but not a big one. As long as your map wouldn't have many walls to begin with, the extra overhead of the indexing would pay off. One aspect that might be confusing here, however, is if you want to have maps that are bigger than 15x15. In this case, you will need an index that is greater than a single byte. If, however, your wall itself is just a single byte, you might end up with, say, a struct that has size 3 (two bytes for the index, one for the wall itself) but alignment of 2; which would mean you would end up with an empty, unused byte for each element of your struct in the heap! Suddenly you are wasting three bytes per element in overhead, which might not justify the used of the sparse technique if your maps have lots of walls. Also, if your game accounts for the possibility of destroying or even building walls, you will get a bigger overhead using this algorithm.

For the walls themselves, there are a bunch of ways to represent them, of course. If you want to use an oo system, then you will probably want to store pointers to the wall class (note that in many higher level languages, the use of pointers is implicit). The advantage of doing so is that you can develop any kinds of wall sub-classes that have their own specific behaviours. For instance, you could have a grate wall that stops movement but not projectiles, or a wall with a niche, where the niche is a container of items, etc. Such system is not, of course, all that space efficient, but at least as far as modern computers go, the space used here is not going to impact the system in any meaningful way, and the ability to easily grow your game is frequently worth it.

An opposite approach has the wall being stored as an id, with different ids being different kinds of walls. As long as you know what you want to do with your walls, such system can be quite workable. For instance, you could have: (0 - no wall, 1 - standard wall, 2 - alternate wall, 3 - wall with niche), etc. By alternate wall, I mean a wall with an alternate artwork (so your walls inside a dungeon don't need to all look the same). It is possible to use this with different artwork for different dungeon types, so you could have 100s of different wall artwork but only two types per dungeon) You could even mix this with a flag system. Since we used only the first two bits in the previous example, we could use the next two for flags (bit 3 - illusory wall flag, bit 4 - wall with switch). So, if a wall had the id 10, we would have an alternate artwork wall with a switch that is really an illusion. Such a system still leaves some room for special walls as well. Note that our flags don't make sense if the first (as in, least significant) two bits are both 0. Thus, we could use these (ids divisible by 4 other than 0) to represent special walls. For instance, id 4 and 8 could be embedded staircases going down or up respectively, while id 12 could be a wall with a door. Note that some of the special cases (niches with items, locked doors, switches) could have their specific data (events for toggling a switch, items in the niche, key id and lockpicking chances) stored in a sparse matrix as well. Since these are usually few, compared to the total walls, the use of a sparse matrix might make more sense here.

Another way to save up on space here is if your maps are square. Since (n+1)n = n(n+1), then if we like in this example only used up to 16 different ids for walls, it would be possible to store in a single byte the id of an horizontal wall in the lower bits and the id of a vertical one in the higher bits. If you are using C or a similar language, the trouble of converting from one matrix type to the other is easily solved by making two separate arrays variables but making them point to the same position in memory.

Of course, you can just have each tile point to four different walls (along the four different cardinal directions). This is usually not a problem unless you are developing your game for a very old system. This allows you to create walls that aren't the same on both sides (which might be a problem for our special walls above, such as having switches or whatnot).

From the game design perspective, I don't much like thick walls because they are way too thick. You don't want to make rooms with too many tiles otherwise your dungeon will be needlessly large and empty. But if a normal room is only between 3x3 to 5x5, having a wall take a whole tile is too much. Furthermore, I think dungeons that have thin walls can account for a more interesting design for their size.
 

Krice

Arcane
Developer
Joined
May 29, 2010
Messages
1,334
The way I see the data for thin wall map is that each tile is 3x3 block with center piece and outer walls + corners, then each 3x3 is joined by their edges so walls are the same from both side. You can then add extra stuff like wall decorations with another map layer or even just having decorations as object with coordinates and facing. Thin walls with arched (or vaulted?) ceiling could be a fun idea.
 

Rincewind

Magister
Patron
Joined
Feb 8, 2020
Messages
2,480
Location
down under
Codex+ Now Streaming!
The way I see the data for thin wall map is that each tile is 3x3 block with center piece and outer walls + corners, then each 3x3 is joined by their edges so walls are the same from both side.
That's a really inefficient and error prone way of doing it, and that's not how it's done in practice. Check earlier posts.
 
Joined
Jul 4, 2014
Messages
1,563
Goldbox games already had different textures for different sides of a wall. Of course cartography programs don't have to care about wall textures and you can handle the few special cases where sides are functionally different (one-way doors, switches, ...) with enums (for example).
 

Grauken

Gourd vibes only
Patron
Joined
Mar 22, 2013
Messages
12,803
Goldbox games already had different textures for different sides of a wall.
If you think the wall is made of same material, why would the opposite side be different texture/material? Makes no sense.
Grid-based dungeon don't really have to be realistic, different texture for different sides helps with having rooms close to each other with completely different mood and style
 

Rincewind

Magister
Patron
Joined
Feb 8, 2020
Messages
2,480
Location
down under
Codex+ Now Streaming!
Goldbox games already had different textures for different sides of a wall.
If you think the wall is made of same material, why would the opposite side be different texture/material? Makes no sense.
Have you lived in a house in your life? You might have noticed that the exterior walls look different from the outside and from inside the house...
 

Rincewind

Magister
Patron
Joined
Feb 8, 2020
Messages
2,480
Location
down under
Codex+ Now Streaming!
Goldbox games already had different textures for different sides of a wall.
If you think the wall is made of same material, why would the opposite side be different texture/material? Makes no sense.
Grid-based dungeon don't really have to be realistic, different texture for different sides helps with having rooms close to each other with completely different mood and style
You guys realise you can paint the two sides of a wall different colours, or put some veneer on one side, but not the other, etc. Hello?
 

Grauken

Gourd vibes only
Patron
Joined
Mar 22, 2013
Messages
12,803
Goldbox games already had different textures for different sides of a wall.
If you think the wall is made of same material, why would the opposite side be different texture/material? Makes no sense.
Grid-based dungeon don't really have to be realistic, different texture for different sides helps with having rooms close to each other with completely different mood and style
You guys realise you can paint the two sides of a wall different colours, or put some veneer on one side, but not the other, etc. Hello?
I think he was talking about having one side be a stone wall and the other for example be one made of wood
 

zwanzig_zwoelf

Graverobber Foundation
Developer
Joined
Nov 21, 2015
Messages
3,111
Location
デゼニランド
So, overall it's a superior system.
No.

Thick walls are simple and work fine, which is more than enough for games that don't focus on complex dungeon design, but if you want something akin to Wizardry in terms of complexity, this approach will quickly fall apart as you'll have a HUGE map that will require more steps to traverse, thus turning it into a slog.

Thin walls allow more complex and 'packed' maps within a smaller space. That, and nothing prevents you from adding thick blocks by simply surrounding a tile with walls.
 

Norfleet

Moderator
Joined
Jun 3, 2005
Messages
12,250
I think he was talking about having one side be a stone wall and the other for example be one made of wood
You mean like if some weirdo puts wood panels over perfectly good stone walls, but only on one side because people are weird like that?
 

Chris Koźmik

Silver Lemur Games
Developer
Joined
Nov 26, 2012
Messages
414
If your engine can represent "wall style", it can represent everything, because like I said: Thinwall is the superset of all of these. All thickwall maps are just thinwall maps with spaces unused. If your engine supports thinwall maps, it supports thickwall maps with zero modifications of anything: All you do is build the map with the space unused. Presumably you can then trip the player up by hiding mechanisms and secrets in there. Alternatively, if you give the player the opportunity to breach walls, breaching a faux-thickwall-map results in putting a hole through the wall and hitting a sewage line, resulting in the player being showered in shit, or a power line, resulting in electrocution.
It's the other way round. All thick wall (with possibly a few very unusual and extremely rare exceptions which I probably never encountered in a real life) can emulate thin wall. Note that thin wall can not emulate solid transparent objects in the middle of a tile (like wells).

Again, think "levers on the walls", those are almost impossible to implement (in a sane way anyway) if you use a thick wall system which can not emulate thin wall system. Basically, to implement levers (4 directions) you have to use thin walls subsystem in the thick wall system.

Of course if there was just walls, doors and floors (don't recall any such simplistic game) then indeed thick system could be made without implementing thin wall subsystem.
 

Grauken

Gourd vibes only
Patron
Joined
Mar 22, 2013
Messages
12,803
If your engine can represent "wall style", it can represent everything, because like I said: Thinwall is the superset of all of these. All thickwall maps are just thinwall maps with spaces unused. If your engine supports thinwall maps, it supports thickwall maps with zero modifications of anything: All you do is build the map with the space unused. Presumably you can then trip the player up by hiding mechanisms and secrets in there. Alternatively, if you give the player the opportunity to breach walls, breaching a faux-thickwall-map results in putting a hole through the wall and hitting a sewage line, resulting in the player being showered in shit, or a power line, resulting in electrocution.
It's the other way round. All thick wall (with possibly a few very unusual and extremely rare exceptions which I probably never encountered in a real life) can emulate thin wall. Note that thin wall can not emulate solid transparent objects in the middle of a tile (like wells).

Again, think "levers on the walls", those are almost impossible to implement (in a sane way anyway) if you use a thick wall system which can not emulate thin wall system. Basically, to implement levers (4 directions) you have to use thin walls subsystem in the thick wall system.

Of course if there was just walls, doors and floors (don't recall any such simplistic game) then indeed thick system could be made without implementing thin wall subsystem.
I honestly cannot make heads or tails of what you're saying. Just for your info, both EotB and Wiz7 (one thick, one thin wall) had no problems with levers and other objects in walls or objects in squares
 

anvi

Prophet
Village Idiot
Joined
Oct 12, 2016
Messages
7,553
Location
Kelethin
There are a few walls you can break in Eye of the Beholder 2 and then a whole forest to chop down in Eotb3. The only thing I thought about walls is that I like the architecture and size to be somewhat realistic and varied in the game. Like if I am hunting giant ants in a cave or something, then I prefer it to be like a natural cave. Not have candelabras all over the place and carpets and store rooms. But then if it's an ancient evil catacomb full of Necromancers and a dragon or whatever, then I want it to be elaborate looking.

I still think EverQuest has the best dungeons for sure. Appropriate style and great variety and design. eg: Claustrophobic, low ceiling, slimy walled places full of angry Frogloks:

gukbottom-trap.jpg


Big open frozen labyrinth with twisting ledges that are slippery (the dragon statues are behind unbreakable glass, you have to find another way around):

velketor-statues.jpg


Castle Mistmoore owned by an undead demon type and filled with vampires and werewolves and some human/elf sex slaves:

mistmoore-gypsies.jpg


Lava filled dungeon under a volcano, etc:
soldunga-cwg.jpg


Any many more... Lots of outdoor zones too.

It is nice to not be built on grids too... Rooms and tunnels that twist in all angles in 3d. Sigh.
 
Last edited:

Norfleet

Moderator
Joined
Jun 3, 2005
Messages
12,250
It's the other way round. All thick wall (with possibly a few very unusual and extremely rare exceptions which I probably never encountered in a real life) can emulate thin wall.
Okay, how do you emulate a thinwall using a thickwall engine? You can't. A thickwall engine requires that a wall always take up a full square. Thus there is no way to emulate a thin wall where you can be on opposite sides of the wall in adjacent tiles. Doing the reverse just means you leave the filling space unused, as there is no requirement that all space be reachable.

Note that thin wall can not emulate solid transparent objects in the middle of a tile (like wells).
Objects fall outside the scope of walls, but if the idea is emulating an impassable obstruction as a wall, you could just surround the tile in walls.
 

As an Amazon Associate, rpgcodex.net earns from qualifying purchases.
Back
Top Bottom