Unnecessary Amounts of Scaffolding Causes Serious Astar Slowdown

I didn’t see a generic pathfinding slowness post for A20. Feel free to merge if you know of one.

There is a 2 part performance problem. First, an excessive amounts of scaffolding is made.

2nd, Your pathfinding chokes on number of vertical connections.

Game Save:
I would upload my gave save in 1 file, but even at max compression, it is barely too large.
Astar.zip (2.1 MB)
server_state.zip (7.8 MB)

Potential Solution:
Real scaffolding doesn’t have vertical pathing everywhere.

My suggestion would be to make sporadic vertical connections for scaffolding.
Poor ASCI Art Ex:

|     |          |          |          |         |         |
|     |          |          |          |         |         |

Hearthings would just raise the flat, top-level scaffolding when building up. This would be fine because your dependency graph always builds bottoms up. Otherwise, fix the traversing of all vertical connections.

I have a high end machine, so astar is usually 1-3% usage. The perf issue goes away as soon as scaffolding goes down.

1 Like

The real problem isn’t actually the scaffolding itself, it’s the fact that you’re building that wall as one building and the game is litterally choking because of the current pathfinding system (which is changing for a21 iirc) Every time a hearthling builds a block or set of blocks, the pathfinding system has to run a new check for every single entity that can move to make sure that their paths have not changed. The system itself is flawed and they are already working on fixing it.

1 Like

This is undoubtedly also a problem and a decent contributor. However, if this was the primary cause, mass mining would see the same problem, but I don’t see significant slowdown there. Also, there isn’t slowdown in the building process until most of the wall is up. This doesn’t jive with your supposition, because there is actually more building going on at the start of the building process than when the wall is mostly up. I created a much larger structure latter, and hearthlings would get so confused, that they almost weren’t building anymore. They would build 1-2 blocks, then return the stone to storage. In this case, I also saw massive slowdown. I also suspended most of my builders, and saw the same slowdown. The issue is definitely related to something other than block modification.