First of all:
My ideas:
NOTE: I haven’t tried any of this, I’m just brainstorming, so it may or may not work. My main focus was on avoiding having to update the trees.
Meshes:
Instead of using actors for each tree, just use a single actor for all (or groups of) trees. Use mesh components for the meshes, and an array of structs for the data (or you can extend the mesh instance class in blueprints and add the variables in that). You can place them on a mesh or terrain by just using a line trace.
Updating:
You can avoid having to update or manage trees entirely if you store the creation time rather than the progress. Whenever it’s accessed (e.g. when it’s being chopped down), compare the tree’s creation time to the current game time, and this will give you the tree’s age (i.e. progress).
Rendering (this is a little iffy, so idk if this will work):
I’ve never worked with instancing, so this only deals with cosmetic stuff.
The problem now is that since trees are no longer updated per frame, we can only do material-side things (like change colors or world offset), but not gameplay-side things (like change meshes or materials), or else we’ll have to update them. So rendering is gonna have to be done solely through materials.
If you only have one tree mesh, and you don’t need anything fancy, then just animating colors and world offset should be enough. But if you want to have more than one mesh for different stages, you can try this: combine all the meshes into one single mesh (i.e. all meshes are overlapping each other in one file). Have a mask texture that tells which mesh should be visible at which stage of the tree’s lifetime (e.g. 0 = stage 0, 1 = stage 1, etc.). When the tree is created, set the creation time as a scalar parameter on the material instance. In the material, compute the age of the tree and use that to determine the stage, then compare the stage with the mask: if the mask is equal to the stage, it’s visible, else, it’s masked. This will allow you to “switch meshes” using only the material.
You can alternatively make a tree growing effect by making the tree appear from bottom to top over time (like an invisibility or dissolve effect), then animating the leaves using a world offset.
Chopping:
When a character chops down a tree, calculate its age and use that to determine how much resources to get from it.
Dying:
You can group trees with similar die times together, and only kill off trees in one group at a time. After the last tree from the group is killed off, kill off the next group.
Ticking:
My goal was to avoid ticking the trees altogether, but if you use the component tick interval idea, you can update trees gameplay-side every so often.