Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to translate positions in movement group to Riot API map coordinates? #12

Open
giratikanon opened this issue Sep 27, 2014 · 1 comment

Comments

@giratikanon
Copy link

When I run bin/libOL_test on sample chunks, I see MovementGroups, but the X and Y values go from roughly -3500 to 3500. Example:

MovementGroup: {
    "timestamp": 1342,
    "updates": [{
        "entityId": 1073741854,
        "position": {
            "x": 3541,
            "y": 3524
        },
        "waypoints": [{
            "x": 3460,
            "y": 3275
        }]
    }]
}

This is a range of 7000 in each direction, or half of the X/Y range of about 15000 as defined in the Riot Games API game constants.

I understand that the chunk positions have a 0,0 in the map center, but I don't understand how to translate them to match the Riot Games API positions. Should I basically just multiply by 2 and add 7,000 (or so)?

@sathorn6
Copy link

From the IntWars project:

#define MAP_WIDTH (13982 / 2)
#define MAP_HEIGHT (14446 / 2)
float x = ((request->x) - MAP_WIDTH)/2;
float y = ((request->y) - MAP_HEIGHT)/2;

So basically you are correct. However these values are not exactly the same as on the riot api, and i have no idea where they come from.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants