Very early alpha stage

I am doing my first working try of random dungeon generator. It works fine, as far as I can see, yet I’d love to have some other impressions.

My main concern is about performance, since I am using my own phone and it is kinda old, so the game looks a bit slow.

Thanks a lot for any help you can give me.

4 Likes

Cool game, didn’t get too far but I enjoyed what I played. Performance wise it seemed to run perfectly on my phone, which is a cheap Moto E, so good job there too. Didn’t notice any slow down at all.

The room generation seems to work great. What algorithm did you use?

  1. I did a matrix of 55 by 55 cells of wall of 64 by 64 pixels. They are pathfinding obstacles, but with the behavior inactive.
  2. Build rooms of 64 by 64 pixels in random spots (from 1 to 44, X and Y) and gave them random X and Y sizes (from 3 to 10, by 64). Each one got an ID.
  3. On room ID 1, I put a pathfinding object and madeit find a path to room ID 2. For each node, it builds a piece of road.
  4. From room 2, find a path to room 3, and repeat until all rooms are done. No path from last room to first one, btw.
  5. To clean everything, delete any piece of wall touching the roads and rooms, excluding the ones in the limits.
  6. Delete the walls don’t touching your rooms and roads, so now just the walls around them are left.
  7. Put enemies and chests on the rooms using random ID and random place on them.
  8. Delete the rooms and roads to free the most of your memory

I can try to clean it up, and leave just the room generator, and upload it

https://www.dropbox.com/s/alpfql8gcddc3hm/Dungeon.zip?dl=1

Just upload the clean code to dropbox.

Interesting strategy!

Do you want to try making an official extension for other GDevelop user to do something similar? If so, I would love to collaborate with you on it!

1 Like

I haven’t tried to make extensions, so it may be a good idea. Always good to learn something.

What text do you want me to put in the Author field? This can be your name and email, a short link, social media account, etc.

Thanks a lot. Name: José María Hernández Dorado.
Email: meceyn@gmail.com
for the media page it may be oscuridad666.itch.io page.

Thanks again

1 Like

Here is my current progress. Please review and make any suggestions!

1 Like

An awesome job, if I may say it. The idea of having a “safe break” for impossible rooms is clever. Something I need to add to my own code.

It could be good to add the option to delete the excess of terrain to save some memory and gain a few fps.Something like if “terrain object” not touching rooms nor hallways, delete them.

The place will look a bit emptier of course, yet you save some memory.

Checking some random numbers I made a dungeon that goes beyond the boundaries. You need to take in account the hallway’s size when making them. An adjust to the room creation limits or the hallway’s place so it doesn’t goes below 0 or over the terrain limit.

Maybe a condition in the creator like RandominRange(1+Hallways_size, (Terrain_size-Hallways_size)-1) so you get sure the rooms and hallways. I know it may not be as easy as it, but I hope it helps as an idea.

3 Likes

Hi mates I think this is awesome please make some tutorials of how to use it and how to add different sprites as walls, floor, etc.

2 Likes

For what I know, the extension will have comments and help for the use.

About using different wall sprites, my way to do it is:
+ When making the wall object and add one frame animations
+ In the creation event make the actual animation = RandomInRange(0,Max_Animations)

If you did 3 animations for the walls it would be RandomInRange(0,2)

2 Likes

Thanks for the ideas!

  • I do need to prevent hallways from going outside the map.
  • I will add an option to delete unused terrain.

First of all, great job on your examples, those are very well done and very valuable to the community.

This extension is not finished yet. You can of course use and test the non-finished code which is hosted on Github. Once the extension is submitted, reviewed, and published it will be available directly from GDevelop.

BTW, one idea for the rooms is to create External Layouts for rooms and insert those on top of the placeholder room objects made by the generator.

Another idea for the walls is to use the Autotile extension that FlokiTV is working on. (This selects the appropriate animation based on what position other tiles are located)

Thanks for the feedback as soon as this extension is available I will make an example template to create a dungeon crawler.
I have tried other methods but I have always gotten stuck in creating the corners

Ok, the option to delete unused terrain is implemented:

This has actually given me an idea. I should add another object type called “WallObject” and put those where these terrain are. (Users can of course use the same sprite for walls and terrain, but some people will want to be able to have walls look different).

And… now I think I am going to do the same thing for doorway objects! Thanks for helping with these ideas, guys!

2 Likes

On my game, I am starting to add the adult part of the game, and re drawing all the graphics (since I liked the cute femboy incubus I drew). It will have a different main character. (Incubus with angel wings) and the cute incubus will be the shop keeper.

I need to redraw walls, enemies, and start to think about power ups, both passive and activable) as well as the prices for them. And the save and load code.

Hi sorry for the late response, maybe @tristanrhodes can you help me I’m working with the extension right now but in 8x8 game and is a mess I resized all the sprites from your example to 8x8 I just create the dungeon with the extension parameters and added the external layout for room but is creating a Gaudi game.(Joke for this mess)

Look what it does, the green one are the pathway Why i this happening?

The events


It will surely need @tristanrhodes hand, for sure. I just check the extension, but I haven’t use it to test the limits.
My wild guess is that in 8x8 the pathfinder must have troubles to pinpoint the paths.
Of course, it is just a guess, since I am not sure how he handles the grids (originally it uses a 64x64 grid).

I hope he can answer you soon, otherwise I’ll download the extension and give it a look to check the limits.