Feeh
Sphere Developer
Posts: 156
Likes Given: 6
Likes Received: 40 in 29 posts
Joined: Sep 2012
Reputation: 4
|
RE: TestRun for NPC navgation
(09-18-2013 09:28 AM)Rattlehead Wrote: well, one thing RunUO has that we dont, that we SHOULD have, are waypoint gems, no scripting required and they work (last time i checked 10 years ago) pretty well, i had one with 20 waypoints, all of which he flawlessly executed in a dungeon, so if the devs implemented something like this, we would be one step closer to having functionality on their level.
(09-18-2013 10:31 AM)Anarch Cassius Wrote: I've seen a way point based caravan but then you just have a static route.
Ideally you'd have the waypoints form a nodemap and use an A* variant to navigate that. Possibly using square grid based A* for finer dynamic navigation at other times.
The question is how to do that most efficiently without bogging down the server.
RunUO's waypoints tells the npc where to go, and A* finds out how to get there. However, the npc does not need the waypoint to move, if they are following its master, the master will become the "waypoint". The A* also does not need waypoints, if you don't mind about the process usage, you can make the npc run from Britain to Minoc, however, the max distance of search is limited due high amount of processing required to find long paths
Waypoints were designed to be a simple predefined route. You can set a bunch of waypoints then point the spawner to the first, when the npc reach the last one, it will try to go back to home or wander or even go back to the first waypoint if it is pointed by the last one.
Callandor2k released a ML version of RunUO which implements the city guides. It contains every city pre-mapped; It does use the Djikstra algorithm to find the best(?) path between the current position and the destination using the internal map. It will create waypoints to make the npc follow them, and when the npc reach it, it will move the waypoint to the next vertex, so the npc will "never" achieve the waypoint until the destination is reached. You can also expand the vertex list and pre-map every world road, city, and dungeon, so the npc can go almost everywhere using the internal vertex map.
Feeh/Epila - Nightly releases / SphereWiki / Github Issues / Sphere's GitHub
|
|
09-20-2013 07:48 AM |
|
|
Anarch Cassius
Master
Posts: 273
Likes Given: 19
Likes Received: 10 in 9 posts
Joined: Mar 2012
Reputation: 2
|
RE: TestRun for NPC navgation
Quote:The A* also does not need waypoints, if you don't mind about the process usage, you can make the npc run from Britain to Minoc, however, the max distance of search is limited due high amount of processing required to find long paths
Waypoints were designed to be a simple predefined route.
See my idea is basically a parallel of Callandor2k's. Dijkstra's algorithm is just A* without heuristics, so it's literally the same thing.
The only question I see is...
Static: Make every waypoint have set paths with known distances.
Advantage: Speed
Disadvantage: Changes are a pain.
Dynamic: Periodically do a FORITEMS and measure distance to all current waypoints to get the list.
Advantage: Easy to change on the fly
Disadvantage: Periodic re-calculation required, including whether there actually IS a direct path between the waypoints or if that line would hit major obstacles.
Current Projects: Necromancy SCP overhaul. Custom Faction AI/System. Imbuing.
|
|
10-06-2013 01:10 PM |
|
|