When using erosion, is there some way to get more control over which tags it overwrites?

I have a scenario where all my water is tagged with my water tag, this tag is untraversable. The reason I use tags instead of walkability is because at runtime if a unit jumps in a boat, I need to make these tags traversable for only that unit.

This works fine, however it causes an issue when I place a building next to my water, since the erosion tags from that building will overwrite the water tag, making the water traversable.

Is there some way I can say “never let erosion overwrite this tag”? Or is there some other, better, way to deal with water traversal at runtime other than using tags?

@aron_granberg any advise on this one? :slight_smile:

The only solution I can think of is to create a seperate grid for water, turn boats into agents that traverse this grid. And disable agent for the unit in the boat. Tho that seems really complex and probably crappy for performance to add a second graph just for this.

I guess another option is to disable your erosion and write my own somehow, that ignores the correct tags. Do you know where the code for erosion is? Maybe I can copy 99% of it and just add a simple if-statement somwhere.

Hi

It’s not possible to control erosion in this way at the moment. However, if you want to modify it, all the code is in GridGenerator.cs.

Just fyi. There is also the ITraversalProvider. But it requires some additional scripting to set up. See Utilities for turn-based games - A* Pathfinding Project

1 Like