Visualizing attack data (JSON)
intellix
Join Date: 2008-03-24 Member: 63950Members
Hey, had a little bit of a play with the JSON that was provided through twitter and this is what I've pretty much made as of now:
<a href="http://www.konoro.org/ns2/" target="_blank">http://www.konoro.org/ns2/</a>
Not quite sure how you want the data presented but this is what I've got at the moment. Can do a lot more in more time (Can imagine you want summary charts, pies and what not)
At the moment the the JSON data is what I extracted from the file and stored locally as I think there are security issues with JSON that require JSONP to access remotely... Tell me if I'm wrong.
In order for me to extract the data from the actual NS2 server the JSON response has to be wrapped in a function that I specify, like so:
<?php echo $_GET['jquerycallback'] . '(' + jsonData + ')' ?>
<a href="http://api.jquery.com/jQuery.getJSON/" target="_blank">http://api.jquery.com/jQuery.getJSON/</a>
Created using jQuery, head.js, PHP.js
<a href="http://www.konoro.org/ns2/" target="_blank">http://www.konoro.org/ns2/</a>
Not quite sure how you want the data presented but this is what I've got at the moment. Can do a lot more in more time (Can imagine you want summary charts, pies and what not)
At the moment the the JSON data is what I extracted from the file and stored locally as I think there are security issues with JSON that require JSONP to access remotely... Tell me if I'm wrong.
In order for me to extract the data from the actual NS2 server the JSON response has to be wrapped in a function that I specify, like so:
<?php echo $_GET['jquerycallback'] . '(' + jsonData + ')' ?>
<a href="http://api.jquery.com/jQuery.getJSON/" target="_blank">http://api.jquery.com/jQuery.getJSON/</a>
Created using jQuery, head.js, PHP.js
Comments
The time in second the guy was alive before the kill ?
And it should be nice if in that JSON we could have the time spent on the round, to make some cool graphs :)
Might do some processing.js effects on this data later when I have some spare time.
<a href="http://www.konoro.org/ns2/" target="_blank">http://www.konoro.org/ns2/</a><!--QuoteEnd--></div><!--QuoteEEnd-->
Interesting first stab.
I am more interested in the weapon usage.
for instance I use Chrome for a browser.
When I use the Page Find functionality It shows yellow bars in the scrollbar where that term is found.
If you have chrome try the following:
Rifle
Shotgun
Sentry
Hydra
I see that Rifle usage is low .... Shotgun usage is high.
Sentries are everywhere.
Hydras are more an annoyance than being deadly. (they mostly justt get killed)
The time in second the guy was alive before the kill ?
And it should be nice if in that JSON we could have the time spent on the round, to make some cool graphs :)<!--QuoteEnd--></div><!--QuoteEEnd-->
Yeah, it is the amount of time in seconds the target was alive before getting killed.
The round times are stored in the end game stats (although access to that data needs to be improved).
I am new to all this web stuff like JSON but I'll refine the access over time to best suit everyone. It is a delicate balance with this much data since we are using Google App Engine and would rather not spend a lot of money on kill stats ;)
Oh, that reminds me. There is a 10 min delay on these stats so I could take advantage of App Engine's memcache so every request didn't hit the datastore. Also, I can eventually make it so all the stats are available (instead of the last 500 events per map, per version) with "pages" of data (1000 datastore entity limit per query on App Engine).
I'll monitor this thread so just post if you have any questions!
It would be quite easy to make a PHP script or something that downloads the data once every x hours, but just once, and stores it in the local database. If some community members then use this script and make public their server URLs where we can find the data, it will spread the load across multiple community-provided servers, only requiring 1 access every x hours (if 1 community server does this, the other servers can just update from that first one instead of from the google appengine).
To make this user friendly, you could make sure your JSON url redirects to 1 of the known community servers randomly (even with checking of which servers are up etc.) so everyone can just keep using this single URL. You can then later use this kind of system for other kinds of data distribution as well.
Maybe it's overkill, but it's quite easy to set something like this up (I could help if you want) and I'm sure there would be some community support, as it wouldn't cost that much traffic for the caching webservers either.
@OP: looks nice, but maybe you can make it so that there are kind of categories or at least pages instead of everything on 1 very long page? Keep up the good work!
I am going to wait and see if we are hitting any limits over the week 180 goes out before making any decisions like this. Thanks for the ideas though!
Attacker weapon type counts
<a href="http://imgur.com/b2WCo" target="_blank"><img src="http://i.imgur.com/b2WCo.jpg" border="0" class="linked-image" /></a>
Lifetimes
<a href="http://imgur.com/JrOtA" target="_blank"><img src="http://i.imgur.com/JrOtA.jpg" border="0" class="linked-image" /></a>
Why would you make any conclusions based on statistic sample of size 20? It's also all on summit.
I'ts a table that loads the data (now from a static file, loading the page with JSONP gives me an error) and lets you read it in an easier way.
Also you can filter it by any field. The filters are dropdown for "fixed" data (I've tried to read all the data to make the selects but fails too xD) and text inputs for fields like coordinates, they found any value that contains what you fill in it.
I Hope it's usefull for something xD
I was sorting by attacker weapon which is pretty interesting.
I only heard of this JSONP thing a couple days ago so I'll try to fix the feeds soon so they work with it. I also want to add "pages" of data or something so all the data is available through multiple queries (1000 entity limit per query for App Engine).
We can filter the data by what the Skulk bite is killing (Marines only) to get a better idea on it's effectiveness.
seems flamethrower loves skulks more than fades and DI
Suicide?
More interesting are the "MAC" kills.
[attachment=35998:death_br...down_ns2.html]
<a href="http://ve.ihopeitworks.com/ns2/summit_heatmap.html" target="_blank">http://ve.ihopeitworks.com/ns2/summit_heatmap.html</a>
I was sorting by attacker weapon which is pretty interesting.
I only heard of this JSONP thing a couple days ago so I'll try to fix the feeds soon so they work with it. I also want to add "pages" of data or something so all the data is available through multiple queries (1000 entity limit per query for App Engine).<!--QuoteEnd--></div><!--QuoteEEnd-->
The error that gaves me Chrome is: "Resource interpreted as Script but transferred with MIME type text/html."
I supose you need to put something like if you use PHP:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->header('Content-type: text/javascript');<!--c2--></div><!--ec2-->
<a href="http://ve.ihopeitworks.com/ns2/summit_heatmap.html" target="_blank">http://ve.ihopeitworks.com/ns2/summit_heatmap.html</a><!--QuoteEnd--></div><!--QuoteEEnd-->
That's very neat.
I want to fix some problems with that version to merge better with the site and I want to add more features to it.
Just add in a callback to the URL and it will do JSONP. I tested locally with JQuery and it all seemed to work as far as I could tell. Pretty neat little hack this JSONP is.
Let me know if there are other things I can do to make dealing with this data easier!