Traveler is a general-purpose tool for moving your creeps around. Feel free to fork and use in other projects.
- Efficient path-caching and CPU-use (you can see how it compares with
- Ignores creeps in pathing by default which allows for fewer PathFinder calls and single-lane creep movement
- Can detect hostile rooms and will path around them once discovered. More info on how to enable detection here
- Effective long-range pathing
- Lots of options
Add a require statement to
var Traveler = require('Traveler');
- (in the sim or some private servers you might need to use
Replace situations where you used
// creep.moveTo(myDestination); creep.travelTo(myDestination);
travelTocreates a new object in creep memory,
_trav, which is analogous to the object used by
moveTo()for caching the creeps path. For this reason, it will save memory to use either
moveTo()with a given creep, but not both.
- As with any algorithm where creeps aren't a consideration for pathing by default, you'll have best results when their path has a low chance of including immobile creeps. My creeps rarely reach the "stuck threshold" because I take extra considerations to keep the roads clear.
The file itself has comments, and you can also find documentation in the wiki. I'm also looking for feedback and collaboration to improve Traveler, pull requests welcome!
- Reorganized type definitions into index.d.ts
- Fixed bug where public ramparts were not seen as pathable
- Fixed bug that caused exceptions due to non-existant Memory.rooms
- Fixed bug that caused options.preferHighway to not prefer highways
- Fixed bug in the commented line of code that registered whether creeps were in a hostile room or not.
- New version of Traveler! See what is different here. The old version can still be found here.
- Fixed a bug where public ramparts were not set as valid positions for pathing in the costmatrix (thanks ricane!)
- Fixed a bug where pathfinder gets needlessly called when using
- Fixed bug in code that determines whether a room is SK from roomname
- Eliminated option
- Fixed bug where preferHighway would not produce the intended results
- Fixed bug where ignoreCreep behavior was reversed and creeps could not get unstuck