Dungeon Escape - Can Roguelikes Be 3D?

Hello there Unity Community, my name is David and I decided to start a project for college that relates to games. One thing that I haven’t seen done yet is a roguelike game with 3D graphics. Though the concepts have been ported over there hasn’t been much along the lines of an actual, finished, fully-featured 3D traditional roguelike. OK, it can be argued that the only way to be a “traditional” roguelike is to use nothing but text, but that’s a wholly separate argument. My end goal here is to first create a proof of concept and then begin work on a more fully featured one. I should probably plan ahead more.

The proof of concept will be rather simple and lack the bells and whistles of a more major game. The story will be rather simple, as will the 3D graphics. The goal with it is just to show that it can, in fact, be done.

I also plan on implementing neural network AI of some sort, though I need to make the game before I can program it to play itself.

Currently, I have map generation done, as well as player movement, basic character creation, and some purely random creature movement. The game can produce maps with stairs and the player can go up or down levels. Not much, but it’s a start!

Screenies!

1351087--66512--$tSEdFG3.png

1351087--66517--$mTByFwG.png

1351087--66518--$TGuXj1W.png

1351087--66519--$v7sQm3L.png

And here is a video of an earlier build. I’ll get video of the current one up soon.

Good job on your work so far. I’ve explored a similar situation. Generating maps that are 3d, but may as well be 2d is pretty simple but I found generating multi-elevation 3d maps procedurally to be a pretty difficult task. I assume you’re using some tip of “digger” algorithm. Guaranteeing connectivity while not having every map look the same or too hapahazard was where the complexity really kicked in for me.

Thanks! Yeah, this is turning out to be a neat thing to code. Definitely having some fun with it…

What I ultimately did for the level generation involved dropping rooms down and connecting them. I made a class that just defined what a room is and it has some data like if it’s connected or not, dimensions, and the like. It’s separate from the generation code itself, which can vary depending on what I want to do. I can make big, open levels by just plopping a pile of rooms in without caring if they overlap or not. In that case I’ll start with one room, set the rooms it overlaps to being connected, then keep going until all the rooms are check. That then moves to the hallway code, which connects any rooms that stayed unconnected.

The other one starts with just one room, plunks it down, then generates another room. This one will be removed and relocated if it overlaps the first one. It keeps doing that until it has as many room as I told it. At this point they’re all unconnected. It then picks a random square in the first room and the second then connects them. Both rooms are set to “connected” and it moves on. Next thing is it iterates through the rest of the rooms. This part checks if the room is connected and if it is just moves on. If it ISN’T it picks a random connected room and connects to it. I get more hallways by randomly connecting a room detected to be unconnected to a totally random room some of the time. More random connections makes more hallways, less makes fewer. It’s possible to tell it to generate not purely random halls and just connect them. I’m pleased with how it works, actually, given that I can fiddle with values to change how the level is generated.

Kind of tempted to post the scripts but I’ll admit they’re a hideous, undocumented mess at the moment.

Hello, me and my friend are going to make a roguelike 3D prototype, and hopefully at some point the actual game :slight_smile: …so i’m interested about anything you might have to say. Looks like you already got something there. I have done only some tests couple months ago, so i dont have much to say.

Few links you might find interesting:
http://www.roguebasin.roguelikedevelopment.org/index.php?title=Dungeon-Building_Algorithm
http://pcg.wikidot.com/pcg-algorithm:dungeon-generation

Adam Saltsmans explanation is easy to follow:
http://gamasutra.com/blogs/AdamSaltsman/20090529/1562/Procedural_Level_Generation_for_Artists.php

Emanuele Feronato has nice list of resources about roguelike genre:
http://www.emanueleferonato.com/2009/06/02/understanding-roguelike-dungeons/

What sorts of things are you interested in? I’ve been kind of thinking about this post and wondering what I should say but am at a loss. Only thing I could really talk about much is the code behind it. Most of which you can’t see when playing, but I guess that’s true of all games. Oh well!

Been tinkering toward another build and taking my classes. Much to do…

I suppose i dont know all the questions yet :slight_smile: …however i made wip for our project, check it out.

So you already done with map generation. How do you store map data? I got just two dimensional array, but i’m not sure if its the way to go, especially i’m wondering if three dimension array is reasonable, when there is more than one floor. I am just trying to figure out if there is other kind of method if you dont want to use grid based system.

Btw, check out this one: Delver Its roguelike 3d fps.

How I stored it was as a 2D array as its base. Each level of the dungeon is its own array of MapTile objects. Each one of THOSE has a floor type and a wall type. I made it an object so I could add extra stuff without screwing around with the array all that much. In this case I can just add other objects to the map tile and methods to access them. It also lets me keep the stuff as separated as possible so I can, say, modify the floor type code without changing the whole map tile.

Currently the levels are just stored in a linked list. Nothing fancy, really, just a standard linked list.

I haven’t tried a 3D array but I imagine it could work if you want the game to have a specific number of levels.

Anyway my implementation has a reference to a DungeonLevel that points to the current one. The level change handling is just kind of switching to a different level in the list.

There are probably a bajillion different ways to do things, really, but what I’ve been toying with is keeping references to the stuff in a particular tile on the tile object itself, as well as having each in-game thing keeping a link to the map tile it’s standing on. I have no idea if JavaScript can do this sort of thing but C# does it nicely.

Sounds like something i have actually done in 2d topdown shooter in Flash; nested array, where x,y holds object that holds tiletype (door,wall,floor,etc), tiletexture, items, spawnpoints etc… For some reason i keep thinking this roguelike is more complicated :slight_smile: …well sure it is, but i guess the map part aint so different after all. …but then we enter to dark area:

This one is probably going to be most difficult part, and newer done anything like this. Goal is to have levels like floor 1, floor 2 but also different elevations between any floors, and ideal would be to be able use also stairs, not just elevator. This all might be just little too much :slight_smile:

Indeed. One crazy idea i have, is to handle all data in multidimensional mindmap…

Minor update but a few things got added. FPS counter to see the FPS in the build. Thank you, Unity Wiki!

Biggest thing was that tiles no longer just vanish when they are no longer visible. Now visited tiles just turn dark grey so you can see see parts of the map. Worked on some other stuff behind the scenes but some of it isn’t visible yet. Icebergs and that.

The images don’t show it but you can destroy the spheres now. They still move randomly but if you walk into one it hurts it. They all have 10 hit points a pop. Still, they can die and vanish now. Next step is dropping loot and fighting back, I think.


Have you honestly never heard of Azure Dreams, for the PSx? Fits your description right there.

http://en.wikipedia.org/wiki/Azure_Dreams

No, I have not. Looking at the screenshots it seems like it isn’t fully 3D though. I’ve never played it so I can’t say, but it looks to me like the terrain is sort of 3D and the characters are generally sprites. Am I wrong?