A breakdown of OSRS pathing
Posted: Wed Jan 01, 2020 9:00 am
Ok boys happy new year lets get it
Observations:
Two man-looping is possible (Vid 1, 0:06)
Following or attacking someone paths to the tile they were standing on last (vid 2)
A "destination update" occurs on each click, or each time you're following someone who updates their tile (vid 1 0:06, vid 1 0:40)
On each destination update, the moving players "last tile" is set to the last tile they were on (the second to last tile in their path - on a 2-tile path it's the first tile the walker was on, for 3+ it's the second to last, if that adds any clarity. Like if you think of the path as a sequence of tiles it's the second to last member of the sequence you need to use)(edit: you can simplify this calculation to one tile in the opposite direction of their last movement).
My breakdown of the follow/attack algorithm (for Player B following Player A):
Player B clicks "follow/attack Player A"
Each game tick, check and save Player A's "last tile", unless player B clicks off to unfollow or gets in range to attack player A
On the next tick, path player B to that tile (seems delayed but tbh OSRS itself feels delayed when you look at the vids).
Update player B's last tile (on the same tick player B was pathed and moved).
My breakdown (read: guess) of the pathing algorithm:
Specifics aside our pathing algorithm in terms of point to point is just fine as far as I can tell (except near trees but it very well could be making optimal paths in that case and I'm just an idiot), I think the biggest disparity is the way it works when you are following or trying to attack someone, I don't PK but I remember L0Ling at Niels' vid of running rectangles while attacking someone because it was following their path tile-for-tile.
Now TBH I'm not sure if there are any actual benefits to the OSRS way but people have never not complained about PKH pathing so maybe if we can copy them all the way or at least take the good parts (like constantly updating the destination, or at least when there's a good reason to, such as a destination update) then maybe we can find out exactly where the issue is or get rid of it. That's all thanks for your time feel free to contribute or correct anything.
Observations:
Two man-looping is possible (Vid 1, 0:06)
Following or attacking someone paths to the tile they were standing on last (vid 2)
A "destination update" occurs on each click, or each time you're following someone who updates their tile (vid 1 0:06, vid 1 0:40)
On each destination update, the moving players "last tile" is set to the last tile they were on (the second to last tile in their path - on a 2-tile path it's the first tile the walker was on, for 3+ it's the second to last, if that adds any clarity. Like if you think of the path as a sequence of tiles it's the second to last member of the sequence you need to use)(edit: you can simplify this calculation to one tile in the opposite direction of their last movement).
My breakdown of the follow/attack algorithm (for Player B following Player A):
Player B clicks "follow/attack Player A"
Each game tick, check and save Player A's "last tile", unless player B clicks off to unfollow or gets in range to attack player A
On the next tick, path player B to that tile (seems delayed but tbh OSRS itself feels delayed when you look at the vids).
Update player B's last tile (on the same tick player B was pathed and moved).
My breakdown (read: guess) of the pathing algorithm:
Spoiler: show
Now TBH I'm not sure if there are any actual benefits to the OSRS way but people have never not complained about PKH pathing so maybe if we can copy them all the way or at least take the good parts (like constantly updating the destination, or at least when there's a good reason to, such as a destination update) then maybe we can find out exactly where the issue is or get rid of it. That's all thanks for your time feel free to contribute or correct anything.