- Joined
- Aug 23, 2015
- Messages
- 1,961
- Thread Author
- #1
Why Pathing is Important:
Runemate's pathing systems are what allow bots to move between locations in-game. Any bot in the store that moves more than a screen distance away utilizes some sort of pathing.
Types of Paths available:
Bresenham Path: Builds a direct line between two points.
Region Path: Generates a path constricted to the currently loaded in-game region (104x104). The generated path is based on the regions collision flags (these detect you can't walk through, and some other things) to allow you to walk around obstacles such as buildings or trees.
Predefined Path: A path defined by you (the author), consisting of a set of coordinates that are traversed in order.
Viewport Path: A path that clicks on in-game tiles to walk. To create a viewport path, generate a Coordinate Path (AKA a Bresenham, Region, or Predefined path), and convert to viewport.
(Default) Webpath: Uses Runemate's default web to generate a path. This path can handle most obstacles such as doors and staircases, will utilize Normal/Lunar/Ancient teleports, jewelry teleports, spirit trees, and gnome gliders. Usage is recommended only when traversing past obstacles or over significant distances.
Advantages/Disadvantages of Paths:
Each of these examples is in the form of a TreeTask, which is the "Leaf" of a treebot.
Bresenham Path: Doesn't navigate around objects. Bresenham paths are best used in large open areas for basic walking. Reliable generation as long as no obstacles, such as doors, block the path generation.
Region Path: Paths go around objects, but cannot pass obstacles such as doors or agility shortcuts. Path will generate null if you try to walk to a different in-game region.
Predefined Path: Very reliable since the path is supplied by the author instead of generated, but restrictive and repetitive by nature. Usage is discouraged. Cannot traverse obstacles such as doors.
Viewport Path: Clicks on in-game tiles to walk, which allows for greater precision when you need to walk to a specific tile. Can be more human-like in certain situations.
(Default) Webpath: Can traverse obstacles such as doors, staircases, and ladders (Aka can move between in-game planes). Utilizes many teleports without significant implementation efforts by the authors. Has one disadvantage - If the webpath doesn't work properly, or doesn't generate, the author must rely on Runemate staff for the problem to be fixed.
Coding with Paths:
Bresenham Path:
Region Path:
Predefined Path:
Viewport Path:
(Default) Webpath:
An Extra: TraversalOptions
All types of paths can also take an argument of Traversal Options when calling .step()
Traversal options as of 12/25/2017 are:
MANAGE_DISTANCE_BETWEEN_STEPS
MANAGE_RUN (turning it on if it runs out and re-generates)
MANAGE_STAMINA_ENHANCERS (stamina potions, terrorbird scrolls, etc)
All types of paths default to managing these things if not specified by the author. They can all be disabled using .step(false), or individually enabled using .step(TraversalOptions you want to enable).
Runemate's pathing systems are what allow bots to move between locations in-game. Any bot in the store that moves more than a screen distance away utilizes some sort of pathing.
Types of Paths available:
Bresenham Path: Builds a direct line between two points.
Region Path: Generates a path constricted to the currently loaded in-game region (104x104). The generated path is based on the regions collision flags (these detect you can't walk through, and some other things) to allow you to walk around obstacles such as buildings or trees.
Predefined Path: A path defined by you (the author), consisting of a set of coordinates that are traversed in order.
Viewport Path: A path that clicks on in-game tiles to walk. To create a viewport path, generate a Coordinate Path (AKA a Bresenham, Region, or Predefined path), and convert to viewport.
(Default) Webpath: Uses Runemate's default web to generate a path. This path can handle most obstacles such as doors and staircases, will utilize Normal/Lunar/Ancient teleports, jewelry teleports, spirit trees, and gnome gliders. Usage is recommended only when traversing past obstacles or over significant distances.
Advantages/Disadvantages of Paths:
Each of these examples is in the form of a TreeTask, which is the "Leaf" of a treebot.
Bresenham Path: Doesn't navigate around objects. Bresenham paths are best used in large open areas for basic walking. Reliable generation as long as no obstacles, such as doors, block the path generation.
Region Path: Paths go around objects, but cannot pass obstacles such as doors or agility shortcuts. Path will generate null if you try to walk to a different in-game region.
Predefined Path: Very reliable since the path is supplied by the author instead of generated, but restrictive and repetitive by nature. Usage is discouraged. Cannot traverse obstacles such as doors.
Viewport Path: Clicks on in-game tiles to walk, which allows for greater precision when you need to walk to a specific tile. Can be more human-like in certain situations.
(Default) Webpath: Can traverse obstacles such as doors, staircases, and ladders (Aka can move between in-game planes). Utilizes many teleports without significant implementation efforts by the authors. Has one disadvantage - If the webpath doesn't work properly, or doesn't generate, the author must rely on Runemate staff for the problem to be fixed.
Coding with Paths:
Bresenham Path:
Code:
public class Walk extends LeafTask {
private Coordinate destination = new Coordinate(3013, 5608, 0);
@Override
public void execute() {
BresenhamPath bresPath = BresenhamPath.buildTo(destination);
if(bresPath != null){
bresPath.step();
} else {
getLogger().warn("bresPath was null in Walk");
}
}
}
Region Path:
Code:
public class Walk extends LeafTask {
private Coordinate destination = new Coordinate(3013, 5608, 0);
@Override
public void execute() {
RegionPath regionPath = RegionPath.buildTo(destination);
if(regionPath != null){
regionPath.step();
} else {
getLogger().warn("regionPath was null in Walk");
}
}
}
Predefined Path:
Code:
public class Walk extends LeafTask {
private PredefinedPath predefined = PredefinedPath.create(new Coordinate(3016, 5627, 0), new Coordinate(3015, 5624, 0), new Coordinate(3015, 5622, 0),
new Coordinate(3014, 5619, 0), new Coordinate(3013, 5616, 0), new Coordinate(3013, 5613, 0), new Coordinate(3013, 5611, 0),
new Coordinate(3013, 5608, 0));
@Override
public void execute() {
if(predefined != null){
predefined.step();
} else {
getLogger().warn("predefined was null in Walk");
}
}
}
Viewport Path:
Code:
public class Walk extends LeafTask {
private PredefinedPath predefined = PredefinedPath.create(new Coordinate(3016, 5627, 0), new Coordinate(3015, 5624, 0), new Coordinate(3015, 5622, 0),
new Coordinate(3014, 5619, 0), new Coordinate(3013, 5616, 0), new Coordinate(3013, 5613, 0), new Coordinate(3013, 5611, 0),
new Coordinate(3013, 5608, 0));
@Override
public void execute() {
if(predefined != null){
ViewportPath viewport = ViewportPath.convert(predefined);
//viewport won't ever be null, so no need to null check it
Coordinate nextStep = viewport.getNext();
if(nextStep != null){
if(nextStep.isVisible()){
viewport.step();
} else {
Camera.concurrentlyTurnTo(nextStep);
}
} else {
getLogger().warn("Could not get next step of viewport");
}
} else {
getLogger().warn("predefined was null in Walk");
}
}
}
(Default) Webpath:
Code:
public class Walk extends LeafTask {
private Coordinate destination = new Coordinate(3013, 5608, 0);
@Override
public void execute() {
WebPath webPath = Traversal.getDefaultWeb().getPathBuilder().buildTo(destination);
if(webPath != null){
webPath.step();
} else {
getLogger().warn("Could not generate webPath in Walk");
}
}
}
An Extra: TraversalOptions
All types of paths can also take an argument of Traversal Options when calling .step()
Traversal options as of 12/25/2017 are:
MANAGE_DISTANCE_BETWEEN_STEPS
MANAGE_RUN (turning it on if it runs out and re-generates)
MANAGE_STAMINA_ENHANCERS (stamina potions, terrorbird scrolls, etc)
All types of paths default to managing these things if not specified by the author. They can all be disabled using .step(false), or individually enabled using .step(TraversalOptions you want to enable).
Code:
public class Walk extends LeafTask {
@Override
public void execute() {
WebPath webPath = Traversal.getDefaultWeb().getPathBuilder().buildTo(new Coordinate(3013, 5608, 0));
if(webPath != null){
webPath.step(Path.TraversalOption.MANAGE_DISTANCE_BETWEEN_STEPS, Path.TraversalOption.MANAGE_RUN);
} else {
getLogger().warn("Could not generate webPath in Walk");
}
}
}
Last edited: