#New thread

1 messages ยท Page 1 of 1 (latest)

edgy radish
#

i am really curious to see the implementation for this ๐Ÿ‘€

cursive viper
#

But how do you implement edge removal?

clever lantern
# cursive viper 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.

clever lantern
edgy radish
#

its often the not yet cleaned up code that gives an interesting insight

clever lantern
keen imp
clever lantern
#

@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

keen imp
#

What lovely goodies to read tomorrow morning