Hey
was wondering if anyone has some info on how all the wagons of a train are kept on the same path.
Trying to implement my own train project (not planning on selling anyhting) and it's something I'm stuck at, the only thing I can currently do is make them pick a random turn at intersections
works fine when there's no intersection obviously
Implementation details on the train pathfinding (same path)
Re: Implementation details on the train pathfinding (same path)
I do not know how exactly the pathfinding works in factorio, but basically you have to build the weighted graph from your railroad.
The vertexes will represent intersections and possible other notable points such as stops. Weight of the edges can contain length of the section itself and stuff like a penalty for red signals.
The vertexes will represent intersections and possible other notable points such as stops. Weight of the edges can contain length of the section itself and stuff like a penalty for red signals.
Well, all the wagons just follow the first one. Save the calculated path and use it for all of them.harmony wrote:was wondering if anyone has some info on how all the wagons of a train are kept on the same path.
Re: Implementation details on the train pathfinding (same path)
There are 10 types of people: those who get this joke and those who don't.