A while back I decided to try World of
Warcraft, but I felt like paying monthly to play a game may suck me in
too deep, to “get my money’s worth”.
I quickly learned of an open source WoW client compatible MMORPG server called MaNGOS, and that the majority of so-called “private” servers run on it.
The particular server I played on featured a
‘players online’ map, where a world map was shown with markers placed
for each player, with a color (red or blue) representing their faction.
Players Online Map
This is awesome! A cool feature that can’t be had by the paying customers of Blizzard.
I viewed the source of the page and saw
that the map was making an AJAX call to another page with _run appended
with some malformed JSON containing all the player data for the map!
Since one of my character’s professions was
Herbalism, I was making use of an addon that placed icons on the
in-game map to mark known herb locations. My initial thought was create
a WoW addon that could place markers on the map using data from the
“Players Online Map” that my server was running.
Unfortunately, Blizzard was smart in
designing their addon system, and provided no way for getting outside
data on the fly. It *was* possible to overwrite files in the addon’s
directory, but the addon would not have access to the updated on-disk
files until it was reloaded, which required a reset of the entire UI.
In short: it wasn’t going to happen this way.
I played around with ideas on how to have a
dummy character in the game that constantly barraged me with player
data in private messages, but ultimately abandoned it.
I then encountered another challenge: to
make this worthwhile, I would have to be able to convert the coordinates
from the server (which were for the world map) down to the individual
“zones” of the WoW universe. How would I go about gathering the
conversions? Certainly visiting every zone in the game and recording my
position was not the right (or remotely easy) approach.
Remembering that WoW addons are written in
LUA and I could view their source, I looked at the code of the
herb-locating addon. It was using a library called Astrolabe
that provided World -> Continent -> Zone coordinate offsets!
With this data, I would be able to precisely locate players in zones by
just receiving their world map position!
I set out to understand how zone and continent coordinates related to world coordinates…
WoW map zone boundaries on whiteboard
…and above shows my Eureka! moment. I was
excited to be working on the map, and could not wait to avoid
unnecessary PvP in Stranglethorn Vale.
For ease of development, I decided to make
little changes to the web map itself, but rather replace the player data
source with a CGI Python script (I just wanted an excuse to try out
My first version was hackish at best, and
looked more like Java in Python clothing (read: disgusting). All that
was left to do was refine the interface, and correct the coordinates by
<10 pixels or so – when the server went down.
It turns out there is a ton of rivalry in
the Private WoW Server Hosting world, since there is apparently a lot of
money to be made selling levels and gear. A rival server had gotten
into our database and well, DROPed it. Of course there was no backup. I
was bummed about losing my level 38 Warrior, but considered it a chance
to try a new class. At least I still had the map to work on.
I was wrong. With the server being down,
the admins decided to overhaul the website while they were at restoring
it, and left out the Players Online Map in the redesign. My motivation
to play again and work on the map died right there.
It wasn’t until writing this project page
about a year later that I revisted, and ultimately decided to rewrite,
the code at the heart of my map hack. It is still not perfect but I
replaced a lot of ugly code with a smaller amount of ugly code. A giant
list of dictionaries containing all the coordinate offset data was
replace by an sqlite database. The malformed JSON is now corrected and
parsed using the json module. The crazy nested loops are now list
comprehensions or lambdas.
I had a lot of fun initially designing and
writing this, and thouroghly enjoyed revisiting it. If you want to, you
can check out the last revision of the map hack here: POMMCheat.
Be warned, it is buggy, and the target private WoW server may no longer
be around. Try clicking a player without unicode characters in their
name (I know, I’m terrible).
If you wish to view the source, check it out on github.
UPDATE: looks like the new version of POMM
is made with Flash, and has all the functionality of my hack! Check out
a running copy on bc.uz.