Wile94
Member
Hi, I've recently coded a maze generator inside a ds_grid. Each cell has a string value like "0000" or "1010", etc. Each number represents a wall/exit (0/1) around that cell (left-right-up-down), having a total of 16 combinations. Then I run a script that seals most of the "one way exit" cells to give it a more cave-like configuration. Lastly, I put a start cell point and an exit cell point so I can run a path finder to determine the most direct-critical path. Once the maze is done, I can export it and replace each cell with a template made out of walls, platforms, etc. (My game is a platformer, but it should work in every kind of game).
https://thumbs.gfycat.com/AltruisticBothCopperhead-mobile.mp4
My goal is to generate random levels with random rooms kind of an spelunky/binding of isaac hybrid. Now, I have the next concern:
The generator runs really fast, in fact, I can put my room speed up to 999 and the maze is generated instantly (it all depends on the size of the grid). But I'm aiming to generate around 4-6 levels with at least 8-12 rooms each (with different sizes) and it will take time mostly because the process is step-wise. I'm talking about a few seconds not that much, but maybe the player will find it kind of a turn down? I don't know, Spelunky creates its levels almost instantly every new run. I came up with these solutions for this issue:
-Put the maze generator inside a loop (for example: while(!endProcess) { generate } or do { generate } until { endProcess }). This way the fps will drop a lot but only around a few steps until the levels are generated.
-Use delta timing and let the generation run as fast as the user's processor can.
What are your thoughts on this? Maybe it's more of a design problem rather than a programming problem (if this is a problem at all). A lot of games (like Enter The Gungeon) have their loading screens and the player has to wait anyway.
https://thumbs.gfycat.com/AltruisticBothCopperhead-mobile.mp4
My goal is to generate random levels with random rooms kind of an spelunky/binding of isaac hybrid. Now, I have the next concern:
The generator runs really fast, in fact, I can put my room speed up to 999 and the maze is generated instantly (it all depends on the size of the grid). But I'm aiming to generate around 4-6 levels with at least 8-12 rooms each (with different sizes) and it will take time mostly because the process is step-wise. I'm talking about a few seconds not that much, but maybe the player will find it kind of a turn down? I don't know, Spelunky creates its levels almost instantly every new run. I came up with these solutions for this issue:
-Put the maze generator inside a loop (for example: while(!endProcess) { generate } or do { generate } until { endProcess }). This way the fps will drop a lot but only around a few steps until the levels are generated.
-Use delta timing and let the generation run as fast as the user's processor can.
What are your thoughts on this? Maybe it's more of a design problem rather than a programming problem (if this is a problem at all). A lot of games (like Enter The Gungeon) have their loading screens and the player has to wait anyway.