Individual Foliage Logic in UE5 [Harvesting, Damage, Particles]

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

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

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

    This is great, waiting to discover some performance issue since every newer tutorial is way overcomplicating this. Just got all my foliage harvestable in a couple hours and my only real roadblock was a collision error with some of my meshes. Spent the last 2 days trying to get more complicated solutions working and this is just elegant and easy. Now I just need to figure out respawning and/or planting and adding to the foliage instance.

  • @AlexClarkeGame
    @AlexClarkeGame 2 года назад +9

    Btw, with C++ you can get the custom data value, we've been using it to also store the health rather than having a separate array for that
    (Same outcome obviously so doesn't matter too much!)

    • @mmertduman
      @mmertduman 2 года назад +3

      If the function is available in C++, one can expose that to BP using a Blueprint Function Library and just calling the required functions within wrapper functions. For people who don't want to dive into C++ its a very handy trick. I use it all the time for functions available in C++ but not in BP, like regex, or hit result under cursor (wasn't available prior to 4.2 something). I just checked and FoliageInstancedStaticMeshComponents can also call functions from a BFL.

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

      @@mmertduman Hey! this is a while ago now, and I might be stretching here a bit. I'm in unreal 5 and trying to expose this function. for the life of me, I cant find the function to call in c++. do you have any pointers? I'd just like to read the custom data in bp.

  • @LFPAnimations
    @LFPAnimations 2 года назад +1

    I have been binging your videos lately. I hit a lot of roadblocks recently on a game project and your easy to follow explanations have helped me a lot. Specifically this one and the water shaders videos. Keep up the great work man.

  • @kolerdev
    @kolerdev 2 года назад +19

    For the people who found that the per-instance custom data doesn't work in standalone mode or packaged project, you might need to call BuildTreeIfOutdated(true, false) in the c++ class after you set the custom data.

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

      For anyone who is a c++ noob like me, I spent 24 hours digging into stuff so you don't have to. Here are the steps to make sure this works in a packaged project in 4.27.2:
      1. In your project go to File > New C++ Class
      2. Click the checkbox that says Show All Classes
      3. Search FoliageInstancedStaticMeshComponent and select Next
      4. Name your new class whatever you want, make sure Public is selected, then create class
      5. Wait for Visual Studio to compile and open your newly created files
      6. In the header file (YourClassWhateverName.h), add the word "Blueprintable" inside the UCLASS function
      7. Below GENERATED_BODY() add the following code:
      public:
      UFUNCTION(BlueprintCallable)
      void RefreshCustomDataFoliage() {BuildTreeIfOutdated(true,false);}
      8. Save and compile in your project
      9. Now you can go to your original blueprint class (if you've already made any of this functionality), go to class settings and change the parent to whatever you named your class when you made your new C++ files. You should have access to the new function RefreshCustomDataFoliage which you can put after changing your custom data from in the video.
      10. Go to the foliage editor in your level and change the Component Class to nothing then back to whatever you named it for this video (this should refresh your foliage after re-parenting, otherwise my already placed interactive foliage had disappeared)
      11. Save everything and close your project, open your project again and build a new packaged game and voila!
      *Note: Closing project and re-opening was necessary for me otherwise I got a build error when launching my packaged game
      Hope this saves anyone some headaches.

  • @SamPandaSam
    @SamPandaSam 3 года назад +2

    Another great video, thanks! Just implemented this in my game to get resources in the world to react more when units are gathering them.

    • @PrismaticaDev
      @PrismaticaDev  3 года назад +1

      Yes!! Really awesome to hear. Would be the perfect technique for an RTS game or anything that requires a tonne of interactable objects

  • @arrowsdev
    @arrowsdev 3 года назад +3

    as always you give the juice of many amazing stuff that we couldnt figure out or even find YT vids to help with , thanks for sharing

  • @bitesizedtech8095
    @bitesizedtech8095 2 года назад +2

    Thanks a lot for sharing this Charlie! This is gonna be super useful to me and a lot of other people.

  • @Fokkusu
    @Fokkusu 3 года назад +5

    what is this possible? :ooooooooo, this is really smart! I'm so happy you showed us this, this is a game changer for performance of foliage, I'm looking with my coworkers to make a variant of this technique to create all grabable items in our VR game :). Awesome vid as always Charlie ♥

    • @Fokkusu
      @Fokkusu 3 года назад +1

      We can for sure combine this with a constructor to create all items in a data oriented programming method which would be absolute poggers as we would only need to create the behavior component variants, a data table and the constructor, and in begin play it would generate all the items correctly with their respective behaviors :)

    • @PrismaticaDev
      @PrismaticaDev  3 года назад +1

      @@Fokkusu Yes! Haha glad you're already finding some use from the video :) My mind was blown when I found out we could change the foliage class haha

  • @0805slawek
    @0805slawek 3 года назад +1

    I very grateful indian guys for every tutorials but be honest my ears bleeding, finally found this dude quick usefull tips and trick thanks

    • @PrismaticaDev
      @PrismaticaDev  3 года назад

      Haha I’m glad you find the channel useful :)

  • @based1195
    @based1195 3 года назад +1

    Arcadian Rift and Prismatica in the same day? Hell yeah!
    Seriously though thanks for the devlog, it was awesome.

    • @PrismaticaDev
      @PrismaticaDev  3 года назад

      Glad you liked it :) And I hope you learned something!

  • @alexandredepail1154
    @alexandredepail1154 3 года назад +3

    Amazing video, I learned a lot! Thanks for all your great work and keep it up!

    • @PrismaticaDev
      @PrismaticaDev  3 года назад +1

      Thank you for watching! It's awesome to see people learning stuff from my videos :)

  • @BornStellar-yp5st
    @BornStellar-yp5st 2 года назад

    My brushes don't jiggle jiggle, they fold. I like the way yours wiggle wiggles, for sure.

  • @UV_Game_developer
    @UV_Game_developer 7 месяцев назад +2

    i try to find the way for changing the material of foliage at runtime literally take week and now finally at video with different title i get the solution thank you very much
    i am surprise that it was just one node setup

  • @rosbly
    @rosbly 3 года назад

    Man these videos are amazing! You explain really well, you made me want to create my own game, thank you!

  • @aa-rh1lp
    @aa-rh1lp 3 года назад +2

    Your insight is always helpful. I've been sharing your vids with all of my classmates because your solutions tend to be pretty elegant to some of these design challenges.
    I'm currently working on a game where some of the things I learned here will really help me bring the team's concepts to life (without killing performance). Is there a place where I can learn more about you and your work? I'd love to work with exactly what you do hahahahah

    • @PrismaticaDev
      @PrismaticaDev  3 года назад +1

      Thank you!! Really glad to hear that you and the classmates are loving the videos :) This RUclips channel documents everything I've ever done, as I'm pretty new to Unreal/Gamedev (about 14 months now) so I don't actually have any completed projects to show off yet haha

  • @NRodriges
    @NRodriges 3 года назад +2

    Great video! Thanks for useful information 😁

  • @bobcharlotte8724
    @bobcharlotte8724 2 года назад +1

    An asset named "YeahThisWillWork"... i love it lol

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

    How do I get the take damage event in the Foliage Blueprint?

  • @AlFredo-sx2yy
    @AlFredo-sx2yy 3 года назад +3

    "YASQUEEN"
    "YASQUEEN_MapleBush"
    "YeahThisWillWork"

    • @PrismaticaDev
      @PrismaticaDev  3 года назад +1

      Hahahah you can tell I have great naming conventions :P

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

    Where did Event Take Damage come from?

  • @GorkaGames
    @GorkaGames 2 года назад +1

    Great tutorial, but how did you get the "Event Any Damage from Damageable" in the Foliage Interaction Mesh Component??

    • @GorkaGames
      @GorkaGames 2 года назад +1

      ok solved it! But now how can I destroy that specific tree that I hit?

    • @TehKyros
      @TehKyros 2 года назад

      @@GorkaGames How did you solve this?

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

      @@GorkaGames How did you get it to send the event any "Event Any Damage from Damageable" in the Foliage Interaction Mesh Component? I am stuck on the same part.

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

      How did you solve this?

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

      Hi, could you please explain how you solved this problem? i can see a lot of people here asking for your help. I cant find Event Any Damage either

  • @Alex-un1th
    @Alex-un1th Год назад +1

    Fantastic, its working, thank you!
    The only problem is that i dont understand why is it working? We made custom parameter for a *material*, but we set it for *mesh instance*. Why did this parameter changing for material applied to this mesh instance?

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

      Good question! So, each primitive in the engine can hold on to some simple data, even if it's in an instance/batch (location, rotation, etc) which can also be accessed in the shader. Custom data are just arbitrary bits of data that you can set yourself and can also be accessed in the material. So that's why we can have the exact same material on all the foliage thingos, but change a parameter on the mesh itself and get the desired effect.

  • @Ruumablood
    @Ruumablood 3 года назад +3

    This looks really sweet but having a hard time following along for a say basic setup that we could customize later... Any way that would be cool to make some time basic system from scratch? thanks guy!

    • @PrismaticaDev
      @PrismaticaDev  3 года назад

      Hey Mystory! Unfortunately I don't really have much free time to put together planned tutorials - all of my videos are improvised on the spot and more aimed towards intermediate users. Hopefully you'll be able to come back at some point and give it another go! :)

  • @jvcnb_off
    @jvcnb_off 2 года назад +2

    I'm not understanding the connection between the foliage instanced static mesh component, and the event take damage damage from damageable. I have a health system on my character, but I can't call it in the FISMC. I also tried making an actor component but can't add a component like I can on a player character blueprint. Any point in the right direction would be appreciated

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

      Google- interfaces unreal, You use on component begin overlap on your player bp, You add the interface to the bush, they under the on overlap you get child components of the type the bush is check to see if it has the correct interface and then call the interface function on it.

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

    Hey Charlie this is an awesome video! I manage to get it working and the only thing is that Custom Data some how doesn't work with PCG graphs in UE5. I was wondering if any other solution can replace the custom data . It only works with foliage tool.

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

      Ok I found a fix if somebody is wondering. In the new created foliage class, call the node Set Num Custom data floats from Event Begin Play and enter 2 in the field. Or May be it's better to be called on the EventDamage... I dunno?!?!

  • @a.l.murkar6425
    @a.l.murkar6425 3 года назад

    Hey there :) Been really enjoying these videos, but keep hearing you mention the steams but no idea where to find them! Where do you do your streams?

  • @hubertnguyenVP
    @hubertnguyenVP 3 года назад

    Thanks man! You save my day!

  • @DragonplayerDev
    @DragonplayerDev 3 года назад +1

    This is amazing

  • @zy-blade
    @zy-blade 2 года назад

    Good video =).
    I'm wondering if this can work with the grass tool, which the shaders use to procedural spawn grass tiles. There is a gassmap, I'm just not sure if it's accessible.
    An generally, what if I'm streaming landscape tiles. I still need to test, once the old tile is unloaded, if the new ID's will start at zero again? Some sort of tile/index management system would be necessary then.

  • @irtehbom
    @irtehbom 3 года назад

    Would this work with multiplayer?

  • @BrianDeric
    @BrianDeric 3 года назад +1

    Nice RuneScape song

    • @PrismaticaDev
      @PrismaticaDev  3 года назад +1

      Yeeeeeeee OSRS soundtrack is the best soundtrack

  • @777Darker777
    @777Darker777 2 года назад

    Hey, this is really great! Is it possible to use with automatic grass?

  • @mythran1162
    @mythran1162 3 года назад +1

    Could you share the musics info? Ty!

    • @PrismaticaDev
      @PrismaticaDev  3 года назад +1

      It's the OldSchool RuneScape soundtrack :)

  • @かろおう
    @かろおう 2 года назад

    My foliages can't use Set Custum Data Value node, they even can't tigger break point in c++

  • @jd-foo
    @jd-foo Год назад

    Hey Charlie, have you figured out how to enable physics in a single foliage instance?

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

    Could this work for grass instanced on the landscape material, if so how?

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

      Unfortunately not, since I think the Landscape Grass is GPU-spawned procedurally and never really exists on the CPU. It also can't have collision, which would make it kinda useless as well. For interacting with grass you'll want to take a Render Target approach - you can check out the video about my new plugin as an example

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

      @@PrismaticaDev Okay Thanks :0

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

      @@PrismaticaDev distance fields could be an alternative.

  • @azizkurtariciniz
    @azizkurtariciniz 3 года назад +1

    Amazing tutorial, thank you! Is it possible to disable collision of individual foliage

    • @PrismaticaDev
      @PrismaticaDev  3 года назад +1

      Oooh great question... I'm not 100% sure! I think the easiest way would be to have 2 versions in the Foliage editor, one with collision and 1 without, but I'm not sure about collision for just 1 instance index

    • @azizkurtariciniz
      @azizkurtariciniz 3 года назад +1

      @@PrismaticaDev Thanks for taking your time and answering!

    • @PrismaticaDev
      @PrismaticaDev  3 года назад

      @@azizkurtariciniz No worries at all! I always try to respond to every comment :)

  • @johnmannp
    @johnmannp 3 года назад +2

    So cooool

  • @TheBugB
    @TheBugB 3 года назад +1

    Interesting 🧐

  • @literallyjeff
    @literallyjeff 2 года назад

    Great info!!

  • @томдубовый
    @томдубовый 2 года назад

    бетта версия есть , где в это можно поиграть ?

  • @frankgoesdownstairs
    @frankgoesdownstairs 3 года назад

    My third eye? I use that to poop with... you didn't make me poop

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

    How are you interacting with the individual foliage with that damage event. It seems like you are using an interface but whne I send a interface messege nothing happens. Is there a part I am missing, is there collision settings I dont know of?

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

      Heyo Bob, make sure that "multi-body overlap" is enabled in the foliage class and then when you get the Hit event, the index of the instance will be in there

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

      @@PrismaticaDev Thanks for the reply (lot of youtubers dont do that)! I guess thats why my sphere/line traces didnt work. I ended up figuring out a way to do it with collision overlap events. I was able to come up with some really cool dynamic effects with it. I am sure with more time there is even more potential. already have some more ideas lined up to try.

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

      @@bobboberton349 I'm curious how you obtained the position of individual foliage using the overlap event, my Impact Point is always 0,0,0 and my foliage local position is always 12800,12800,12800

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

      @@PrismaticaDev Ive been spending alot of time now trying to get the hit logic from the damage event to work but i just cant seem to get it working with the foliage specifically...
      Its not giving me any specific foliage information when printing, would be awesome to see the logic in that part specifically.

  • @_____J______
    @_____J______ 3 года назад +1

    I've fallen, and I can't get up!

    • @PrismaticaDev
      @PrismaticaDev  3 года назад

      Hahaha I'm tempted to leave that button in the game :P

  • @CupCakeUnleashed
    @CupCakeUnleashed 3 года назад +1

    Please let me pick berries.

    • @PrismaticaDev
      @PrismaticaDev  3 года назад

      Would you prefer blueberries or raspberries??

  • @ATomCzech
    @ATomCzech 2 года назад

    Great tutorial, just too loud music :-( It would be such much better without that.

  • @notfabiantapia8942
    @notfabiantapia8942 3 года назад +1

    Hi

  • @CosmicComputer
    @CosmicComputer 3 года назад +1

    boing boing