Gw2 Location Tracker

Gw2 Location Tracker

in API Development

Posted by: Heimdall.4510

Heimdall.4510

Hey guys I’ve developed a little tool to collect some positional data from the game in cooperation with smiley.1438. Some parts of it are based on my Gw2ApiCpp-Project. To download the required files or to checkout the source click here. The collected data can be send to a server specified in the app (using the JSON-format). The first server which uses data collected by my program is smiley’s gw2location-service.
To send data to his server use this link: http://gw2.chillerlan.net/examples/gw2location-receiver.php
Please note that the program is in the beta state and some errors may occur.

Have Fun – Heimdall

~ Heimdall
Die Vollenstrecker [VS] – Elona Reach [DE]
https://gw2apicpp.codeplex.com – Gw2API C/C++ Project

(edited by Heimdall.4510)

Gw2 Location Tracker

in API Development

Posted by: smiley.1438

smiley.1438

I’ve just updated my GitHub repo with the relevant backend files:

the map:
https://github.com/codemasher/gw2api-tools/blob/master/examples/gw2location.html
https://github.com/codemasher/gw2api-tools/blob/master/js/gw2maps-gmaps.js

the receiver and ajax-backend, which stores the incoming data from GW2 and sends the positions to the map:
https://github.com/codemasher/gw2api-tools/blob/master/examples/gw2location.php

€:

I’ve written a readme and created an installer:
http://gw2.chillerlan.net/files/GW2LocationSender-setup.exe
http://gw2.chillerlan.net/gw2location/readme.html

€€:

The main goal of this tool is to provide guilds and/or large groups of players some overview, especially in WvW (WHY groups of only 5 in WvW, Anet?). A group may share the so called “channel key” to verify their members – noone else will see their position. When you check “tracking” the app will stop sending continous data and sends only if the movement was beyond the specified value (which is ingame units). This is especially useful for track recording e.g. for wiki use like this: http://wiki-de.guildwars2.com/wiki/GW2Wiki:Projekte/Interaktive_Karten/Bücherwurm_Bwikki (i’ve not yet implemented the track recording, but will do in the next days).

I recommend Overwolf, so that you can browse the map ingame: http://www.overwolf.com/

€€€:

Support IRC: #Gw2Maps or #chillerlan or #gww on irc.eu.gamesurge.net

(edited by smiley.1438)

Gw2 Location Tracker

in API Development

Posted by: Like Forty Seven Ninjas.6982

Like Forty Seven Ninjas.6982

First off, good freakin job so far. This is a helluva tool.

I’ve been playing around with it for a bit by going to the location service through the OP’s link. I noticed that it seems to not show people when the key phrase is changed and then changed back to the original phrase. Once the key phrase is changed back to the original, only the first, or red arrow shows up. It does, however, work perfectly if the page is simply reloaded.

A thought, would it be possible to make the arrows into little dots similar to the ones we currently see on the mini-maps. i think arrows take up a bit too much space. I’m assuming they’re included to see the direction the person is facing?

DH Yak’s Bend – Perfect Dark [PD]
Dr Hoppenheimer – Engi / Meowzir – Guard /
Mulcibur Nox – Ele / Mr Directed – Mes

Gw2 Location Tracker

in API Development

Posted by: smiley.1438

smiley.1438

Hey, thanks for your feedback!

I noticed that it seems to not show people when the key phrase is changed and then changed back to the original phrase.

Thanks for that hint, i believe we haven’t tried this yet, since we used the “hardcoded” key for testing all day. When you watch the console output, you’ll see that you receive the data for all markers. I’ll look into this and fix it. (btw. the marker color reflects the online state)

A thought, would it be possible to make the arrows into little dots similar to the ones we currently see on the mini-maps. i think arrows take up a bit too much space. I’m assuming they’re included to see the direction the person is facing?

It’d be easily possible to change the marker style since it’s just a little SVG path. I’ve already tried small dots (12px diameter) but i found that they were hard to see and – like you already mentioned – they would not show the player’s direction, which i find is essential in WvW. I can make this optional.

