Wednesday 20 March 2013

Edgeworld API

Edgeworld is multi-player on-line game that was originally played through Facebook and Google+.  It has since found a home on the developers website Kabam.com and is now played through a variety of platforms. One of the frustrations of the game is that they make it difficult to track your own progress or the progress of your alliance.  They have implemented a few alliance tracking tools but have since removed them from the game. I have been working to try and figure out the Edgeworld API so that I can download and store alliance data so that I can track my players level of activity.

I am a self taught techie so I may not have all the correct terms for the things that I have learned.  I would appreciate constructive criticism of what I am doing so that we can learn together.  Edgeworld doesn't publish an API but I am trying to figure out ways around it.  I will share the things that I have learned here.

Step1:

How can I get the data out of the game?

Edgeworld similar to many web based applications uses JSON formatted data. Below is a small example of this data.


You can get this data by examining how your browser makes requests.  Each browser does this a little bit different so I will try to explain how it works with each major browser. In all cases load up Edgeworld to the main base screen.

Google Chrome

Click on the 3 line icon on the far right side of the top of the screen and then select Tools > Developer Tools ( or use the F12 key).  This will open a new window, ensure "Network" is selected.  Now go back to your base in Edgeworld and select the Alliance button.  This sends a request to the server to get all the Alliance information.  Watch what happens in the Developer Tools window. You will see all the page requests that the browser is making.  Find the one that starts with a number and looks something like this "#####?%5Fsession%5fID=###" and click on that request. It should open up to show the details.  What you want to do at this stage is to copy the entire page request and then paste it into another tab in your browser.  The full page request URL should look something like this:

The pound signs will be numbers that correspond to your alliance ID and you userID. If you paste this into another browser window you should get something similar to the JSON code that I posted above.

FireFox

For Firefox I have downloaded the Firebug plugin which I would strongly recommend for anyone who is interested in this work. If you have the Firebug plugin installed then you can just press F12 to launch it. Select and enable the "Net" tab. Now go back to your base in Edgeworld and select the Alliance button.  This sends a request to the server to get all the Alliance information.  Watch what happens in the Firebug window. You will see all the page requests that the browser is making. Find the one that starts with a number and looks something like this "GET #####?%5Fsession%5fID=###" and right-click on that request and select."copy location".  Paste the location into another browser tab and you will see the JSON code similar to what is posted above.

Internet Explorer

Click on the Tools gear icon and select Developer Tools select "Network".  Click the Start Capturing button and then go back to your base in Edgeworld and select the Alliance button.  This sends a request to the server to get all the Alliance information.  Watch what happens in the Developer Tools window. You will see all the page requests that the browser is making. Find the one that starts with a number and looks something like this "GET #####?%5Fsession%5fID=###" and right-click on that request and select."copy location".  Paste the location into another browser tab and you will see the JSON code similar to what is posted above.


Depending on how the browser is set up it may display the JSON file or it might prompt you to download the text file.  Either way you will have learned how to download the data out of Edgeworld.

In my next post I will show you how to use C# to make the page request and save the data to your computer.  That will build us up to what can we do with this data now that we have it.

Thanks for reading.  I have also demonstrated these ideas in the video below.  Please leave comments tell me what you are interested in.



No comments:

Post a Comment