How to approach forests in a strategy game

I am worried for this you will eventually need to go C++.

Anyway, first of all, you probably don’t want to update the growth each tick, but let’s say at least each second. Then, you can always update only part of the trees each second, not all of them. For example just 25% of the trees just on the borders of the forest (borders of fully grown tree tiles) each second.

So let’s say you have 10 000 tree forest. Only areas on the edges of the forest are supposed to grow further, so you somehow mark those for update, that reduces it to maybe 1000. You then partition those 1000 to 4 update groups, so every second, 250 of them updates. So every 4 seconds, you will update the entire growth cycle.

From the graphical performance standpoint, I’d suggest just having some C++ based system which keeps track of the forest growth and visually, that system would be represented by Hierarchical Instanced Static Mesh Component in the game. So the trees in the simulation would be tied to the HISM instance indices (HISM keeps track of its instances using simple integer index values, which you can then use to efficiently edit and transform individual instances), and animation-wise, you could always just get an array of the trees to update visually, and modify transforms or other properties of the specific HISM instances.

This should give you performant solution both when it comes to game code and graphics code.

That being said, this is quite an advanced thing to pull off. It should be also possible to pull this off just with BP alone, but it will probably require truly expert level BP skillset to pull it off with good performance :slight_smile:

1 Like