One of the nice feature of MaNGOS is that it maintains a large database filled with data that can be used in various ways. This project extracts each online player's position in-game, plots the positions on a PNG map and then displays the resulting image. This only works because apparently, the world of Azeroth is flat.
The following map of Azeroth is generated by plotting two online players - one Alliance mage (blue border) and one Horde shaman (red border). The scripts generate this map dynamically such that you can track players moving on the map in real-time.
The project currently requires the following:
aptitude install php5-gd
)
On each PlayerSave.Interval
(mangosd.conf
) cycle, MaNGOS stores the position of every character in the characters
database in columns:
position_x
position_y
position_z
map
The position_x
, position_y
coordinates are relative to the map
(either Kalimdor or Eastern Kingdoms) that the player is currently on - this means that they are not global to the entire world.
As such, the image that will be used to plot the players on has to be calibrated in order to establish a relation between the in-game coordinates and the pixel coordinates of the image. We will need the following for both maps - Kalimdor and Eastern Kingdoms:
One way to perform this calibration is to:
.modify aspeed 10
) to the top-left most corner you can get to - including swimming all the way till you can swim no more.gps
command and record X
and Y
X
and Y
coordinates of the pixel corresponding to your position
You will thus have a correspondence between extreme in-game GPS locations and pixel positions. For instance, the illustration shows various in-world locations extracted with the .gps
command and then the corresponding X
and Y
GPS extremes determined by overlaying a rectangular bounding box for both maps - although that many locations are not needed:
Once you have the extreme X
and Y
coordinates (top-left, bottom-right), you would determine the pixel coordinates that are found at those locations (visually). Finally, you will obtain a map calibration that can be entered in the config.php
file of the project (see $CALIBRATED_MAP
variable in config.php
).
The bundle is designed to work with MaNGOS Zero (1.12.1). All the files must be placed following the illustrated directory structure:
+ website root or folder | +---- map.html | +---- map.php | +---- config.php | +---- img + | +---- {1..11}.png (Class icons) | +---- map.png (Map to plot on)
All the images go inside the top-level img/
directory.
Name | Icon | Description |
---|---|---|
1.png | 1.png | Warrior class icon |
2.png | 2.png | Paladin class icon |
3.png | 3.png | Hunter class icon |
4.png | 4.png | Rogue class icon |
5.png | 5.png | Priest class icon |
7.png | 7.png | Shaman class icon |
9.png | 9.png | Warlock class icon |
11.png | 11.png | Druid class icon |
map.png | map.png | Map of Azeroth (already calibrated for MaNGOS Zero) |
The scripts are configured to update the map with new positions every second however, in order for that to be possible, the PlayerSave.Interval
parameter in mangosd.conf
has to be set to one second ():
PlayerSave.Interval = 1000
It is a good idea to make this change anyway because the default five minutes is too large an interval such that players may not be committed to the database in case the server goes down.