Showing Posts For The Last Engineer.6492:

Remove icebow from the game

in Elementalist

Posted by: The Last Engineer.6492

The Last Engineer.6492

Event Details API location coordinates

in API Development

Posted by: The Last Engineer.6492

The Last Engineer.6492

Hi all,

- positionPoint is x,y event center location.
- positionToPixelRatio : 1/24

- Mumble : use left handed coordinate system, you have to use the x,z coordinates (not x,y). The x,y,z coords are in meter so you have to convert it to inches knowing that 1 meter = 39.3700787 inches.

According to Cliff :

Some implementation notes:
The coordinate system used by mumble is slightly different than the game. GW2 uses inches (don’t ask), but mumble uses meters. So you’ll need to convert the coordinates back to inches for use with the map API.

The coordinates in inches are : {x*39.3700787, z*39.3700787}. After that, you may apply these expressions below :

(these expressions can be used for mumble and events)

xPixelCoord = ContinentRectangle [ 0 ] [ 0 ] + (positionPoint.X – MapRectangle [ 0 ][ 0 ]) * poistionToPixelRatio

yPixelCoord = ContinentRectangle[ 0 ] [ 1 ] + (MapRectangle [ 1 ] [ 1 ] – positionPoint.Y) * poistionToPixelRatio

LatLng = FromPixelToCoordinate(xPixelCoord , yPixelCoord, maxZoomLevel)

If you need the current map zoom. You have to apply a projection.
You need the continent’s MaxZoom level and you can compute the projection like this :
- DeltaZoom : Continent’s max zoom level – current map Zoom.
- Projection : 2^(DeltaZoom).
- XPixelCoord = XPixelCoord / Projection, YPixelCoord = YPixelCoord / Projection

(edited by The Last Engineer.6492)

Event Details API location coordinates

in API Development

Posted by: The Last Engineer.6492

The Last Engineer.6492

the pixel globe size is provided by the Gw2 API.
That’s the texture_dims defined in v1/map_floor.json?continent_id=1&floor=1


"texture_dims": [32768, 32768]

you are able to compute it by doing that :


pixelTileSize = 256
pixelGlobeSize = pixelTileSize * (2 ^ 7) = 32768 (7 is the max zoom level).
PixelGlobeCenter = [16384, 16384]  ( [32768/2, 32768/2] )

For the location :

 "coord":[19765.9,16239.2] 

you can do this as below :


longitude = (coord[0] - 16384) / (32768 / 360);
latitude = (2 * arctan(  e^( (coord[1] - 16384) / -(32768 / (2 * PI))))- PI / 2) * (180/PI);

Details :


coord[x, y] is the item location.

degreesToRadiansRatio = 180/PI
pixelTileSize = 256
pixelGlobeSize = pixelTileSize * 2^maxZoomLevel
XPixelsToDegreesRatio = pixelGlobeSize / 360
YPixelsToRadiansRatio = pixelGlobeSize / (2 * PI)
pixelGlobeCenter = [pixelGlobeSize /2, pixelGlobeSize /2]

xDiff = coord[0] - pixelGlobeCenter[0]
yDiff = coord[1] - pixelGlobeCenter[1]

longitude = xDiff / XPixelsToDegreesRatio
latitude = (2 * arctan(e^(yDiff  / -YPixelsToRadiansRatio)) - PI / 2) * degreesToRadiansRatio

(edited by The Last Engineer.6492)

Event Details API location coordinates

in API Development

Posted by: The Last Engineer.6492

The Last Engineer.6492

This is a short sample to convert Pixel To coordinates :


public class APIProjection
    {
        private readonly double PixelTileSize = 256d;
        private readonly double DegreesToRadiansRatio = 180d / Math.PI;
        private readonly Point PixelGlobeCenter;
        private readonly double XPixelsToDegreesRatio;
        private readonly double YPixelsToRadiansRatio;

        public APIProjection(double zoomLevel)
        {
            var pixelGlobeSize = this.PixelTileSize * Math.Pow(2d, zoomLevel);
            this.XPixelsToDegreesRatio = pixelGlobeSize / 360d;
            this.YPixelsToRadiansRatio = pixelGlobeSize / (2d * Math.PI);
            var halfPixelGlobeSize = Convert.ToSingle(pixelGlobeSize / 2d);
            this.PixelGlobeCenter = new Point(
                halfPixelGlobeSize, halfPixelGlobeSize);
        }

        public Location FromPixelToCoordinates(Point pixel)
        {
            var longitude = (pixel.X - this.PixelGlobeCenter.X) /
                this.XPixelsToDegreesRatio;
            var latitude = (2 * Math.Atan(Math.Exp(
                (pixel.Y - this.PixelGlobeCenter.Y) / -this.YPixelsToRadiansRatio))
                - Math.PI / 2) * DegreesToRadiansRatio;
            return new Location(
                Convert.ToSingle(latitude),
                Convert.ToSingle(longitude));
        }
    }

Event Details API location coordinates

in API Development

Posted by: The Last Engineer.6492

The Last Engineer.6492

Event info :
“location”: “type” : “poly”, " center " : [ xxx , xxx , xxx ] …

Map info :
“map_rect”: [ [ xxx, xxx ], [ xxx, xxx ] ] …
“continent_rect”:[ [ xxx,xxx ],[ xxx , xxx ] ] …

Map Event location :

event_center_x = location.center [ 0 ] ;
event_center_y = location.center [ 1 ] ;

percentageX = (event_center_x – map_rect [ 0 ] [ 0 ] ) / (map_rect [ 1 ] [ 0 ] – map_rect [ 0 ] [ 0 ] );
percentageY = 1-(event_center_y – map_rect [ 0 ] [ 1 ] ) / (map_rect [ 1 ] [ 1 ] – map_rect [ 0 ] [ 1 ] );

continentX = (continent_rect [ 0 ] [ 0 ] + (continent_rect [ 1 ] [ 0 ] – continent_rect [ 0 ] [ 0 ] ) * percentageX);
continentY = (continent_rect [ 0 ] [ 1 ] + (continent_rect [ 1 ] [ 1 ] – continent_rect [ 0 ] [ 1 ] ) * percentageY);

// the coords for the event
event_coords = FromPixelToCoords([continentX, continentY], map.GetMaxZoom()); // map.GetMaxZoom() is set to 7 for Gw2 Map

(edited by The Last Engineer.6492)

Overlay software

in Account & Technical Support

Posted by: The Last Engineer.6492

The Last Engineer.6492

This is an issue that is of great importance, I would like to know if exist one or several software(s) from this list, which can result in a ban account (note: I’m not condoning third-party software) :

  • Team Speak Overlay : Small software that is grafted to TeamSpeak 2 to see game overlay nickname of the speaker.
  • TINT : Same as Team Speak Overlay, but for Teamspeak 3.
  • overwolf : same as TINT.