(edited by smiley.1438)

Gw2 Location Tracker

in API Development

Posted by: AdelphiA.9287

AdelphiA.9287

Hi Smiley

I’ve taken a look at your code and have converted it to PHP5.3 (as I can’t upgrade to 5.4 as it’s not part of the “firmware” for my Synology NAS).

Anyway, I just wanted to let you know that there is a small bug in your SQL creation scripts, namely the player_position one. It doesn’t create the “profession” column. Took me ages to figure out why I couldn’t get GW2Maps to work!

Also, is there an updated version of gw2location.html file as I don’t appear to be able to get mine working. No-one appears on the screen and no players are listed (yes, I have set the key and also changed the domain in GW2Maps).

Would you mind if I included your scripts on my site (modified to my needs) for my tool (gw2EventOly) as currently the code I am using is very buggy. Obviously I would credit you.

AdelphiA.9287 – The Enigma Guild

(edited by AdelphiA.9287)

Gw2 Location Tracker

in API Development

Posted by: AdelphiA.9287

AdelphiA.9287

OK. I’ve found out why they aren’t working. Lots of files need to be converted and I also need to convert German→English.

AdelphiA.9287 – The Enigma Guild

Gw2 Location Tracker

in API Development

Posted by: smiley.1438

smiley.1438

I’ve just pushed a kittenload of updates and fixes to my repo and also changed the german to english for now (until i’ve finished the i18n) – you might try it with the updated files now (why not just create a fork?).
As stated in the WTFPL you may just do WTF you want to with the code, but i’m also happy for a credit any time

The location sender by Heimdall.4510 was also updated, but i don’t know if he already made the latest version available – also, i’ve created an installer for it because some people had trouble to install it^^

(edited by smiley.1438)

Gw2 Location Tracker

in API Development

Posted by: Heimdall.4510

Heimdall.4510

Well I haven’t updated the locator yet because I want to add some special feature to it. But rest assured that the next verison will get pretty cool

~ Heimdall
Die Vollenstrecker [VS] – Elona Reach [DE]
https://gw2apicpp.codeplex.com – Gw2API C/C++ Project

Gw2 Location Tracker

in API Development

Posted by: AdelphiA.9287

AdelphiA.9287

Thanks guys for this. I’m not sure what “forking” means. I’ve seen it but I don’t understand it. I’ve only just started to use the likes of CodePlex and GitHub so I’m still new to it all. Does Gw2Maps have a CLI mode (like -p whatever_port -k whatever_key -s whatever_server -start) as I’d like to be able to call it from within my application once it’s configured. Also, as I know we shouldn’t be talking “shop” about this here, is there anywhere there is a topic/forum for discussion?

AdelphiA.9287 – The Enigma Guild

Gw2 Location Tracker

in API Development

Posted by: smiley.1438

smiley.1438

fork → https://help.github.com/articles/fork-a-repo

There’s no CLI mode yet – we’ve talked about that earlier in the development process (the idea was to make it CLI only) but dropped it because there’s a lot of people in the target audience who hardly know to use a command line and are happy with a GUI.

You may use this thread for further discussion: https://forum-en.gw2archive.eu/forum/community/api/Gw2-Location-Tracker/first#post2379754

