Endless Dungeon explorer-thingy

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

User avatar
Froginator
Slime Knight
Posts: 188
Joined: Thu Apr 24, 2014 10:13 pm
Location: Germany
Contact:

Endless Dungeon explorer-thingy

Post by Froginator »

So I was wondering how I could make a "Dungeon-Crawler" or whatever you call that type of game these days, in the OHR engine. I want to make a game where you can:

-Explore an (almost) endless dungeon (with randomly generated rooms and layers)

-fight bosses on every fifth layer (using the default OHR RPG-styled fighting-setup)

-fight normal enemies (Which are, including the bosses, actual NPCs on the map)

-find loot (in chests or on the ground)

-have different tilesets for each layer (just like in baconthullu)

-find items for puzzle solving (like hammers, shovels, or bombs)

-find armor in chests (Even I managed to do that before xD)

-have 3 Frame Walk/Use/Talk animations for Walktalls (for the characters of course)

-have a hub area with a shop and different selectable characters (which can be unlocked by fighting bosses)

I know this is a lot of stuff, and I have some vague ideas of how to make some of these, but I wouldn't be making this thread without any questions. So I'm asking you guys how I can make these things, or if there even is a better engine for this type of game. (I would love to make this in the OHR though, because I love the engine for it's simplicity) I did read the plotscripting dictionary and did a few tests, but I'm still not
a good programmer so I really need some help :gonk:

This whole thing will probably be pretty much like "The Crypt of Baconthullu" just with a hub and RPG-like battles, and more open "Rooms".
Last edited by Froginator on Mon Aug 31, 2015 5:31 pm, edited 1 time in total.
User avatar
kylekrack
Liquid Metal Slime
Posts: 1188
Joined: Mon Jun 16, 2014 8:58 am
Location: USA
Contact:

Post by kylekrack »

Do you want the battle system to function like Baconthulu as well or use battle formations that are activated by NPCs? I haven't dealt with procedurally generating maps enough to help you there, but I feel you could add in the random generation later. In the meantime you could make all of the maps by hand, with all of the bosses, enemies, and items that will be on each floor. That way you don't have to wait for a working engine to make all of the content.
My pronouns are they/them
Ps. I love my wife
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

I actually think the OHR is a perfectly good engine for this, as what you want is just an RPG with randomly generated maps. So this is a new game? Not adding a random dungeon to an existing game?

Aside from the map generation everything else you mentioned is straight forward; e.g. randomly place NPCs on the map for the enemies. The chests and items you find would also just be randomly placed NPCs; you would probably have the NPCs activate a script which uses "delete npc" to delete the NPC after you pick up the item (rather than using one-time-use tags, which aren't very suitable), and that script can also randomly pick the contents of the chest.

Wouldn't the hub area just be a normal hand-made map, with no scripting required?

There's a script on the wiki for three frames of walk animation, which can be used together with walktall. It comes with an .rpg file to demonstrate it:
http://rpg.hamsterrepublic.com/ohrrpgce ... me_walking

However if you're not confident with scripting/programming I think you're going to need someone else to script the map generation. I would offer to help, but I've already promised a lot of other things...
Last edited by TMC on Mon Aug 31, 2015 11:42 pm, edited 1 time in total.
User avatar
Froginator
Slime Knight
Posts: 188
Joined: Thu Apr 24, 2014 10:13 pm
Location: Germany
Contact:

Post by Froginator »

@TMC Well, this would be a new game. The hub area really is easy to make (just like the treasure chests). I would be happy to get some help with the scripting though, so I'd like to take your offer (thanks for that by the way :D) Only if you have enough time of course. I'd probably only need a solid script for the random dungeon generation.
User avatar
BMR
Metal King Slime
Posts: 3310
Joined: Mon Feb 27, 2012 2:46 pm
Location: The Philippines
Contact:

Post by BMR »

Aren't the scripts for Baconthulu available for viewing? Might be a good place to start looking. If not though, then RogueBasin is a good place to start looking for an algorithm or two to do the random generation. If nothing else, there are a bunch of articles that'll get you started in the right direction.
Being from the third world, I reserve the right to speak in the third person.

Using Editor version wip 20170527 gfx_sdl+fb music_sdl
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

The problem with Baconthulhu is firstly that it creates mazes, not room-based dungeons, and secondly it generates the map as you play. And no amount of existing C/Java/etc code is going to help if you're not confident programming in HamsterSpeak.
User avatar
Froginator
Slime Knight
Posts: 188
Joined: Thu Apr 24, 2014 10:13 pm
Location: Germany
Contact:

Post by Froginator »

@BMR No, Baconthulhu's (Sorry for spelling it wrong before) aren't viewable. I'm also looking for rooms and not for mazes, with a generation that's triggered by entering the dungeon layer, just like @TMC said.
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Oh, it looks like James forgot to include the Baconthulhu scripts with the most recent version of the game. They are actually public, you can get them, as well as all his other games, from the OHRRPGCE SVN server. (Most of his games are GPL licensed.)
Last edited by TMC on Tue Sep 01, 2015 11:12 am, edited 1 time in total.
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Oh! Thanks for noticing that. I will fix it.
User avatar
Froginator
Slime Knight
Posts: 188
Joined: Thu Apr 24, 2014 10:13 pm
Location: Germany
Contact:

Post by Froginator »

Well, if the script is being uploaded for public use, I'd be happy to use it! But how can I integrate bigger spaces, more complex wall graphics, loot chests, bosses, walktalls and the hub area in the baconthulhu script?
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

I added the baconthulhu.hss file to http://hamsterrepublic.com/dl/baconthulhu.zip

I am not sure if it is a good base for your purposes or not. The baconthulhu approach focuses on filling as much space as possible with narrow passages, and making sure that they are all interconnected and that there are no unreachable areas.

Quite a lot of articles have been written about random roguelike dungeon generation. You might find them to be informative reads, even if all their example code will be in other languages that might not easily translate to plotscripts-- the important part is the algorithm, not the code.

I think it might be your best bet to generate the random rooms first, and then to generate passages in all the non-room space, and finally to make sure that each room has at least one connection to a nearby passage.
User avatar
BMR
Metal King Slime
Posts: 3310
Joined: Mon Feb 27, 2012 2:46 pm
Location: The Philippines
Contact:

Post by BMR »

The way I do it is this:
  1. Fill the map with wall tiles.
  2. Find a random spot on the map that's at least X tiles away from the edge (where X is the maximum room size).
  3. Generate a randomly-sized room which is governed by your minimum/maximum room size settings.
  4. Fill the generated room with floor tiles.
  5. Randomly pick an edge (or do all four edges) of the room.
  6. Carve out a hallway from that wall towards the edge, and keep removing walls until it hits another floor tile.
  7. Repeat 5 & 6 as needed.
  8. Draw wall-map
  9. Populate with doors, treasure, etc...

Of course, that's definitely and over-simplified rundown, but it should give the basic gist of one way to accomplish dungeon generation. And as James said, there are lots of articles out there that describe algorithms of varying degrees of difficulty. Once you can wrap your head around the algorithm (no programming needed, just understanding the steps you'd need to take) you can then get around to the actual script. What's important is understanding what you need to do.
Being from the third world, I reserve the right to speak in the third person.

Using Editor version wip 20170527 gfx_sdl+fb music_sdl
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

In my experience, piecing together the tiles for the walls and floors correctly, across different layers and respecting what has already been placed nearby, is not as simple as it seems. ASCII maps are easier to generate.
User avatar
Pepsi Ranger
Liquid Metal Slime
Posts: 1419
Joined: Thu Nov 22, 2007 6:25 am
Location: South Florida

Post by Pepsi Ranger »

What I find works best for complex random maps (where rooms or sections may have differing landscape needs) is to generate zones first and establish which zones are allowed to overlap or connect. This includes figuring out which zones should be populated first (ground tiles), second (grass or water), third (rocks or trees), and so on, so that overlap doesn't happen in some weird top-down way. Then, once all the zones are generated (using "write map zone"), you can use a for/do block to sweep the map for each respective zone and fill it in with a random range of tiles, or if you're going for a particular look, a set range of tiles.

In the case of establishing large static rooms, it's all about designating a specific dimension of zones and coming up with a general map position where they can generate.

So, for example, assigning a random number 1-4 would determine which quadrant in the map the large room can generate in, and another random number can determine where in the quadrant the center of the room should be positioned. Then you can assign a double for/do block (the outer block for scanning the y-access, and the inner block for scanning the x-axis) with a random starting and finishing range (that's a few numbers positive or negative to the center tile coordinates) to determine the rectangular shape and size of the room, and write the zone representing that ground tile to that set of blocks. Then you can go back and adjust the shape of the room through a secondary script designed to find those edges and either add or subtract to them. Then once the zones are set, you can sweep the entire map with a double for/do block to locate any tile that has that zone assigned and give it the appropriate graphics through "write map block."

If you want, I can send you that game I've been dabbling with that generates entire parks at random (using the above method I've described) with the file, script, and design document if you think it might help understand developing and using a procedural-generated algorithm.
Place Obligatory Signature Here
User avatar
Froginator
Slime Knight
Posts: 188
Joined: Thu Apr 24, 2014 10:13 pm
Location: Germany
Contact:

Post by Froginator »

@Pepsi Ranger Wow, that's alot of good stuff you wrote there. And it would be great if you could send me the game. I'd be happy to look at it and try to make that sort of generating myself. It sounds really good for the game I intended :D
Post Reply