Procedural Dungeons in Godot 4 | Tutorial

Поделиться
HTML-код
  • Опубликовано: 18 дек 2024

Комментарии • 142

  • @quwatz
    @quwatz  Год назад +45

    Quick note:
    In the tutorial I failed to mention that if you want to bring the dungeon generated in the editor over to the game, you also have to set the owner of each of the cells you add as a child.
    this can be done by adding the line :
    dun_cell.set_owner(owner)
    after add_child(dun_cell) at 39:21
    This is because when saving scenes godot needs to know each node's owner.
    Sorry for the neglect.
    I'll correct this in the github repo

    • @giampaoloschembri452
      @giampaoloschembri452 Год назад +2

      Hi, could you explain how a generated dungeon could be exported in a new scene? i try copy paste in a bunch of different way but the hidden walls became visible

    • @DarthMaterFPV
      @DarthMaterFPV Год назад +1

      Any chance of a Multi-Level Generation tutorial?

    • @TalonPratt-w5x
      @TalonPratt-w5x Год назад

      @@giampaoloschembri452
      I'm not sure if this helps at all, but the way I got the walls to not be visible in a live run was first to combine all of the DunGen/DunMesh primary functions to run one after another.
      Meaning that in the set_start function of DunGen, I have an instance of dun_mesh running create_dungeon after creating the grid map
      Then I made it so in my main world node in the main scene, I created a script that only has a _ready() function and I added a call to the DunGen set_start function in the _ready() function
      Essentially I have it so when I load my main scene, it runs the grid map generation, the dungeon mesh generation, disables to grid map generation, and this way all the extra walls are no longer in there

    • @WolfxE1998
      @WolfxE1998 11 месяцев назад

      I did everything like the video and added that line but when I play every cell contains every one of the doors and walls. Essentially every cell is a copy of the entire tileset and I can't move anywhere because I'm stuck in a 1 by 1 box

    • @WolfxE1998
      @WolfxE1998 11 месяцев назад +5

      i actually fixed this. I had to make a _ready() function in the DunMesh script and call create_dungeon() inside it

  • @EmGi_
    @EmGi_ 11 месяцев назад +9

    Insane video. Its great that you not only explained code but showed the logic behind the code with the animations before. This makes it very easy to Understand. Thank you for this great Video!

  • @yvanvan3729
    @yvanvan3729 Год назад +47

    Really awesome tutorial ! Thanks you for making this tutorial, which will undoubtedly help many people in the Godot community.
    Some minor things that could be done differently (Without wishing to be demeaning ! Quick disclaimer : I'm by no means a professional....) :
    6:24 : no need to declare the set function, add ":" at end of the variable line, on next line write "set(value) :" instead of the function, and finally the code.
    13:04 : use "randi_range(min_room_size,max_room_size)" which is more clearer than the modulo one
    19:15 : take advantage of the vector3 operators : var center : Vector3 = Vector3(start_pos) + Vector3(width,0.0,height)/2.0
    33:52 : here, the type can be inferred, so you can omit the type name : var pos_from := Vector2i(h[0].x,h[0].z)
    43:04 : only one simple handle_all function with an extra parameter key could very well have done the job :
    func handle_all(cell:Node3D,dir:String,key:String) :
    match key :
    "" : cell.call("remove_door_"+dir) # for handle_none
    "00" : cell.call("remove_wall_"+dir) ; cell.call("remove_door_"+dir)
    "01" : cell.call("remove_door_"+dir)
    and so on...
    Again, great work ! Nicely explained and well done. New subscriber.

    • @quwatz
      @quwatz  Год назад +15

      Thanks for taking the time to watch it. Super appreciate the feedback. (regarding the handle_all() situation I thought what I did would be more performant since it wouldn't use any conditional statements but in hindsight yeah you're probably right a one time check wouldn't hurt performance, it might have been even better idk :p) again thanks for watching. learned so many things from you comment.

    • @AstroTechGuy
      @AstroTechGuy Год назад +3

      Thanks for the hint with randi_range. Didn't know, that it exists.

    • @an4ximander
      @an4ximander Год назад

      Such a great video indeed! But I cant find anywhere a tutorial that just connects 2 rooms by code though. Lets say they have a door in the middle of the wall and you want to connect them. I dont think a tilemap would be best, if you just want to combine only 3-4 types of room (so I mean, random generated locations of rooms, but the rooms themselves premade in Blender ).

    • @paul_musique
      @paul_musique Год назад

      Hey, i don't know if you are still on this project but could you send the lines of codes that replace the set function (6:24, I don't understand your current instructions)

    • @quwatz
      @quwatz  Год назад

      @@paul_musique I'm not sure what you mean by that. but the script is up on github. are you asking for the 'set_start' function code?

  • @ChainZGER
    @ChainZGER 10 месяцев назад +44

    29:32 "So, assuming you understood everything"
    Bold of you to assume I understood *anything*

    • @christianrink4093
      @christianrink4093 4 месяца назад

      time for you to dive into Datastructures & Algorithms :)

    • @mogo-wc7xw
      @mogo-wc7xw 3 месяца назад

      its mostly understandable until the halfway point, where the code goes completely batshit insane

  • @AirmanCS
    @AirmanCS Год назад +12

    I have been nibbing at this for a good month or two now(nowhere close to where you got, time and struggle learning too), also I was not using the grid system yet.
    This video is so incredibly good for me that I have downloaded it in case your account explodes I will always have it lol. But seriously, this is an amazing achievement for roguelike dungeon games on Godot, thank you so much for your effort and sharing, I know is not easy to reach this result(at least for me was being really hard).
    Also this is so incredibly flexible too! I want to add several floors and I think I can now, will definitively share it once if no one beats me to it (pls some beat me to it xD)
    Now just to create nav meshes based on the grid, spawning systems for loot, mobs, secrets, dynamics, art, sound, tons of work and you got yourself a nice rouge like dungeon game lol!
    Again I was 2 mins in and I subscribed and liked because some people has done it but no video comes close to explaining this well enough as you did, not even mentioning godot 4. You say this could be not "optimal" but im forking this and doing my best to upload any improvements (if any). Really exiting 11/10 content.
    EDIT: Almost forgot the "quick" text popups are hilarious lol

  • @LevetAriel
    @LevetAriel 10 месяцев назад +1

    Wow! Amazing code and excellent explanation! I'm studying it to learn about procedural generation. I'll recommend your channel to my friends, hope you make more videos!

  • @mythology100
    @mythology100 Год назад +23

    Magnificent work here. Perhaps I can convert this for my 2d game in the future.

    • @mijkolsmith
      @mijkolsmith 2 месяца назад

      It's really easy to translate this tutorial to 2d using Vector2i's and a TileMapLayer, I can recommend it!

  • @Syvies
    @Syvies Год назад +4

    Thank you for this amazing tutorial!
    I made some modifications to the way the room are generated to instead use pre-made ones and it works really great

    • @Mop82-h4b
      @Mop82-h4b 11 месяцев назад +6

      can i get some insight on how you did this? (i'm trying to do the same thing and im really curious)

    • @archivoman1649
      @archivoman1649 11 месяцев назад

      @@Mop82-h4b maby set the room to min mx 1 and make the cell be the entaiar costum room?

    • @breakthatbread8435
      @breakthatbread8435 4 месяца назад

      I'd love some insight in how you went about this if you get the chance!

  • @nowherebrain
    @nowherebrain 7 месяцев назад +8

    no need for the disclaimer...no one is perfect and if someone is going to judge you for english being your second language or that you laptop is maybe old or something..who cares..you are providing people a valuable service...(liked)

  • @giampaoloschembri452
    @giampaoloschembri452 Год назад +2

    Searching for a tutorial for this for a long time, thanks!

  • @sleepymushroom9403
    @sleepymushroom9403 Год назад

    Thanks for the tutorial, I've been thinking about doing something similar but most of the tutorials I've watch never really went in depth, thanks for the video.

  • @Kireita
    @Kireita 4 месяца назад

    Good sir, you have an amazing talent explaining things. Thank you!

  • @TNoire52
    @TNoire52 6 месяцев назад

    Incredible video. Absolutely crazy! Thank you for the in depth explanations.

  • @AirmanCS
    @AirmanCS Год назад +4

    Ok I finally mastered the concepts on this video, wanna thank you a lot for this, really gave me that initial push on procedural generation. Now im creating my own Astar algorithm to search in 3D add stairs and whatnot, finally using triangulation on 3 dimensions and such, but got to say thanks to this video, before it I was really stuck... I would like it 100 times if I could but I guess a second comment will do

    • @sleepymushroom9403
      @sleepymushroom9403 Год назад

      Hey man I'm wondering; how did you figure out generation for dungeons upwards and downwards?

    • @AirmanCS
      @AirmanCS Год назад +2

      @@sleepymushroom9403 Well I'm using Astar3D but since Godot doesn't have a 3DAstarGrid method, I just made an array, and dictionary of all points. The key on the dictionary is the position of the points. Then I manually connect them all :P, here you could just connect octagonally or all the points around each point, that will give you the no diagonal method. And the Astar3D method has a "compute distance" and "stimate distance" functions that are overwritable. So I implemented the Manhattan distance there, have to say I had to tweak it a bit and is still not working flawlessly bc the path finding in 3 can connect stuff from the bottom and I want it to always connect on the front but is a matter of a bit more work. I might do a video explaining it all, is pretty simple 🤔(even if it sound messy)

    • @AirmanCS
      @AirmanCS Год назад +2

      ​@sleepymushroom9403 I uploaded a video explaining how I approached the 3D generation if you want to check it out

    • @sleepymushroom9403
      @sleepymushroom9403 Год назад

      @@AirmanCS Thanks man

    • @DarthMaterFPV
      @DarthMaterFPV Год назад +1

      Thank you!@@AirmanCS

  • @generrosity
    @generrosity 10 месяцев назад

    Awesome work, vastly more advanced in Godot than i can use, but love the zoom / outerglow use to target parameters 🤟

  • @AI.Art.
    @AI.Art. 4 месяца назад

    This tutorial is mind-blowing! Thanks for the service 🙏

  • @jeffreystephens2658
    @jeffreystephens2658 Год назад

    I've always wondered how this method works. Thanks for sharing this.

  • @seepsoda
    @seepsoda Год назад +2

    Great video man, I'm currently watching it through on my second monitor just out of curiousity because I love procedural related topics and this is a great system you made

  • @alfredorourke8715
    @alfredorourke8715 7 месяцев назад

    This is the most useful video for learning this I have found thank you. I've been trying to use chat gpt to learn how to do this

  • @meromero6284
    @meromero6284 Год назад

    Thank you so much bro. It took me ages but I managed to learn a lot and found out how to do this in 2D!

  • @belgarathlesorcier8385
    @belgarathlesorcier8385 9 месяцев назад

    I'm not actually interested in dungeon generation but your video is a great resource for procedural generation from the editor !

  • @CaptmagiKono
    @CaptmagiKono Год назад

    Thanks massively for making the tutorial. Honestly still don't understand alot of the long for-loops and how exactly the algorithms used work. But having a working example and code with it probably saved me alot of head-ache trying to figure all of this out otherwise. So yeah, thanks alot!

  • @aranasaurus
    @aranasaurus 11 месяцев назад

    Thank you so much for this! This was an excellent tutorial and I look forward to seeing what else you come up with to teach us!

  • @Connor_Sherlock
    @Connor_Sherlock Год назад

    this is a great tutorial. i couldn't code my way out of a paper bag (rip godot's visual scripting) and this is all making sense to me

  • @mijkolsmith
    @mijkolsmith 2 месяца назад

    Using a room class to save the data instead of two separate arrays works nicely

  • @mortith2463
    @mortith2463 11 месяцев назад

    Holy moly, that's awesome! Thank you!

  • @X0rgIIus
    @X0rgIIus 11 месяцев назад

    Greatest tutorial! Thank you very much!

  • @breakthatbread8435
    @breakthatbread8435 4 месяца назад

    This is the greatest video ever made

    • @quwatz
      @quwatz  4 месяца назад +1

      pretty sure this is a better video:
      ruclips.net/video/a37d1BGLpWo/видео.html

  • @onlineflowerstore
    @onlineflowerstore Год назад +1

    super cool video! please do more Godot Videos

  • @GameDevKnight
    @GameDevKnight Год назад +2

    Also just a follow up I have incorporated a few changes to the code and I'm goig to add generation for specific rooms and items/resources, will definitely email you some results to show you what I've made with your generator

  • @znotchill
    @znotchill 11 месяцев назад

    thank you bro I needed this so much

  • @octa-pie
    @octa-pie Год назад +5

    could you make a tutorial on how to add decorations like windows or tables and/or away to make the path more linear?

  • @dueddel
    @dueddel Год назад

    That "misspelling" of DunGen is smart. 😉

  • @saladfingers69420
    @saladfingers69420 11 месяцев назад +1

    how would i go about changing the 1x1x1 grid map to another size? is it just a matter of changing the grid map size itself, the mesh library size and the actual den cell size? or is there stuff in the code that needs to be changed also?

  • @pascalcasier959
    @pascalcasier959 Год назад +1

    Thank you for sharing !!! new subscriber for sure

  • @PulseTideBeats
    @PulseTideBeats 10 месяцев назад

    Thank you for this!

  • @josmarpinheiro2589
    @josmarpinheiro2589 Год назад +1

    Top vídeo GODOT 😊

  • @JK-pp2xl
    @JK-pp2xl 4 месяца назад

    Need to be able to mark a boss room. And make sure its not the start room, first room, etc. Regardless, a good starting point.

  • @maniksharma9736
    @maniksharma9736 Год назад +3

    Got to subscribe because u provide it for free.

  • @Kenneth_Molotov
    @Kenneth_Molotov 10 месяцев назад

    do you think you can do the same but with like assets that you built ? like in lethal company ?
    you got x numbers of created room and corridors that you can assemble with a random generation

  • @paolinsky_minis
    @paolinsky_minis Год назад

    Great tutorial!

  • @andguy
    @andguy 5 месяцев назад

    What advantage does your method of getting a random width/height have over just randi_range(min_room_size, max_room_size)?

  • @ShiroCh_ID
    @ShiroCh_ID Год назад +1

    i had some advices, maybe gives 2 seconds delay for the text so peeps can pause it easly xD
    possibly 5 seconds since its hard to to that in phones

  • @LadnoGaming
    @LadnoGaming 9 месяцев назад

    Hi, great work!
    Do you know how to make it so that after I generate the dungeon, and all the textures, I can run the scene and observe the textures?
    Currently, after playing the scene, only the coloured boxes are visible, but not the textures. Why does this happen?

  • @RedthrowerGames
    @RedthrowerGames Год назад +1

    this is awesome! is it possible to generate a pregenerated room (sort of like a boss rooms, spawn rooms) for it?

    • @quwatz
      @quwatz  Год назад +1

      hmmmmm. interesting question, for custom sized rooms I'd place them manually before adding the procedurally generated rooms (it has to occupy space in the gridmap, if not you can place the custom made mesh for the boss room in first, place debug nodes to know where the doors are supposed to be, clamp those nodes' positions to integers to better fit the gridmap space and mark them as door tiles, that way the generator can still handle the hallways. and ofcourse you have to fill up the space that the room mesh occupies in the gridmap space so that other rooms won't intersect with it.) , and then draw the hallways between them, of course that's just one way. keep in mind the process of generating the map layout is separate from generating mesh for that layout. in my video I made a simple solution for the mesh part . it's totally up to you how you break this process to fit your needs. for example you can make the layout first, using the room_positions and the room_tiles properties decide which room is which. and then add your own premade rooms in manually. make hallways between your rooms and the rooms generated from before, and then using that information generate mesh for the dungeon.

    • @RedthrowerGames
      @RedthrowerGames Год назад

      @@quwatz thank you, i will try and figure it out.

  • @Kris29919
    @Kris29919 5 месяцев назад

    Why do I use one cube for both the border and the rooms, even though there are 4 of them, as in the tutorial?

  • @less_than_savory
    @less_than_savory Год назад

    thanks for posting this

  • @Darkfatalis1001
    @Darkfatalis1001 Год назад +1

    Hello,
    first of all, very good job! You helped me and a lot of other people with this tutorial!
    But I still got a problem. Whenever I turn the DunMesh on, it will generate perfectly. Now, if I swap the 3D-perspective to another scene and back to the world (or just start the game), every block is surrounded by doors (not walls though). Any suggestions as to how to fix it?

    • @WolfxE1998
      @WolfxE1998 11 месяцев назад

      I have the same issue

  • @seaotterman3953
    @seaotterman3953 Год назад

    This is super helpful. Is there some way I could make the hallways be wider than one block?

  • @Someone-tc4wu
    @Someone-tc4wu Год назад

    Awesome work

  • @snazzymacaroni7071
    @snazzymacaroni7071 Год назад

    how would you go about making a start room and an end room? brilliant video tho

  • @yc5882
    @yc5882 7 месяцев назад

    Hey, I have a quick question: I got it working after following the tutorial, however when I ho to play the level, none of the walls or doors are removed. It looks fine in the editor, it's just when I run the game

  • @will7466
    @will7466 Год назад +3

    But can you use a NavigationRegion?

    • @jonathanwilliams9593
      @jonathanwilliams9593 Год назад

      I've been trying to figure this out as well.

    • @will7466
      @will7466 Год назад

      @@jonathanwilliams9593 3D is possible because it can bake but I don't see a way to integrate the NavigationRegion with the TileMap I feel like this is a huge oversight would be awesome if there was a way to make it happen.

  • @hissy7042
    @hissy7042 Год назад +1

    Hey bro how would I make this dungeon have collisions so i can put a player in it? and how could I make the dunmesh automatically load in when i open a project instead of having to start it.

    • @quwatz
      @quwatz  Год назад +2

      You can add the collisions as children of the wall objects on the cell scene, like I did ( at 36:46 ). and naturally the floor and the ceiling will always have collisions .
      this way, you can also bake a navmesh based on the results after the dungeon is created.

  • @7katona7
    @7katona7 8 месяцев назад

    gigabased video. thanks

  • @jurgevaIIejos
    @jurgevaIIejos Год назад +2

    question: where are the models of the walls from???

    • @quwatz
      @quwatz  Год назад +1

      I made them myself in blender, they come with the project files in the github repo .
      of course you can make your own models too if you wish to

    • @jurgevaIIejos
      @jurgevaIIejos Год назад +1

      are they inside the imports folder? maybe its because of my ignorance but there i just seem to find textures and code i dont understand. How am i supposed to get the models to put them on my own project? sorry to bother you@@quwatz

    • @quwatz
      @quwatz  Год назад +1

      ​@@jurgevaIIejos yup I just downloaded it from the repo, both the dun_cell scene and the .glb model are included in the files and work fine out of the box.
      the dun_cell files (both the scene and the mesh) are in the import folder. the main scene in the tutorial is the dun_gen.tscn .
      try opening that first . hope this helps. it could be that an antivirus software is deleting the files for whatever reason but you should be able to find all of the files mentioned above in the project files

    • @jurgevaIIejos
      @jurgevaIIejos Год назад +1

      it worked!! thank you so much 4 taking your time to solve my questions
      @@quwatz

  • @Nicholas2703
    @Nicholas2703 Год назад

    Great tutorial, is there an easy way to keep the dungeon mesh children when running the scene?

  • @Alshim
    @Alshim 7 месяцев назад

    Do you have a 2d tuts for this?

  • @aliimwan
    @aliimwan Год назад

    Thank you for the tutorial. Do you have a tip how i can connect the hallway doors without using AStarGrid2D, because it doesnt exist in Godot 3.5.2.

    • @quwatz
      @quwatz  Год назад +2

      Hey. Pretty sure 3.x has the Astar and Astar2D classes still which pretty much work the same way. the only difference is that you have to set each cell manually using add_point(), set_point_disabled(),and ...
      And that you have to do some extra stuff to account for diagonal movement since they're not written to work with a grid system only.
      I recommend you read the docs on it and take a look at the Astar pathfinding demo on GDQuest

  • @hoot_works_entertainment
    @hoot_works_entertainment Год назад

    Greetings! I'm a game developer and I've been following your tutorials closely. They've been incredibly helpful in my journey. I just watched your tutorial on creating Procedural Dungeons in Godot 4 and I have a question.
    In your tutorial, you've shown how to create rooms and hallways for a 2D dungeon. I'm trying to adapt your script to a 3D environment. I'm struggling with creating hallways in 3D. Could you provide some guidance on how to modify the script to achieve this? Specifically, I'm looking at the create_hallway function and wondering how to adapt it for 3D

  • @just.chillin.killin6532
    @just.chillin.killin6532 Год назад

    Amazing video. Works perfectly but i used a different set of tiles and they arent generating properly. Any tips on why?

    • @quwatz
      @quwatz  Год назад

      Hey, glad you liked the video. I'm not sure what you mean by 'not generating properly'.do the cells not appear ? it most probably has to do with the code. maybe you're not using the right indexes

  • @TheSubliminalBeautyLab-hv7ig
    @TheSubliminalBeautyLab-hv7ig 7 месяцев назад

    Bro i added my fps character inside the dungeon but my character is stuck in only one block where it can't move anywhere all the 4 sides are blocked. Can you help with this how to fix.

    • @plunyo
      @plunyo 2 месяца назад

      same here, did u find out how to fix?

  • @akshaypalkar7097
    @akshaypalkar7097 6 месяцев назад

    Which software did u use for animations?

    • @quwatz
      @quwatz  6 месяцев назад

      blender

  • @jwill524GameDev
    @jwill524GameDev Год назад

    Anyone know why the walls come back when I actually play the scene?

  • @3bdullah_55
    @3bdullah_55 10 месяцев назад

    why there is an issue with the walls shows when I run the project?
    it shows a lot of unorganized walls that suddenly appears
    Note: I had even tried your project but is shows the same issue

  • @mrdixioner
    @mrdixioner Год назад

    Thanks a lot!

  • @matthewmazerov5426
    @matthewmazerov5426 Год назад

    I have one issue so far. Any camera i have shows all the walls even the ones that are disabled

    • @plunyo
      @plunyo 2 месяца назад

      same did you find out hows to fix?

  • @GameDevKnight
    @GameDevKnight Год назад

    could you maybe tell me how I can use this ingame now and not just as a tool, I worked through the tutorial and want this all to run on start, currently when I press play the Dunmesh dissapears

    • @quwatz
      @quwatz  Год назад +3

      The tool keyword is just so you don't have to run the game each time you want to see the changes you make to the script. you can bind the functions to create both the layout and the mesh to a timer on _ready and it should work like it does in the editor. to build upon it is a completely different story and entirely up to you. example : you can randomly choose a point form the room_positions variable and decide that's where the player spawns. better yet since you have the hallways as a graph you can algorithmically choose a straight path for the player to progress through. in short, everything should still work the same in game as in the editor. only difference being that you have to manually call the appropriate functions to create the dungeon (first the layout then the mesh)
      and apart from that, you have the data you need to work with to create anything you want (e.g. decorations, enemies , navigation meshes).
      with that being said, the reason you're not seeing the mesh in-game is because you also have to set the added child's owner to be the currently open scene.
      try adding a
      dun_cell.owner = self.owner
      before adding it as a child at 39:20
      in hindsight I probably should have added that in the tutorial I don't know why I didn't, that's on me

  • @NulwraithSecret
    @NulwraithSecret Год назад

    Hi there! When I run the project, only the blocks from the grid map are visible and none of the actual dungeon parts are. Is there a part in the code that explains how to have the dungeon be visible or is there a separate way to get that to happen? I'm fairly new to using godot

    • @quwatz
      @quwatz  Год назад +2

      hello. this is because I'm dumb and forgot to mention in the tutorial that if you want the dungeon that's generated in the scene to translate over the game you also have to set each cell's owner after adding it to the scene.
      this can easily be done by adding the line :
      dun_cell.set_owner(owner)
      after add_child(dun_cell) at 39:21
      .
      the reason I didn't think about mentioning this in the tutorial is because I initially intended for these functionalities to be called and used in-game only (generating both the layout and the mesh in-game) and not as an actual level building tool. The tool keyword , like I said, was only added so we could debug the project without needing to run it every time we made a change.

    • @NulwraithSecret
      @NulwraithSecret 11 месяцев назад

      Thank you very much!

  • @andguy
    @andguy 5 месяцев назад

    "DunGen" - ha! Nice!

  • @__Rizzler__
    @__Rizzler__ Год назад

    bro cooks well

  • @msec7188
    @msec7188 Год назад

    What themes are you using?

    • @quwatz
      @quwatz  Год назад +1

      the default theme but desaturated and darkened with a slightly reduced contrast

  • @gamedevgerry
    @gamedevgerry Год назад

    thanks!

  • @MrMikhead
    @MrMikhead Год назад

    awesome work, but that color you use for your comments is awful :P

  • @karial
    @karial 5 месяцев назад

    "I could explain what each edge is, and how it works... but I can't be f'd... sorry". 😅😅😅😅

  • @Digitalgems9000
    @Digitalgems9000 Год назад

    that's some ridiculous premature optimization at the end there, lmao

    • @quwatz
      @quwatz  Год назад +4

      As an AI language model, I don't have feelings, so I can't really find anything ridiculous or humorous. However, as a language model, I can provide some insights into why premature optimization is not always a good idea.
      Premature optimization occurs when developers focus on optimizing code before it's necessary to do so. This can lead to wasted time and resources that could have been spent on more important tasks, such as writing high-quality code, identifying potential issues, and testing.
      One of the main issues with premature optimization is that it can distract developers from solving real problems. Instead of focusing on building robust and scalable software, they may end up spending too much time tweaking minor details that might not even make a significant difference in performance.
      Moreover, premature optimization can also lead to overly complex code and make it difficult for other developers to understand. Code complexity can be a major obstacle when it comes to maintaining software over time, especially if the original developers leave the project.
      Another issue with premature optimization is that it can introduce new bugs and create unexpected behavior. When developers optimize code without fully understanding its implications, they may inadvertently introduce new issues that are difficult to identify and resolve.
      Furthermore, premature optimization can also hinder innovation and creativity. If developers focus too much on optimizing existing code, they may miss out on opportunities to explore new ideas or approaches that could ultimately lead to better solutions.
      In conclusion, while optimization is an essential part of software development, it's crucial to balance it with other priorities, such as functionality, maintainability, and ease of use. Premature optimization can cause more harm than good, so it's important to avoid it whenever possible. Ultimately, developers should strive to write high-quality code and prioritize problem-solving over minor optimizations.

    • @Digitalgems9000
      @Digitalgems9000 Год назад +1

      @@quwatz yes you should listen to the last paragraph. you just spent a bunch of time over a fcking if and match statement. if you were worried about performance write a c++ plugin using gdnative or something, not fiddle with gds lol. and that's after you ran into performance issues, not before

    • @quwatz
      @quwatz  Год назад

      @@Digitalgems9000 yeah I understand what you're saying. but I figured doing it in gdscript does a good enough job. ideally things like this run only once in the beginning of the game. plus like I said using C# is also an alternative without the need to work with gd extension since I really couldn't wrap my head around that. but even if I could I was NOT about to extend the video for another 20 minute just to explain how it's done. also yeah I know what I chose to do instead of simply using a match block was dumb.

    • @Digitalgems9000
      @Digitalgems9000 Год назад

      @@quwatz gdscript is becoming a hot mess anyways with all their new syntax and keywords. it goes against the exact opposite of what reduz originally intended the language to be used for, so you're not to blame. back in the day, we'd say hey, write your code with c++ if you want it to be faster. now, they want to turn gds into some god level programming language with static typing, lambdas, ridiculous warning system, etc. fact of the matter is, even good old gds on 2.1 is just fine for 99% of the needs of game devs...
      it's a function of time and will get worse as more crap gets added in. they have to because they need to put on an illusion of feature creep, so they can continue to get donations, sadly.

    • @shinunotenshi
      @shinunotenshi 3 месяца назад

      i dont like people like you. Always shitting on others and their progress. Just mind your own business and dont use it then. I think it rocks.

  • @Lycanthronaut
    @Lycanthronaut 2 месяца назад

    If statements are usually faster than nesting for loops when it comes to choosing which evil is " greater "

  • @Lycanthronaut
    @Lycanthronaut 2 месяца назад

    Which parts of the godot docs did you reference?