Xian55 / WowClassicGrindBot

Highly configurable and responsive World of Warcraft Classic pixel Grind Bot - No DLL injection or memory tampering, just screen capture and input simulation.
190 stars 127 forks source link

navigation without the use of additional tools #486

Closed AnokhinAlexus closed 1 year ago

AnokhinAlexus commented 1 year ago

First of all I want to thank you for the great work done.

Is it possible to directly navigate the route from point to point without taking into account the current map / zone ? In other words, just follow the route without using Ppather, PathingAPI,AmeisenNavigation. Build a route from the current position of the character to the nearest waypoint (without taking into account possible obstacles, just a vector). Then, having reached this point, start bypassing the route. This would be useful if there is no information about the current zone in these data sources.

I tried hardcode setting the default zone if an exception like this occurs:

Unhandled exception. System.Collections.Generic.KeyNotFoundException: The given key '9988' was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at SharedLib.WorldMapAreaDB.ToWorld_FlipXY(Int32 uiMap, Vector3 map) in SharedLib\Data\WorldMapAreaDB.cs:line 52
   at Core.PlayerReader.get_WorldPos() in Core\Addon\PlayerReader.cs:line 33

set the value instead of 9988 to the existing one in the dictionary, for example 947. but it didn't help to navigate from point to point. I tried a few more similar variations, but it did not lead to the desired result.

I managed to achieve this in the previous implementation of navigation, but in the new implementation it turned out to be somewhat more difficult for me(maybe it's done quite simply, but I don't have enough knowledge to understand it). Please tell me how I can activate the "blind navigation" mode. perhaps I should comment out something, or add some hardcode. can you suggest how i can achieve this in the new navigation implementation ? Is this mod planned to be added? thank you.

path path2

Xian55 commented 1 year ago

Hello there!

Is it possible to directly navigate the route from point to point without taking into account the current map / zone ?

Certainly, yes, it is possible. But in my humble opinion it is not really viable.

I would personally not advise to use the idea as there are few drawbacks. Described in PR #394. In prior, distances were calculated such a way what you attempt to achieve with blind navigation. Calculations not going to be consistent between game zones this going to give you mixed results.

First of all, relying the WoW lua API, you can access the API_GetPlayerMapPosition It is a Vector2 like data structure (x, y). Where x and y valid value range is between 0.0 and 1.0, basically percentages. In the Navigation code, you can see that Vector3 variables prefixed with map to reflect the coordinate system.

This is a relative coordinate system, it can be applied to any 2D coordinates. For calculating reliable distances it is not really suitable since you can't use hard coded threshold distance values such as MinDistance which means what's the minimum distance where the waypoint counts as reached to the player. Or you have to specify these distance values per zone.

To backing this Map coordinate system, the Navigation code relies on the WorldMapArea.json respected to the given supported expansion.


May i ask where the 9988 value is coming from? I was unable to found 9988 value in 10.0 expansion (Dragonflight)

What game version you trying to use the project?


On the other hand, if the distance between two waypoints is less then the MinDistance threshold then the pathfinder not going to be called. In the past i did some attempts to dynamically determine MinDistance value based on the loaded path i marked as AvgDistance, but i was yet to find a solution which would work consistently among uniform and non uniform distance based routes.

Many times the problem comes from the fact that the player can leave this Route and after time has to navigate back to the waypoint track. That's what PPather, PathingAPI, AmeisenNavigation meant to solve.

AnokhinAlexus commented 1 year ago

thanks for the detailed explanation.

9988 number is specially selected as non-existent. in the original, the test was conducted in the Bastion location (UIMapId 1533). client version 10.0.2.47213.

also tried to substitute in retail/WorldMapArea.json

{
    "MapID": 2222,
    "AreaID": 10534,
    "AreaName": "Bastion",
    "LocLeft": -5308.334,
    "LocRight": -8089.584,
    "LocTop": -862.5,
    "LocBottom": -1420.834,
    "UIMapId": 1533,
    "Continent": "Bastion"
  }

here, too, expected failure, because there is not enough additional data about MapID 2222. if you set one of the existing values ​​as MapID, then this, as far as my experiments show, does not lead to the desired result.

if it doesn't make it difficult, could you suggest what further steps to bring the navigation to a working state using the example of "Bastion", or any other zone (which is not in the current version). Surely this would be useful, maybe even worth adding a paragraph to the readme about this. thank you.

Xian55 commented 1 year ago

As of current standing, retail version does not supported. Requires some work.

I've tried to highlight the main steps https://github.com/Xian55/WowClassicGrindBot/issues/327

Xian55 commented 1 year ago

10.0 made some changes around the Talent system.

I'm not familiar how the backing dataset has been changed. However after a quick look, there's a lua error about API_UnitCharacterPoints

Also Bindpad addon seems to be broken as well :(

AnokhinAlexus commented 1 year ago

you are really right. addon out of the box does not work on retail. there were problems with the volume of bags, talent points, spell IDs. maybe something else besides this. but it was not so difficult to fix all the errors that are caused by changes in the new version of the client. raw values tab ​​are all filled with correct data(after fixes).

regarding bindpad - you can always manually transfer the assignment of the desired keys to the panel(through game settings). while not as convenient as bindpad, it does the job :)

Xian55 commented 1 year ago

I did some tweaks in the addon to suppress a few errors so at least the addon can function without throwing errors by default, its nowhere near to function.

However as wow.tools transfers to "readonly" mode and the csv extractor / download function has been halted, it takes more time to generate WorldMapArea.json.

Once that in place, it should be somewhat easy to lets say "blind" the navigation's pathfinder part, by for now adjusting the Navigation.MaxDistance and Navigation.AvgDistance to a really high values so the pathfinder never requested to calculate a route.

Xian55 commented 1 year ago

I've just pushed a new branch to show a proof of concept of the idea what i meant.

The last commit should contain my previously mentioned idea how you can blind the Navigation by never calling the pathfinder.

Commit contains an updated WorldMapArea.json up to 10.0 so it should contain all the necessary info to calculate distances correctly

Note that, exp/retail-disable-pathfinder branch has many other issues which needed to be taken care of before its going to be usable at all.


If you wish to further continue extracting the wow.tools dataset i could recommend this guide on how to convert db2 data to csv.

Then use the ReadDBC_CSV solution to convert the csv data to json. It has some changes compare to wotlk so it require some investigation. If you copy the csv files under the data folder then the downloading process will be skipped and the conversion process starts.

AnokhinAlexus commented 1 year ago

thanks for the help and clarification. the demonstrated PoC is more than enough.

Xian55 commented 1 year ago

Closing as of resolved.