Generating dungeons....

Posted by death on Aug. 2, 2012, 9:30 p.m.

is killing me. I can't seem to do it. I've looked up so much info on this, played with examples and it seems my low math skills and lack of programming experience cause me to fail every time. The only thing i need to do to finish my rpg is finish the dungeon generating code. I've tried different methods multiple times and i can't get the results i need. i can hardly understand most examples i found on the GMC. The BSP method made the most sense to me but i suck at using data structures such as grids which are needed. i can only write the most basic of code with them.

I don't think i can even ask for help at this point… again another project of mine comes crashing down completely due to my lack of skill… i really don't know what to do. i REALLY wanna finish this game but i just don't know what i can do. it's one of the most frustrating experiences i've forced myself into.

Everything else is done for the game too. Town generating, all the graphics, items, weapons, classes, etc. All i need is to generate dungeons, it can't be a full game without it and at this point, i can't hand make the dungeons - that would contradict every thing else in the game.

Does anyone have any good advice for randomly generating dungeons, or no of tutorials or examples for idiots like me?

Comments

Castypher 12 years, 4 months ago

If you want it to be the same, you'll have to use a seed that sticks throughout the whole game, but is different every time a new game is started.

I myself am new to seeding (only in GM, in others it's absolutely necessary). The default seed is based off of the system clock or something, but you can set it up to work for you. Once you get the hang of it, it's actually a very useful feature.

death 12 years, 4 months ago

I tried changing the seed manually before and ended up with a world of all water lol xD

putting in manual numbers seems to give really weird results.

Pirate-rob 12 years, 4 months ago

Mmm…

What I would do for generated dungeons would be to:

1. Fill the map with wall/stone

2. Make a starting point

3. Make another point

4. Make a passage between the points

5. Rinse and repeat steps 3-4 maybe even make 1 point split into 2 points

6. Now at every point generate a room with random stuffs in it

And viola you have a dungeon! Unless you want some other kind of dungeon…

death 12 years, 4 months ago

@Pirate-rob: that's a really simple way of doing it and could work out really well with enough effort. similar to what someone else posted earlier. ideas like this seem simple enough for me to pull off so it'll be my next attempt !

Rob 12 years, 4 months ago

Quote:
I tried changing the seed manually before and ended up with a world of all water lol xD

putting in manual numbers seems to give really weird results.

That's probably a fault in the generation, rather than seed changing then. Unless GM's seeding is fucked, which isn't unlikely considering it's GM…

All changing the seed will do is change where the random number thing starts at. If changing the seed did that, then you would probably also randomly get world of all water normally. Were you getting those without manually setting the seed? (basically, with GM doing its equivalent of srand(time(0)) implicitly)

death 12 years, 4 months ago

No, if i leave the seed for GM to decide, i always get randomly generated worlds with all tile types.

Rob 12 years, 4 months ago

That's…. weird.

death 12 years, 4 months ago

Indeed though it only generated strange worlds when using very small numbers: 0, 1, 10 etc If you use a large number it works as it usually would.