#New thread
1 messages ยท Page 1 of 1 (latest)
But how do you implement edge removal?
I dont. I have to strategically recalculate the graph after certain number of tile deletions I guess. But that can be done on a chunk by chunk basis to spread the workload over multiple ticks. And since I dont expect the tiles to be removed that often and the only cost of being wrong is calling the pathfinder unnecessarily, which would've happened anyway if I don't use this, i think it's worth the compromise.
I have to clean things up first 
When i get home I'll push it to git and share it with you
i too would be interested in viewing the implementation if possible
@edgy radish @keen imp
Here's the implementation of the disjoint set
https://github.com/jurgyy/Factorio-Bronze-Age/blob/main/disjointSet.lua
Tiles get added in the tile_built_event
https://github.com/jurgyy/Factorio-Bronze-Age/blob/main/control.lua#L252
And in the PathfindingCollection file, which is an object that holds possible start and end points for a pathfinder uses the disjoint set to check if the two points are connected
https://github.com/jurgyy/Factorio-Bronze-Age/blob/main/PathfindingCollection.lua#L97
What lovely goodies to read tomorrow morning
