Simple Rogue-like Dungeon Generation

Monkey Forums/Monkey Code/Simple Rogue-like Dungeon Generation

impixi(Posted 2011) [#1]
HTML tested only.
Left-Click to generate a new dungeon.
Press D to toggle density.

EDIT (March 15, 2011):

* Fixed code so it compiles properly with Monkey V32.
* Restructured the dungeon class a little.
* Simplified the test code.
* Added barrier generation (walls, doors, rubble).




EDIT (17 Feb 2013):
See my latest post below for a different version.


impixi(Posted 2011) [#2]
Updated - see EDIT notes for details.


slenkar(Posted 2011) [#3]
cool dungeons :)


impixi(Posted 2013) [#4]
Here is my latest dungeon generation code (there's a "perfect maze" generation function also included):



It uses a less object-oriented/more structural approach in the code, that some people prefer.

Left-click to generate a new dungeon.


MikeHart(Posted 2013) [#5]
Thanks for sharing!


Gerry Quinn(Posted 2013) [#6]
Seven Day Roguelike Challenge starts March 9th this year, if anyone is interested!

http://roguebasin.roguelikedevelopment.org/index.php?title=Seven_Day_Roguelike_Challenge


impixi(Posted 2013) [#7]
When evaluating a game-related language/RAD tool, my first project is usually a rogue-like RPG. It's a good measure of flexibility, especially regarding run-time content generation. This is where GUI-heavy tools like Unity and Construct usually fail... But I digress.

At the moment I'm coding a miniB3d-based 3D viewer for the above code. I have two preliminary versions up and running, one using free-form movement, the other using lock-step movement (like Dungeon Master, etc). I'll post code here if I can clean it up enough before I get distracted by other things.


impixi(Posted 2013) [#8]
Here's a version incorporating an unoptimized 3d-viewer (free-form movement). Monkey V0.66b and miniB3d V0.33.2 required. Tested HTML5 only - Chrome browser on a high end PC. Performance is crap.

WASD keys - movement.
[TAB] - toggle Y lock.
[ENTER] - generate new dungeon.

** Run it in 'RELEASE' mode **



This is a partial port of my Blitzmax code from years ago that had texturing, collisions and performance optimizations. However, rather than optimize this version, I'm going to focus on a "lock-step" 3d viewer because that's more appropriate for a touch-screen environment, IMO. Plus, it should be easier to optimize because of an underlying grid-based architecture.


Gerry Quinn(Posted 2013) [#9]
You could even do it without 'real' 3D, like the old lock-step dungeon games.


impixi(Posted 2013) [#10]
Yeah, that's true, and I do have some relevant BlitzMax code I wrote years ago that I could port to Monkey. Unfortunately, that method requires a larger quantity of art assets, and it becomes finicky supporting multiple display resolutions. Lighting and camera effects are also far more difficult than when utilizing a 'proper' 3D engine... But maybe I'll post an example just for the sake of it, anyway...


impixi(Posted 2013) [#11]
And here's the 3D lock-step viewer (requires Monkey X Pro and MiniB3D)

UPDATED: 20 May 2014

* Fixed minor positioning bug related to camera paths when strafing and turning.
* Restructured camera pathing data structures and associated logic code.

# Tested "Desktop Game" target, Monkey X Pro V79B / MiniB3d V0.42.3

NOTE: "HTML 5" Target is "broken"?




slenkar(Posted 2013) [#12]
When I try to run in GLFW (in release or debug) it crashes cos it cant load mojo_font.png
dunno why
I cant run it in HMTL5 cos I dont have the shader hardwarez


Raul(Posted 2013) [#13]
rename "mojo_font: file to "mojofont" :)

do the same in the code..


impixi(Posted 2013) [#14]
I can't help with the GLFW platform, as I don't have the necessary tools installed at the moment. But I just tried the "3D lockstep" code compiled with Monkey V072a and MiniB3d V038.1 and it runs nicely in HTML5 (Chrome browser). Although the little bit of text seems to be fixed in 3D space now, whereas before it was attached in front of the camera...


DiabloV(Posted 2013) [#15]
hello

how to install minib3d ?


Midimaster(Posted 2013) [#16]
There is a minib3d beginners tutorial here:

http://www.monkeycoder.co.nz/Community/posts.php?topic=5070

The firstchapter descripes how to download it. If you don not understand or have problems, let me know. In this case I would update the tutorial.


impixi(Posted 2014) [#17]
Updated the 3D lock-step viewer, above. http://www.monkey-x.com/Community/posts.php?topic=374&post=87690