Why You Should Use Loops In PCG | Building Series Part 7

Поділитися
Вставка
  • Опубліковано 5 січ 2025

КОМЕНТАРІ • 23

  • @Procedural_Minds
    @Procedural_Minds  Рік тому +2

    Merry Christmas everyone! :)
    What do you guys think of the editing improvements?

  • @Kuraikari
    @Kuraikari Рік тому

    Good stuff. I like it.
    I finally remembered how to get the sizes from the static mesh -> bounding box -> max - min -> if you make an array of meshes and use that as an input, that should actually allow it to have the height, width and length automatically. You then can use your original wall size variables to instead be used as an offset, by adding them to the calculated sizes.

    • @Procedural_Minds
      @Procedural_Minds  Рік тому

      Yep, you got it pretty much spot on. The only thing that's stopping me from implementing it is I want to figure out a good system for it considering every single piece can be of a different size. So there has to be a "main" piece everything uses as a base. But yeah, you got it pretty much. :)

    • @Kuraikari
      @Kuraikari Рік тому

      @@Procedural_Mindsone way could be an array of structs, containing a key-value-pair (map) variable where each key is corresponding to the fitting static mesh.
      The disadvantage is that the map would need to have some initial entries, or at least you would have to change the logic flow a bit to not spawn static meshes when the key doesn't exist.
      You would also need to think about what kind of key it would be.
      An enum? A name / string? A number? Depending on what it should be, there might be limitations or issues that might reduce the effectiveness of the system.
      (Sorry if I don't seem to make any sense, where I live it's 4am andI was thw whole night up watching a show, so I'm pretty tired 😅)

  • @WsEKond
    @WsEKond Рік тому +1

    Really cool tutorial! Nice improvements! and Merry christmas!!!🎉🎉🎉

  • @danribeiro138
    @danribeiro138 11 місяців тому

    Hey man! Thanks for the tutorial, great series! You probably know this already but in order to use the functions inside the loop overrides you just need to mark const inside the Advanced settings on the function details.
    This is due to the compiler loop optimizations, marking it as const guarantees that the state won't change so it can safely optimize the loop.

    • @Procedural_Minds
      @Procedural_Minds  11 місяців тому +1

      I didn't know about this. Thanks for the information! Is there any reason to ever not check it?

    • @danribeiro138
      @danribeiro138 11 місяців тому

      Not to my knowledge. Pure functions are supposed to not ever change state so in my mind this should have been automatically turned on by the engine.
      But in C++ you can declare pure functions that are not const, so I guess it's a hold-over. @@Procedural_Minds

    • @Procedural_Minds
      @Procedural_Minds  11 місяців тому

      @@danribeiro138 Oh pure functions! I know those, I thought the const functions were something different. Good to know about all this. Thanks for sharing! :)

    • @danribeiro138
      @danribeiro138 11 місяців тому

      @@Procedural_Minds yeah, I didn't test, but I think you could get by with a const, non-pure function, but at that point you could just make it pure. Been checking the source code, the context is copied to a thread-safe context and the loop is handled by different threads, much faster in this case when working with point data.
      Anyway, awesome tutorial series, learned a lot! Latest video was great, can't wait for the next! Keep up the awesome job

  • @dragonstrike4790
    @dragonstrike4790 10 місяців тому

    The reason you can't assign a value to a non-array variable in the loops functions is because the functions are marked const. So you can add/remove items from an array but you wouldn't be able to assign a new array to the variable inside the const function. Same thing with the Find Adjacent Point function. It's not marked as const and you can't call a non-const function from a const function. Since that particular function doesn't change anything, you can mark it as const and call it from the point loop body function.

  • @loiccabrol1037
    @loiccabrol1037 9 місяців тому

    Hello and thanks a lot for this awesome tutorial series !
    I think you forgot to plug in the Pos/Neg booleans in the the point loop function body.
    For some reason I can't get that point loop function to work...
    I watched that part like 10 times and I always end up with only one point selected by the variable and set @0.5 when I debug the two point function in PCG Graph.
    If I force the branch @true in the point loop function, all the points on the floor are at density 1 but as soon as I try to set the density to 1 to a single point in the point loop, it doesn't work for me.

    • @loiccabrol1037
      @loiccabrol1037 9 місяців тому

      OK, if I test PCG Selected Points

    • @Procedural_Minds
      @Procedural_Minds  9 місяців тому

      Double check that you have everything plugged in. Someone else had a similar problem and they just didn't hook up the index into a get node in one of the areas.

  • @metinbatuhanozucan5358
    @metinbatuhanozucan5358 6 місяців тому

    This series is just awesome. Currently ı can just support you by likes&sub but soon I will be your patreon supporter I hope. Keep going to creating and developing you are great

    • @Procedural_Minds
      @Procedural_Minds  6 місяців тому

      If you're watching and enjoying then you're already doing a lot. I appreciate it! ♥

  • @ATG-j2r
    @ATG-j2r Рік тому

    those Point Loops are driving me crazy !?!? will not cooperate, sure i have another goal but so many things not working inside these loops

    • @Procedural_Minds
      @Procedural_Minds  Рік тому

      What is the problem you're having? They are a bit fiddly.

    • @ATG-j2r
      @ATG-j2r Рік тому

      Tried to make just a simple point filter that determines the output number of points with density of 0 based on a parameter, Would be nice to have the option to get the Index From BreakPCGpoint. Could not use like if "Array Index" is less than within these loops, also flow control like DoN not seam to work within these loops. Ended up doing everything not using loops and that seems to work, and the points are not flowing back to the previous node for me :)
      @@Procedural_Minds

    • @ATG-j2r
      @ATG-j2r Рік тому

      watching your videos out of order, haha just saw your Custom Door Count video, I'm guessing you did not have to remake that one right? @@Procedural_Minds

    • @Procedural_Minds
      @Procedural_Minds  Рік тому +1

      @@ATG-j2r Yeah I didn't remake it, but I also don't think I actually looked at it close up to make sure it works correctly.