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

  Рет қаралды 26,218

PrismaticaDev

PrismaticaDev

Күн бұрын

Hello friends! A few days ago on stream we experimented with adding logic to our Foliage instances - this is pretty crazy because it means we can have per-instance index material changes keeping the foliage instances the entire time, as well as having individual "stats" for each piece of foliage. This can be useful for interactive foliage, breakable objects like crates and pots, trees that drop fruits/leaves, and much much more!
Apologies for the frame drops during the video - I was queueing up for New World in the background.

Пікірлер: 95
@jiratrello
@jiratrello 16 күн бұрын
fascinating! i achieved a similar thing by using an MPC with vectors of player position, movement, velocity etc and applying it across all my instanced foliage materials. although it does work the limitation is that you need to store bespoke MPC values for each actor you want to listen to. This video seems like a more elegant solution :)
@PrismaticaDev
@PrismaticaDev 15 күн бұрын
That's the most common way in most player-character-oriented games. The only downside, as you mentioned, is that you have a fixed number of "slots" for the number of characters that you want to interact. If you're interested in another approach, check out my Prismatiscape Plugin videos :)
@jiratrello
@jiratrello 15 күн бұрын
@@PrismaticaDev 🫡 already have ! i think its great
@arrowsdev
@arrowsdev 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
@PrismaticaDev
@PrismaticaDev 3 жыл бұрын
Very happy to hear it :)
@Munion9000
@Munion9000 Жыл бұрын
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.
@LFPAnimations
@LFPAnimations 2 жыл бұрын
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.
@bitesizedtech8095
@bitesizedtech8095 3 жыл бұрын
Thanks a lot for sharing this Charlie! This is gonna be super useful to me and a lot of other people.
@kolerdev
@kolerdev 2 жыл бұрын
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 Жыл бұрын
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.
@Fokkusu
@Fokkusu 3 жыл бұрын
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 жыл бұрын
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 жыл бұрын
@@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
@SamPandaSam
@SamPandaSam 3 жыл бұрын
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 жыл бұрын
Yes!! Really awesome to hear. Would be the perfect technique for an RTS game or anything that requires a tonne of interactable objects
@AlexClarkeGame
@AlexClarkeGame 3 жыл бұрын
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 жыл бұрын
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 Жыл бұрын
@@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.
@alexandredepail1154
@alexandredepail1154 3 жыл бұрын
Amazing video, I learned a lot! Thanks for all your great work and keep it up!
@PrismaticaDev
@PrismaticaDev 3 жыл бұрын
Thank you for watching! It's awesome to see people learning stuff from my videos :)
@based1195
@based1195 3 жыл бұрын
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!
@0805slawek
@0805slawek 3 жыл бұрын
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 :)
@rosbly
@rosbly 3 жыл бұрын
Man these videos are amazing! You explain really well, you made me want to create my own game, thank you!
@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 8 ай бұрын
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
@aa-rh1lp
@aa-rh1lp 3 жыл бұрын
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 жыл бұрын
Thank you!! Really glad to hear that you and the classmates are loving the videos :) This KZbin 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 жыл бұрын
Great video! Thanks for useful information 😁
@PrismaticaDev
@PrismaticaDev 3 жыл бұрын
Glad you liked it :)
@GorkaGames
@GorkaGames 2 жыл бұрын
Great tutorial, but how did you get the "Event Any Damage from Damageable" in the Foliage Interaction Mesh Component??
@GorkaGames
@GorkaGames 2 жыл бұрын
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 2 жыл бұрын
@@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
@bobcharlotte8724
@bobcharlotte8724 2 жыл бұрын
An asset named "YeahThisWillWork"... i love it lol
@rebel5345
@rebel5345 Жыл бұрын
How do I get the take damage event in the Foliage Blueprint?
@jvcnb_off
@jvcnb_off 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 9 ай бұрын
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 9 ай бұрын
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?!?!
@birdunit1
@birdunit1 23 күн бұрын
@@alecek Amazing this worked for me!!! thank you
@Alex-un1th
@Alex-un1th Жыл бұрын
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.
@AlFredo-sx2yy
@AlFredo-sx2yy 3 жыл бұрын
"YASQUEEN" "YASQUEEN_MapleBush" "YeahThisWillWork"
@PrismaticaDev
@PrismaticaDev 3 жыл бұрын
Hahahah you can tell I have great naming conventions :P
@hubertnguyenVP
@hubertnguyenVP 3 жыл бұрын
Thanks man! You save my day!
@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.
@Jimmy_Fallon_Daily
@Jimmy_Fallon_Daily Жыл бұрын
Where did Event Take Damage come from?
@DragonplayerDev
@DragonplayerDev 3 жыл бұрын
This is amazing
@PrismaticaDev
@PrismaticaDev 3 жыл бұрын
You're amazing :)
@johnmannp
@johnmannp 3 жыл бұрын
So cooool
@PrismaticaDev
@PrismaticaDev 3 жыл бұрын
No UUUU are
@tanver3d982
@tanver3d982 Жыл бұрын
Could this work for grass instanced on the landscape material, if so how?
@PrismaticaDev
@PrismaticaDev Жыл бұрын
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 Жыл бұрын
@@PrismaticaDev Okay Thanks :0
@tanver3d982
@tanver3d982 Жыл бұрын
@@PrismaticaDev distance fields could be an alternative.
@Ruumablood
@Ruumablood 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! :)
@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?
@literallyjeff
@literallyjeff 2 жыл бұрын
Great info!!
@azizkurtariciniz
@azizkurtariciniz 3 жыл бұрын
Amazing tutorial, thank you! Is it possible to disable collision of individual foliage
@PrismaticaDev
@PrismaticaDev 3 жыл бұрын
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 жыл бұрын
@@PrismaticaDev Thanks for taking your time and answering!
@PrismaticaDev
@PrismaticaDev 3 жыл бұрын
@@azizkurtariciniz No worries at all! I always try to respond to every comment :)
@TheBugB
@TheBugB 3 жыл бұрын
Interesting 🧐
@PrismaticaDev
@PrismaticaDev 3 жыл бұрын
Glad you think so! :)
@かろおう
@かろおう 2 жыл бұрын
My foliages can't use Set Custum Data Value node, they even can't tigger break point in c++
@BrianDeric
@BrianDeric 3 жыл бұрын
Nice RuneScape song
@PrismaticaDev
@PrismaticaDev 3 жыл бұрын
Yeeeeeeee OSRS soundtrack is the best soundtrack
@mythran1162
@mythran1162 3 жыл бұрын
Could you share the musics info? Ty!
@PrismaticaDev
@PrismaticaDev 3 жыл бұрын
It's the OldSchool RuneScape soundtrack :)
@jd-foo
@jd-foo Жыл бұрын
Hey Charlie, have you figured out how to enable physics in a single foliage instance?
@777Darker777
@777Darker777 2 жыл бұрын
Hey, this is really great! Is it possible to use with automatic grass?
@irtehbom
@irtehbom 3 жыл бұрын
Would this work with multiplayer?
@томдубовый
@томдубовый 2 жыл бұрын
бетта версия есть , где в это можно поиграть ?
@frankgoesdownstairs
@frankgoesdownstairs 3 жыл бұрын
My third eye? I use that to poop with... you didn't make me poop
@_____J______
@_____J______ 3 жыл бұрын
I've fallen, and I can't get up!
@PrismaticaDev
@PrismaticaDev 3 жыл бұрын
Hahaha I'm tempted to leave that button in the game :P
@bobboberton349
@bobboberton349 2 жыл бұрын
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 2 жыл бұрын
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 2 жыл бұрын
@@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.
@CupCakeUnleashed
@CupCakeUnleashed 3 жыл бұрын
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.
@CosmicComputer
@CosmicComputer 3 жыл бұрын
boing boing
@PrismaticaDev
@PrismaticaDev 3 жыл бұрын
Bush go brrrrr
@notfabiantapia8942
@notfabiantapia8942 3 жыл бұрын
Hi
@mathajar9563
@mathajar9563 3 жыл бұрын
hi
@PrismaticaDev
@PrismaticaDev 3 жыл бұрын
Heyyyyy
Reducing Draw Calls in Unreal! [UE4/UE5/Blender] (Check Description!)
40:11
Potion Craft Speedrun - Philosopher's Stone in 58m:09s
58:52
Uppercasserole
Рет қаралды 305 М.
Squid game
00:17
Giuseppe Barbuto
Рет қаралды 38 МЛН
Bungee Jumping With Rope In Beautiful Place:Asmr Bungee Jumping
00:14
Bungee Jumping Park Official
Рет қаралды 17 МЛН
After 44 Years, Someone Beat the Donkey Kong Kill Screen
29:09
Kosmic
Рет қаралды 1,5 МЛН
Scammers PANIC After I Hack Their Live CCTV Cameras!
23:20
NanoBaiter
Рет қаралды 29 МЛН
Simple-ish Grass Wind (Substitute for SimpleGrassWind UE4/UE5)
18:12
Beating Spore Without Evolving (Commentary)
15:42
KinglyValence
Рет қаралды 4,2 МЛН
choosing a game engine is easy, actually
15:08
samyam
Рет қаралды 710 М.
How I Won The GMTK Game Jam
25:09
JimmyGameDev
Рет қаралды 683 М.
Maximizing Your Game's Performance in Unreal Engine | Unreal Fest 2022
41:53
Pathways & Roads using RVTs [UE4/UE5]
20:46
PrismaticaDev
Рет қаралды 43 М.
I Made a 32-bit Computer Inside Terraria
15:26
From Scratch
Рет қаралды 4,3 МЛН
how are massive game environments made?
4:08
Stylized Station
Рет қаралды 962 М.