Godot 4.2: Making Random Dungeons

Поділитися
Вставка
  • Опубліковано 28 тра 2024
  • More work for my untitled rogue like. I dip my toes into the mess that is Procedural Generation. 2 ways to go about generating random levels are the Random Rooms method and Binary Split Partition Trees, so I give implementing those a try.
    Attribution:
    "Aerosol of my Love" Kevin MacLeod (incompetech.com)
    "Go Cart - Loop Mix" Kevin MacLeod (incompetech.com)
    Licensed under Creative Commons: By Attribution 4.0 License
    creativecommons.org/licenses/...
    Tiny Dungeon - Art Pack
    kenney.nl/assets/tiny-dungeon
    creativecommons.org/publicdom...
  • Ігри

КОМЕНТАРІ • 21

  • @noise_dev
    @noise_dev Місяць тому +2

    I have prepared random generation for my game based on a HeartBeasts tutorial but I see that it won't be a good solution for me. Having premade rooms seems like a better option for me. good video man. I see your solution being basically what I need :D

    • @TimmyGobbles-pp8pf
      @TimmyGobbles-pp8pf  Місяць тому

      Nice! After doing some more work on this project, some of the layouts didn't have reachable rooms. Using a floodfill algorithm to check that each room is reachable, and regenerating the dungeon when they weren't helped.

  • @djdavidj
    @djdavidj 2 місяці тому +1

    Interesting to watch someone do it from scratch. I have seen others use wave collapse algorithm. This was fun to watch. Thanks.

    • @TimmyGobbles-pp8pf
      @TimmyGobbles-pp8pf  2 місяці тому +1

      Glad you liked it! I've heard of wave-collapse used for terrain generation but I'll have to check out its other applications.

  • @DrRumsmuggler
    @DrRumsmuggler 2 місяці тому +5

    Good video, would definitely prefer no music though.

  • @harminoffendl
    @harminoffendl 3 місяці тому +2

    Tnank you Dr Drew!

    • @b2rad
      @b2rad 2 місяці тому

      This is exactly what I thought within the first 10 seconds LOL

  • @Camel5067
    @Camel5067 3 місяці тому

    Hi Timmy, please continue this series

    • @TimmyGobbles-pp8pf
      @TimmyGobbles-pp8pf  3 місяці тому

      Hey, the Level Editor and the Lobster videos are part of the roguelike project, but aren't really proc-gen related. Is there anything specific you want to see more of?

  • @user-fy9lx9oc9f
    @user-fy9lx9oc9f Місяць тому

    Where from am I must have that all large code. 😢. I'm a beginner. How Am I write this code?

    • @TimmyGobbles-pp8pf
      @TimmyGobbles-pp8pf  Місяць тому

      Do you know any coding languages?

    • @user-fy9lx9oc9f
      @user-fy9lx9oc9f Місяць тому

      @@TimmyGobbles-pp8pf I'm know that language is GDsharp. I'm know a him basik, but so much code in video. I'll see video again . Thank you Timmy gobbles for video, but I'm scared from that large code

    • @TimmyGobbles-pp8pf
      @TimmyGobbles-pp8pf  Місяць тому

      I'm sorry the code is a mess, I'm still learning and usually my first solution to a problem isn't the cleanest answer. It might be easier for you to try following the big picture rather than my code. This dungeon generator should:
      1. Make a binary tree by splitting rectangles into 2 smaller rectangles each.
      2. When there are enough rectangles, put a "room" in each of them.
      3. Connect the rooms with paths. Start on the ends of the binary tree, and work back to its base node
      4. Display the dungeon somehow.
      I had the most trouble understanding how to make a binary tree, you might want to research that data structure first. Hope that helps!

    • @user-fy9lx9oc9f
      @user-fy9lx9oc9f Місяць тому

      @@TimmyGobbles-pp8pf Thank you so much for the comment, but I have another serious problem. I do not know where to find the code that does what I need. For example, I want to make blocks from tile map appear in one place, but I can't find what code does it. Please write me a comment in which you will find out where you get the information about the code. Otherwise, I don't even know this and I can't even start studying generation normally.

    • @TimmyGobbles-pp8pf
      @TimmyGobbles-pp8pf  Місяць тому

      So I go over using the TileMap class in code in both the Breakable Tiles and 2D Swimming tutorials on my channel.
      All the built in nodes in godot should have a page in the documentation that lists out that class's variables, methods, enumerators, and any signals. You can pull up the page you're looking for by hitting F1 and then using the search bar, or if you have that class name typed in your code, click on it with ctrl+LMB.

  • @delphicdescant
    @delphicdescant 4 місяці тому +1

    I suppose one fairly easy alternative to having the intersecting corridors just create new doors on rooms and stuff could be to have some or all corridors follow the paths of the partition lines.
    As in, a corridor can go from a room to the nearest partition line, and then follow that web of lines until it breaks off to connect to its target room.
    And maybe this could be a last resort to solve intersections, or maybe it could be default behavior.
    Or maybe it's not what you're going for at all, but I wanted to mention it since those partition lines are already guaranteed to not intersect any rooms. So it's kind of like free pathfinding for corridors.

    • @TimmyGobbles-pp8pf
      @TimmyGobbles-pp8pf  4 місяці тому +1

      I really like this suggestion. Because I stored corridors as 2 points, I was limited to only straight and L shaped corridors. This lead to my desperate "make it work" jank. When I revisit the room generation, I want to make corridors able to have any number of bends, and I'll give this a shot.