Information
I built this Foliage System for my own game http://justusgame.com and I’ve converted it into a standalone foliage harvesting system.
It is built for Multiplayer
Replaces a Foliage Instance with a Blueprint that you can interact with
Performance friendly, only interacts with selected foliage instance
Works with Foliage Placement tool & Procedural foliage volumes
Supports respawning foliage instances
Useful when combined with a crafting/inventory system that enables you to harvest resources. The Foliage System now also supports re-spawning Foliage Instances in the same location it was harvested in.
Interactive Foliage has been updated to version 1.3 The update has been sent to Epic, not yet processed
Now supports respawning of harvested foliage, this can be configured on/off and you also have a setting on how often foliage should respawn, this feature respawns the old instance with the same scale, rotation and location (transform).
Added settings to DT_Resources datatable to set which resources that should simulate physics
Added a setting in DT_Resources to apply impulse on depletion (useful to make trees tip over)
Added a function to find a resource actor in your level in case the resource actor reference in the struct array is invalid (useful if you want to save/load)
Disabled movement replication on BP_MasterResource to save on bandwidth when simulating physics, physics will be handled locally on the clients
Added a function to make sure an instance actor is valid, possibly eliminating dedicated server crash, needs more testing
This update is NOT compatible with any old version of the Interactive Foliage, it has a lot of changes and improvements in both blueprints & structs, a complete update is required!
REGARDING DEDICATED SERVERS
If you are using dedicated servers, there is currently an Engine issue where the array of Instance Meshes is being nullified because the meshes are not considered rendered in some cases.
Updated version 1.2 has been submitted to Epic, the new version has been reworked a bit and is now super easy to add new resources!
Check out http://eeldev.com for tutorials!
It seems the ISM array is invalid because it’s not rendered on Dedicated servers, GetStaticMesh()->HasValidRenderData() &&
A “quick” and dirty fix for this is simply not removing the instances on the dedicated server, your characters will still collide with invisible meshes, so you’ll have to setup custom collision channels for this.
But considering you are using Dedicated Servers, you already have the source built version of Unreal Engine on your computer, so applying the fix that was supplied in that post is fairly straight forward.
No, it’s harvesting only. However, I have been playing around with re-planting the instances and it seems to work fine, I might update the Interactive Foliage at a later date to support this, since you’re not the first asking about this.
First off all, what a great system! Very easy to integrate, well done! But I do have a question I can chop trees but trees are not falling down when harvested…they only fall down when i walk into the tree. My idea is to give the tree some physics effect after it is harvested, so the tree falls down to the ground. Maybe you can give me some ideas how you would handle this?
im also interested into this only thing on my side is, it would be awesome to have a stump model left. Looks a bit wierd to fall the complete tree and youre able to look inside
Ok So got it all setup and working, But when i collect the materials / gathering the tree doesn’t fall unless I push it. ???
Any Ideas please let me know.
Hey there!
If you want the trees to fall over, you can apply a force to the tree to make it fall over, and/or set the tree’s collision to a capsule and that should make it fall over, using a combination of them should be the best approach.
I did some initial testing for replating trees, it’s not a difficult task if you want to do it yourself, just save the removed instances transform in an array and use that information to spawn a new instance.
Reason why I haven’t updated with this feature is it was never planned or announced as a feature and I haven’t found the time to do it.
I don’t own the Survival Inventory, there is a MSGT (Multiplayer Survival Game Template) integration tutorial though
im sure theres something great to achieve with those parameter, almost doiing what i want, if it could help someone to start with, im doiing this in the BP_MasterResource.