Skip to content
← Back to Community
Procedural dungeon exploration in the console using C++
Profile icon
SPQR

A sneak peek at my current project.

Current features:
-non-blocking unbuffered console I/O
-Display class to handle treating console as a screen and characters as pixels
-Level class which handles the world space, supports negative coordinates, and can be expanded dynamically
-Room class
-Entity and Player classes

Planned features:
-Item and inventory system
-Enemies
-Combat
-HUD
-Objectives / quests
-Perhaps even multiplayer

Controls: W/A/S/D for movement, Shift+X to stop the game (mostly for debug reasons)

Voters
Profile icon
ll19afrj
Profile icon
programmeruser
Profile icon
badst
Profile icon
ebest
Profile icon
danilobezerra
Profile icon
ArmedWithStew
Profile icon
DiDeDoD
Profile icon
ash15khng
Profile icon
ViniciusOlive15
Profile icon
greenbean765
Comments
hotnewtop
Profile icon
mkhoi

Nice, i can't wait for more things to be added

Profile icon
CullenDAvello

@SPQR this could be really useful for my “heed the dungeon” game

Profile icon
SPQR

@CullenDAvello Which part?

Profile icon
CullenDAvello

@SPQR the procedural generation part

Profile icon
SPQR

@CullenDAvello That makes sense. Pretty much all of the procedural generation stuff in my code is in level.hpp, and I'll link you to the Wikipedia article i looked at for the maze algorithm in a minute :)

Profile icon
CullenDAvello

@SPQR thanks but I don’t know if I’m going to pick it up again, I’ve thought of a few game ideas, and there’s one i thought of called “The Destroyer” and literally all you do is fight epic bosses back to back. Unfortunately i have no idea where to start...

Profile icon
CullenDAvello

@SPQR preferably the menu, but I don’t know how yet, and ill probably look it up later I’m too lazy right now

Profile icon
CullenDAvello

@SPQR lol just gave you 5 upvotes

Profile icon
SPQR

@CullenDAvello well thanks :)

Profile icon
SPQR

@CullenDAvello I would start with gameplay before you get into menus and everything, one of the common mistakes for solo game devs to make is to work on a wide range of features before making sure there's a playable demo to keep it interesting to work on.

Profile icon
SPQR

@CullenDAvello I've been working on the Dungeon Crawler project for weeks and I'm just now starting to add GUIs

Profile icon
CullenDAvello

@SPQR dang ok

Profile icon
CullenDAvello

@SPQR lol 3 more upvotes. I need help with sprites n’ such, like how to use them give them animations (breathing, slashing, dodging, etc.) i looked at one of your games and it pulled it off wonderfully but i have no clue how it works, or what format the files need to be in etc.

Profile icon
CullenDAvello

@SPQR also images, i know how to make a png file in repl but how do i draw it on screen

Profile icon
SPQR

@CullenDAvello In order to use animations, you essentially have to change the sprite once an interval of time (usually a tenth to a quarter of a second). I did it by having a spritesheet texture and changing the portion of the texture that was used for the player sprite about 5 times a second, give or take.

Profile icon
SPQR

@CullenDAvello and in order to draw a png on screen you must load it as a texture, create a sprite using that texture, and draw the sprite to the screen.

Profile icon
CullenDAvello

@SPQR yeah that’s the thing i know what to do but I don’t know how to do it

Profile icon
RobertFurr

My friend is making an infinitely generated text adventure world using Python. It's top-secret, so I'm not telling you who he is.

Profile icon
CowNationz

Nice, I really like the display class and the use of getch. One suggestion is you should look into deltatime because right now movement speed is based on the FPS.

Profile icon
SPQR

@CowNationz That's a very good point, however I have implemented an input queue rather than movement based off passage of time for two reasons:

  1. Due to the nature of the game, position is based on ints rather than floats and I feel like because of that that movement based on elapsed time would be inefficient in this case
  2. The input runs in in a separate thread from the main processes and the display so i think that it would be a bit over complicated to implement time-based movement with that in mind.

Thanks for bringing it to my attention though :)

Profile icon
Highwayman

Amazing! Love the map too, it’s really fun.

Profile icon
SPQR

@Highwayman Thanks :)

Profile icon
Highwayman

quick question: why are you using both header guards and pragma once? How are they different?

Profile icon
SPQR

@Highwayman As far as I know they're the same, I use them both just because there's really no reason not to.

Profile icon
Highwayman

@SPQR oh. Alright, thanks! :)