Since quite a few hours now I'm trying to think about an algorythm, how to generate a dungeon with premade patterns the *best* way (there is no "best way", yes - but I want it to be as scaleable/ressource-friendly as possible ).
The main problem might be, that I'm not exactly sure, what the correct name for such generator is, in english - things like "pattern based generation" or "dungeon generation with samples" doesnt showed me any usefull google.
What I want to achieve:
Sorry for the big picture; here's its direct link: http://proxy.wtf/_storage/construct2/screenshots/sketch_pattern_based_dungeongeneration.jpg
When scene/level is starting, the generation-backend generates X (or less/more) rooms of an endless dungeon. The game starts when player wants to and ends when the player dies. A 8-way controllable player will be guided through a pixel-ish dungeon, filled with tons of monsters, secrets, chests, items and everything else, whats needed for a roguelike-hack'n'slash-RPG.
The biggest deal (for me) on this project, beside the art/gfx (because I suck in creating it like noone ever before ), is the room-generation part.
In what I need help:
I need some advice in creating the generator. Thinking about an array, which stores informations about multiple, premade room-templates like: floor, walls, static elements; a random one is picked and "created" for the player. To make some pseudo-pseudo-code:
Generation is triggered; // Trigger = player.X < 40% of current room; or a trigger-zone which is beeing entered
Generator picks X; // X = a random number which represents a room-index
Informations from array are parsed to the tilemap;
Tilemap is beeing extended & parsed tiles are getting added;
Because the player should be able to run backwards, I think, it would be the best to use a single tilemap which is getting bigger over time, instead of using multiple ones (if theres a more performance-friendly way, let me hear it!). Enemies, chests, dynamic objects, secrets and everything else should be added, too, when creating a room. Since Ild like to keep it on minimalistic hack'n'slay (not too heavy), many sprites are going to be generated each room (thinking about a minimum of ~10-15 objects and a maximum of ~20-25 sprites (or less, if the performance-impact would be too big in general... the targetted platform are mobile-devices)).
So, if anyone got improvements on my sketch, before I start to script it, please tell me here. I'm thankfull for every idea or tip to make my life easier!
Have a great weekend