[QUESTION] Extracting player coordinates menu

User Tag List

Results 1 to 10 of 10
  1. #1
    nazmox's Avatar Member
    Reputation
    2
    Join Date
    Jul 2023
    Posts
    10
    Thanks G/R
    2/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [QUESTION] Extracting player coordinates

    Hello guys! Currently I try to create a world of warcraft retail(10.5) bot for movement.

    I already created a Navemsh for every map, but the world coordinates are not the same as in world of warcraft.

    Is there any way I can get the real World coordinates of the player instead of the shitty "map coordinate" what the game provides for me?


    Do I need Memory reading to extract this information or can I get it in some other way?

    [QUESTION] Extracting player coordinates
  2. #2
    Jirno's Avatar Member
    Reputation
    3
    Join Date
    Mar 2023
    Posts
    12
    Thanks G/R
    2/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Honestly, idk how map coordinates work on retail, but I was using formula to convert map coords to 3d space coords (only X and Y) on 3.3.5
    I'm not sure if it will work for botting (it's not very precise because of floating point), but it's still some kind of way to not use memory reading

    X1, X2, Y1, Y2 are location borders. I was obtaining mine from Data/Content/WorldMapAreaData.json

    Code:
    3D SPACE TO MAP:
    
    Get Y1(LocTop), Y2(LocBottom), X1(LocLeft), X2(LocRight):
    Y1 = LocTop
    Y2 = LocBottom
    X1 = LocLeft
    X2 = LocRight
    
    Calculate Xdifference and Ydifference:
    Xdifference = X2 - X1
    Ydifference = Y2 - Y1
    
    Calculate Xspace and Yspace:
    Xspace = CharacterX - X1
    Yspace = CharacterY - Y1
    
    Calculate Xpercentage and Ypercentage:
    Xpercentage = (abs(Xspace) / Xdifference) * 100
    Ypercentage = (abs(Yspace) / Ydifference) * 100
    
    Calculate map coordinates:
    map_x = Xpercentage
    map_y = Ypercentage
    
    ________________________________________
    
    MAP TO 3D SPACE:
    
    Get Y1(LocTop), Y2(LocBottom), X1(LocLeft), X2(LocRight):
    Y1 = LocTop
    Y2 = LocBottom
    X1 = LocLeft
    X2 = LocRight
    
    Calculate Xdifference and Ydifference:
    Xdifference = X2 - X1
    Ydifference = Y2 - Y1
    
    Calculate Xpercentage and Ypercentage:
    Xpercentage = map_x
    Ypercentage = map_y
    
    Calculate Xspace and Yspace:
    Xspace = (Xpercentage / 100) * Xdifference
    Yspace = (Ypercentage / 100) * Ydifference
    
    Calculate 3D space coordinates:
    x_3d = X1 + Xspace
    y_3d = Y1 + Yspace
    Credits to radarlove (Zones and coordinates --> World to Zone coordinates), tyvm

  3. Thanks nazmox (1 members gave Thanks to Jirno for this useful post)
  4. #3
    whereami78's Avatar Member
    Reputation
    1
    Join Date
    Sep 2023
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  5. #4
    Mathex's Avatar Member
    Reputation
    4
    Join Date
    Sep 2023
    Posts
    3
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The best way is of course to do as the Unit_GetPosition function does, or calling it diretctly. You can get a player's position like this (for retail):

    Code:
    Vector3 GetPosition(uintptr_t* unitptr)
    {
        if (unitptr == nullptr)
        {
            return Vector3();
        }
    
        auto movement_globals = *reinterpret_cast<uintptr_t*>((uintptr_t)unitptr + 176);
        return *reinterpret_cast<Vector3*>(movement_globals + 32);
    }
    Last edited by Mathex; 09-05-2023 at 06:03 AM.

  6. Thanks nazmox, thateuler (2 members gave Thanks to Mathex for this useful post)
  7. #5
    nazmox's Avatar Member
    Reputation
    2
    Join Date
    Jul 2023
    Posts
    10
    Thanks G/R
    2/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not really into memory editing in world of warcraft. How can I get the player's unitpointer?

  8. #6
    wardrive's Avatar Active Member
    Reputation
    20
    Join Date
    Jul 2023
    Posts
    43
    Thanks G/R
    23/8
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Odd, because this is the WoW Memory Editing subforum. I suggest that you search for the keywords you're looking for using the search feature, or posting your question in the general Bots + Programs section.

    You basically have two options:

    1. Do the math yourself and correlate map coordinates to your own coordinate system. This isn't hard, it's just time consuming.
    When my bot was pixel based, I started by just extracting map coordinates and plotting them on a scatter plot with the zone map in the background. Actually works pretty well on a zone by zone basis. Math tweaks obviously required.
    The problem with this method is that the correlation between zone coords and world coords is fucking random as shit, and changes quite drastically depending on where you are located in game. There isn't a universal algo that I'm aware of that does it for you.

    2. Get into memory editing, write about 15 lines of code, and retrieve the values that way. Same as above.

    Both options require reading on your part, and all of the information you need is on the forum. Alternatively, you could launch cheat engine and use it to find the values yourself. Which is also not hard, and doesn't require much in the way of effort. Scan for unknown float first scan. Move, scan for changed floats. Scan for unchanged float. Move again. Scan for changed float. Scan for unchanged float. Move. Scan for changed. Scan for unchanged. Repeat repeat repeat. Boom.
    Last edited by wardrive; 09-05-2023 at 01:35 PM.

  9. #7
    nazmox's Avatar Member
    Reputation
    2
    Join Date
    Jul 2023
    Posts
    10
    Thanks G/R
    2/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Honestly I tried both options. The problem was with the first option was exactly what you said. there is no good conversion between map coordinates and world coordinates. in older versions of wow there was a data file where you can extract the starting and ending coordinates of each map, but now in retail there is no such thing.


    I'm currently trying to learn memory editing to get the coordinates from there, but there is no reliable offsets for the object manager in game version 10.1.5 sadly, and I'm not skilled at reverse engineering at all so I cant dump the offsets for myself.

    I also tried to extract pointers for coordinates in cheat engine, but I can only extract temporary values what are not even valid if I restart the game because they are not Pointers.

    I think I'm pretty much lost now and don't really know how to move forward.

  10. Thanks Hazzbazzy (1 members gave Thanks to nazmox for this useful post)
  11. #8
    wardrive's Avatar Active Member
    Reputation
    20
    Join Date
    Jul 2023
    Posts
    43
    Thanks G/R
    23/8
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could try generating a pointermap for the coordinates addresses you find, using Cheat Engine. Then you have to filter out the pointers you found until you find one that doesn't change between client resets. That's a process all by itself.

    Or, you could use the offset posts to throw something together that simply returns the current players x,y,z world coordinates. Pretty sure that can be done in less than 15 lines of code in any language.

    Which is honestly the answer to your question to begin with.
    Last edited by wardrive; 09-06-2023 at 04:07 AM.

  12. #9
    nazmox's Avatar Member
    Reputation
    2
    Join Date
    Jul 2023
    Posts
    10
    Thanks G/R
    2/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah the code part is not a problem for me. finding pointers is hard to me. World of warcraft retail is crashing if I attach the debugger of CE to it, so I don't know how to find the pointers. I'm not really familiar with reverse engineering.
    Also if I would have the offsets I could write the code, but there is no offset dump for world of warcraft 10.1.7 version ring now.

  13. #10
    nazmox's Avatar Member
    Reputation
    2
    Join Date
    Jul 2023
    Posts
    10
    Thanks G/R
    2/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Currently I'm giving up on memory reading version because I don't have the offsets to do this and not skilled enaugh for reverse engineering retail so probably this would a waste of time for me.

    My workaround is that I found a dbc file for older versions of world of warcraft.

    WoW.tools | Database browser
    Credits to wowtools!

    I can use this to extract map coordinate borders and I can use the Jirno provided before to convert map coordinates to world coordinates.
    This solution is way worst that the memory reading because this file just contains the maps until legion (sadly no shadowlandland dragonflight) but would be a good enaugh solution for everyone for a simle movement system.

Similar Threads

  1. [Question] About player models
    By regnarog in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 07-09-2008, 11:37 AM
  2. Question about player name.
    By Deep in forum WoW Scams Help
    Replies: 14
    Last Post: 07-05-2008, 01:21 AM
  3. [Question] Mount/player looks
    By ichiigo in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 07-04-2008, 05:09 AM
  4. [Question]Disconnect Players[Tested] Doesnt Work
    By Juicyz in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 03-29-2008, 06:33 PM
  5. [Question] Make players spawn with an item in thier bag
    By foamysquirl in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 03-01-2008, 05:35 PM
All times are GMT -5. The time now is 04:40 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search