I'm trying to create a randomized dungeon.
-
Hi, I have only had FUZE4 for a week or so now, and was wondering how one would create a randomized dungeon setting, similar to one in a roguelike game. I have my sprites and everything worked out, but am trying to figure out how to make the dungeons generate randomly. I saw nothing of it besides arrays in the tutorials, and so decided to come here. Any ideas as to how to incorporate this?
-
An accessible approach might be to make your dungeon grid-based, and have every tile of that grid be a random one of various elements (e.g. items, chests, enemies etc.).
It might be worth checking out the "Level" tutorial to see what I mean. You will have to do a bit of work, though, to have everything make sense.
That is just one idea of course! -
Okay, thanks! I will go try that now!
-
@OrangePeel Just some general advice. Don't try to run before you can walk. At least work through the tutorials first before diving right in (apologies if you have already done so)
-
Welcome @OrangePeel I wish you luck with your game because I like games like that. For the record Fuze has a superb and incredibly friendly discord server if you're interested. (I think the white icon at the top is the link)
-
@CasualTie5 recommended I use a grid like in the level tutorial, and I’ve been working on something like that on and off, however I created a single variable, rng, which I set to a random of five different tiles for the ground, but now whenever it rolls that randomly it sets it to just whatever it rolled first, so all the ground will be bare, or chests, or spawn enemies. I attempted to stick it all into a loop, however this caused it to do the same thing, but it would just random roll it multiple times and they would all still be the same. I just wanted to ask here if there was any way to do it besides making separate variables for every single space on the map. Does anyone have any solution other than that? I will be willing to do anything lower maintenance than making 100s of separate variables.
-
@pianofire. Yeah no I did do the tutorials, but thanks anyways, I appreciate just the attempt.
-
@SteveZX81 Thanks! I don’t really do discords and stuff though. :)
-
Share your code, you should be able to do it with an array, something must be going wrong somewhere...
-
@OrangePeel I would assume that is necessary - particularly, because you might want to compare the values of different tiles (for example, you might not want to have a group of four items right next to each other)
And if you use an array, it should be managable (using for-loops) -
If u want use the same random(number) just put in the loop instead of making 100 variables out of it in the loop the number will be always changing i hope this helps :)
-
@CasualTie5 thanks. I’ll go do that now.
-
@landein207 I tried that, but because it was all the same variable in the end of the loop it ended up being the same still.
-
Post a screenshot of the bit that’s giving you trouble :)
-
This post is deleted! -
This post is deleted! -
@DomDom Okay, I'll try it.
-
@DomDom surely 6 or greater
-
This post is deleted! -
No thanks kept clear of sprites and the map. But I believe you.