Path Generating with existing paths
StormWing0 last edited by
Just wondering. I'm working on road generation code and got it mostly working but wondering how to set it up to use the generated paths as needed to generate branching paths like the creeps look for existing roads over making a new path outright.
I'll post my current code if wanted.
Donatzor last edited by
Admittedly part of the fun with Screeps its solving the challenges you face when wanting to automate / do something.
If your asking about how to make a path, https://docs.screeps.com/api/#Room.findPath would be one way then you can use https://docs.screeps.com/api/#Room.Room-serializePath to help save it to memory for repeated use.
Alternatively you could make your own path-finding solution based on your roads. You can use a few different methods for finding roads around a point, or at a point then towards your goal/from your goal.
StormWing0 last edited by StormWing0
@donatzor The idea was to make the paths that were found have the same value as roads at least while generating paths. Generating the paths is the easy part it's the making the ones already generated be as helpful as roads when generating new paths that's the hard part.