(can a moderator please merge the above posts starting from https://forum-en.gw2archive.eu/forum/community/api/Possible-map-floor-API-bug/2449660 ?)

Gw2 Location Tracker

in API Development

Posted by: AdelphiA.9287

AdelphiA.9287

Glad I found this (in a round about way). There’s a couple of features you may wish to add (if they aren’t already there). For instance, if the marker is YOU put a circle round it or make it different to the others. Also, as you know, I’m trying to merge this into my project (gw2EventOly) which I hope to fork into yours sometime soon (once I figure out what to do) and it would be nice to implement a CLI mode for those of us who know what to do with it for , but carry on using the GUI mode as the default. It should be simple enough to do (I think). I can help out if needs be, I’m just installing the Qt Framework onto my system and (if I can get it to download) the VS libraries too – they keep failing!

AdelphiA.9287 – The Enigma Guild

Gw2 Location Tracker

in API Development

Posted by: Heimdall.4510

Heimdall.4510

@AdelphiA
Well there was a console mode once…
I removed it because Smiley thought this could be a bit confusing to people who aren’t familiar with it (specify port, ip, http-header needed? etc.). But it isn’t hard to support the console again.

~ Heimdall
Die Vollenstrecker [VS] – Elona Reach [DE]
https://gw2apicpp.codeplex.com – Gw2API C/C++ Project

Gw2 Location Tracker

in API Development

Posted by: AdelphiA.9287

AdelphiA.9287

If that could be added back in that would be great. I personally need key, server and auto-start or some other start option; port is not necessary given that the receiver is server/domain based. It doesn’t need to be advertised, just available for those of us that want to use it. One other thing, is it possible to statically link / reference the DLLs just so there only needs to be one file rather than the executable and all the DLLs? FYI, I have started to host my own location server too at http://www.enigma-eu.co.uk/events/gw2api/gw2location/

If you want to run this from a browser you need to use http://www.enigma-eu.co.uk/events/gw2api/gw2location/gw2location.php?k=YOUR_KEY

AdelphiA.9287 – The Enigma Guild

(edited by AdelphiA.9287)

Gw2 Location Tracker

in API Development

Posted by: smiley.1438

smiley.1438

We’ve also talked about statically linking the libraries but found it was easier without for updates during the development process (the program itself is ~130kB while the required libs are ~40MB). Maybe we’ll release a version with statically linked libs once we’re done.

Gw2 Location Tracker

in API Development

Posted by: AdelphiA.9287

AdelphiA.9287

OK, no worries. That’s what I do currently with my stuff. Same minds…

What is the “track” option for? I don’t seem to be able to get it to do anything. I was hoping it was to make the map follow your character.

I’ve got it all working now with my program; just need to wait for the CLI option on GW2Maps so I can auto-start it. I also forgot to request a “hide window” option too.

AdelphiA.9287 – The Enigma Guild

Gw2 Location Tracker

in API Development

Posted by: smiley.1438

smiley.1438

I’ve explained the tracking option above, see: https://forum-en.gw2archive.eu/forum/community/api/Gw2-Location-Tracker/2380078

The CLI is also implemented now, still it needs some fine tunig i believe

Gw2 Location Tracker

in API Development

Posted by: Lulan.8497

Lulan.8497

nice work!
how about a restful api to allow other programmers to provide clients/viewer?

Gw2 Location Tracker

in API Development

Posted by: Heimdall.4510

Heimdall.4510

I’ve just updated the location-sender (Gw2Maps) for cli-mode and uploaded it into my repo. If you want to have a try use -h to display the info.

~ Heimdall
Die Vollenstrecker [VS] – Elona Reach [DE]
https://gw2apicpp.codeplex.com – Gw2API C/C++ Project

Gw2 Location Tracker

in API Development

Posted by: AdelphiA.9287

AdelphiA.9287

Thx guys. Going to go grab it now…

Seems to be working OK, Going to test it fully after I’ve added a few more “options” (for the server etc.) into my program.

Any chance the CLI can pickup the settings saved when using the GUI mode so if you issue say a simple “gwmaps.exe -start” it loads the saved data and starts? I know I’m asking a lot…

AdelphiA.9287 – The Enigma Guild

(edited by AdelphiA.9287)

Gw2 Location Tracker

in API Development

Posted by: smiley.1438

smiley.1438

nice work!
how about a restful api to allow other programmers to provide clients/viewer?

Thanks

I didn’t plan to implement a REST API yet, since i’ve only provided an example backend (or: reference implementation). It’s completely up to the one who writes the backend for the location sender how he would use the collected data (and also which language and data storage – i’ve provided a php/mysql example because thats what i know best ;D).

(edited by smiley.1438)

Gw2 Location Tracker

in API Development

Posted by: AdelphiA.9287

AdelphiA.9287

Sorry to ask yet another question – but where is guildPtr defined (referenced in Console.h)?

AdelphiA.9287 – The Enigma Guild

Gw2 Location Tracker

in API Development

Posted by: Heimdall.4510

Heimdall.4510

guildPtr is defined in the GW2API C/C++ Project in the api_cstructs.h file (C Part of my Library)

~ Heimdall
Die Vollenstrecker [VS] – Elona Reach [DE]
https://gw2apicpp.codeplex.com – Gw2API C/C++ Project

Gw2 Location Tracker

in API Development

Posted by: AdelphiA.9287

AdelphiA.9287

OK. When I try to compile (using VS2012) I’m getting an error stating guildPtr is undefined. Any ideas what I’m doing wrong? I’m simply loading Gw2Maps.vcxproj into VS2012 and compiling. I have made sure the correct path for the includes has been set.

AdelphiA.9287 – The Enigma Guild

Gw2 Location Tracker

in API Development

Posted by: Heimdall.4510

Heimdall.4510

As I mentioned in my previous post guildPtr is defined in my GW2API C/C++ Project as
typedef struct guild *guildPtr;
So if you want to compile the Project by yourself make sure you link against the GW2API-Lib, too.

~ Heimdall
Die Vollenstrecker [VS] – Elona Reach [DE]
https://gw2apicpp.codeplex.com – Gw2API C/C++ Project

Gw2 Location Tracker

in API Development

Posted by: AdelphiA.9287

AdelphiA.9287

I think I may have the wrong version of the file then. The only typedefs I have in api_cstructs.h is…


typedef struct json *jPtr;
typedef struct event *eventPtr;
typedef struct map *mapPtr;
typedef struct world *worldPtr;

Have you made a change and not uploaded it? I have using 28412.

AdelphiA.9287 – The Enigma Guild

Gw2 Location Tracker

in API Development

Posted by: AdelphiA.9287

AdelphiA.9287

Hmmm – wouldn’t have anything to do with…

Guilds -missing

would it? Cause everything related to guilds (when I try to build) appears to be broken.

AdelphiA.9287 – The Enigma Guild

Gw2 Location Tracker

in API Development

Posted by: Heimdall.4510

Heimdall.4510

Yep I’ve forgotten to update the library with the guild part – sry my fault. It should now include all necessary data.

~ Heimdall
Die Vollenstrecker [VS] – Elona Reach [DE]
https://gw2apicpp.codeplex.com – Gw2API C/C++ Project

Gw2 Location Tracker

in API Development

Posted by: AdelphiA.9287

AdelphiA.9287

Cheers. I’ll go grab it

AdelphiA.9287 – The Enigma Guild

Gw2 Location Tracker

in API Development

Posted by: AdelphiA.9287

AdelphiA.9287

OK, still won’t compile. It now says it can’t open Gw2Maps.rc is missing.

AdelphiA.9287 – The Enigma Guild

Gw2 Location Tracker

in API Development

Posted by: AdelphiA.9287

AdelphiA.9287

Just had a report by a friend who’s tried to use Gw2Maps.exe but it just crashes with Event ID 101 when he clicks “Start”. He is running on Windows 7 x64 (same as me). Are there any other dependencies (apart from the 10 DLL files and platforms folder) required?

AdelphiA.9287 – The Enigma Guild

Gw2 Location Tracker

in API Development

Posted by: smiley.1438

smiley.1438

I’m running also Win7 x64 and the program works just fine. However, i’ve experienced a crash with earlier versions when the storage folder wasn’t writable with user rights (like program files). This should be fixed now that the program uses \AppData\Roaming in the user folder for storage. If this still doesn’t help, try running the tool in admin mode if possible.

Gw2 Location Tracker

in API Development

Posted by: Heimdall.4510

Heimdall.4510

nope it’s just these dlls
the error you get could possibly result by starting the application as 64bit (it’s 32 bit/x86 only atm, we’re testing x64). If you compiled the source code make sure to set the compiler to x86 and add the x86(not the x64) dlls to your dir.

~ Heimdall
Die Vollenstrecker [VS] – Elona Reach [DE]
https://gw2apicpp.codeplex.com – Gw2API C/C++ Project

Gw2 Location Tracker

in API Development

Posted by: AdelphiA.9287

AdelphiA.9287

I did get him to try running as administrator but to no avail. The folder gw2maps has been created in his appdata folder but the folder is empty. The 2 files it’s supposed to create (well, one if you don’t add character names) aren’t created. I’ll talk further with him tomorrow. Does it possibly make a difference if you don’t add character names??

AdelphiA.9287 – The Enigma Guild

Gw2 Location Tracker

in API Development

Posted by: smiley.1438

smiley.1438

Theres no need to add character names – this is just optional to assign the profession to the character name received from the mumble link data. Did you try the tool downloaded from Heimdall’s repo or with the version you compiled yourself?

Gw2 Location Tracker

in API Development

Posted by: Heimdall.4510

Heimdall.4510

I’ve just created an IRC channel (#Gw2Maps) on irc.eu.gamesurge.net
I should be there more or less the whole day so if you have any questions feel free to post them here or ask me in the chat for live-support.

~ Heimdall
Die Vollenstrecker [VS] – Elona Reach [DE]
https://gw2apicpp.codeplex.com – Gw2API C/C++ Project

Gw2 Location Tracker

in API Development

Posted by: AdelphiA.9287

AdelphiA.9287

The one I used was Heimdall’s – the same version I’m using. Going to set up mIRC…

AdelphiA.9287 – The Enigma Guild

Gw2 Location Tracker

in API Development

Posted by: smiley.1438

smiley.1438

Gw2 Location Tracker

in API Development

Posted by: Bear on the job.6273

Bear on the job.6273

I’m working on an app that uses a similar design (local application reporting player positions to web server, and plotting them on web-based map), and I was wondering if you have seen any issues running this with a large number of players.

My app is specifically for WvW, plotting the position of all players from the same shard running the client. It also allows players to drop public waypoints on the map, with the local app projecting visual markers onto the player screen. I’m wondering if the webserver is going to be a bottleneck for 100’s or 1000’s of players, or if I should be developing native code to run on a server somewhere.

Gw2 Location Tracker

in API Development

Posted by: smiley.1438

smiley.1438

Unfortunately, we were not yet able to test it with that large numbers of players, but from what i can tell, it’ll be like this:

  • The receiver/server should not get in trouble as long as you don’t host it on your private pc (my webspace is hosted in a datacenter with at least a 1Gbit connection)
  • The data being sent to a client to draw the players on the map will of course increase with every marker to be drawn. It’s ~260 uncompressed bytes per player in my example, which can be shrinked down to ~190 when you use single letters as JSON identifiers and store world/map names in a JSON and assign them on the client side – so a client would receive ~20kB of data for 100 players. It would be an idea to dynamically increase the map update interval with increasing player numbers if you get in trouble there.
  • From my experience, Google Maps as well as leaflet will slow down at > 250 markers or so shown on the map (depends on client hardware). If you plan to show also the POIs from map_floor.json, you should not draw them but leave it up to the client to show/hide them. (check this demo for performance)
  • Last but not least, a marker clusterer would be an idea so that you’ll show only a limited number of markers at once.

(edited by smiley.1438)

Gw2 Location Tracker

in API Development

Posted by: Bear on the job.6273

Bear on the job.6273

Thanks for your input. I hadn’t thought about dynamically adjusting the update interval based on on-screen player count, good idea. I’m using leaflet for the mapping API, and one of the marker cluster modules to relieve some of the client slowdown that might happen. The only POI information on the map are camps/towers/keeps, so that part is relatively low.

My hosting service sounds comparable to yours, I was just concerned that I would have to find a place to host a custom C/C++ app and run it through CGI or something. Most web services frown on constantly running apps though, so I’m hoping to keep it entirely in the PHP/SQL space. Once I get it complete, I’m going to run some stress tests with a ~100 dummy clients to see what the load looks like. I will post results here when I do.

Gw2 Location Tracker

in API Development

Posted by: quenoz.3859

quenoz.3859

another thing to think about is that the maps are limited to some amount of players (it was 80, but now it seems to be a bit over 100 ? and if they actually have the limit of 500 per map youd be at 166 for each team) so you wont run into a problem if you only work with one single map (as you mentioned) if leaflet starts slowing at around 250 (cause honestly who uses 100 custom markers? )

The Unlikely Plan [TUP] Raid Leader

Gw2 Location Tracker

in API Development

Posted by: Heimdall.4510

Heimdall.4510

We’re again up on IRC at
irc.eu.gamesurge.net
#Gw2Maps
Since the channel now is permanently it’s not only meant for our app but for API discussion in general.
We would be pleased if anyone wants to join for a talk

~ Heimdall
Die Vollenstrecker [VS] – Elona Reach [DE]
https://gw2apicpp.codeplex.com – Gw2API C/C++ Project

Gw2 Location Tracker

in API Development

Posted by: AdelphiA.9287

AdelphiA.9287

Hmmm. OK, not sure what’s going on here. Your location receiver no longer works. In Gw2Maps output I see the actual source of the page, rather than the information about the character. I need to check your updated code as mine is giving memory leaks and I need to find out which part is causing it; changes I’ve made or something in the original JSON/JavaScript/PHP.

Also, it appears no one is using IRC. I’ve been on two days without sight or sound of anyone. Are you not using this anymore?

AdelphiA.9287 – The Enigma Guild

Gw2 Location Tracker

in API Development

Posted by: Heimdall.4510

Heimdall.4510

We’re still using IRC I just had 2 hard days and didn’t manage to join

~ Heimdall
Die Vollenstrecker [VS] – Elona Reach [DE]
https://gw2apicpp.codeplex.com – Gw2API C/C++ Project

Gw2 Location Tracker

in API Development

Posted by: AdelphiA.9287

AdelphiA.9287

Any news on why receiver isn’t working?

AdelphiA.9287 – The Enigma Guild

Gw2 Location Tracker

in API Development

Posted by: smiley.1438

smiley.1438

The receiver over http://gw2.chillerlan.net/examples/gw2location-receiver.php works flawless (plus it seems you have never connected to this one), so if you’re using the script on your own server with code changed etc. i’ll need to see your code to tell if somethings wrong with it.

Gw2 Location Tracker

in API Development

Posted by: AdelphiA.9287

AdelphiA.9287

OK, I have the receiver working but which URL am I supposed to use to see me on the map? Currently I’m using http://gw2.chillerlan.net/examples/gw2location.html but I don’t see anyone when using my key.

AdelphiA.9287 – The Enigma Guild

Gw2 Location Tracker

in API Development

Posted by: smiley.1438

smiley.1438

You won’t see anyone else if you’re the only one with that key.

The channel key is a secret phrase which is shared between the members of a group to identify their members. You’ll need to enter this key also on the website which shows the map in order to see that group.

Gw2 Location Tracker

in API Development

Posted by: AdelphiA.9287

AdelphiA.9287

I can’t even see myself.

AdelphiA.9287 – The Enigma Guild

Gw2 Location Tracker

in API Development

Posted by: Xekanirelle.9451

Xekanirelle.9451

Hey Smiley, Wanted to let you know I tested this earlier today, and I could see myself on the location receiver.
Good job with it all!

If I understood it correctly, everyone in the guild will need this app, (or mumble?) and use same “key”, to be able to show up the locations on the receiver?

Keep up the good work!