Play Now Login Create Account
illyriad
  New Posts New Posts RSS Feed - Current Towns Data
  FAQ FAQ  Forum Search   Register Register  Login Login

Topic ClosedCurrent Towns Data

 Post Reply Post Reply Page  <12345>
Author
Larry View Drop Down
Wordsmith
Wordsmith


Joined: 10 Mar 2010
Status: Offline
Points: 114
Direct Link To This Post Posted: 12 Jul 2010 at 06:47
Originally posted by Larry Larry wrote:

I feel rather strongly that the format the xml file ought to be restructured. As it is there is an immense amount of duplication of data, particularly among players with multiple towns. Each and every one of their towns duplicates not only all of the player data but also (as a consequence) all of the alliance data. The downsides to this are rather obvious from both a resource usage and parsing speed perspective.

Instead you could break it up into 3 sections, Alliances, Players, and Towns. Players are tied to the given alliance by adding a <alliancegameid>18</alliancegameid> tag inside of a given <player> that corrosponds with the id found in <alliancename id="18">Council Of Illyriad</alliancename>. Same with towns. Pastebin example below


I should also note that JSON would be superior to xml for all sorts of reasons (file size, parsing speed / ease) (yes I know its less human readable, but who's actually reading these files vs. parsing them?)

Any thoughts at all? Anything from "This idea sucks here's why" to "great idea, but we're too busy right now" to "we'll do this tomorrow" would be awesome :)

Edited by Larry - 12 Jul 2010 at 06:49
Back to Top
GM Stormcrow View Drop Down
Moderator Group
Moderator Group
Avatar
GM

Joined: 23 Feb 2010
Location: Illyria
Status: Offline
Points: 3820
Direct Link To This Post Posted: 13 Jul 2010 at 08:57
Originally posted by Larry Larry wrote:

Any thoughts at all? Anything from "This idea sucks here's why" to "great idea, but we're too busy right now" to "we'll do this tomorrow" would be awesome :)

I certainly agree we should separate the data into separate, smaller files.

I'm not really sure about json, but that's largely because I personally have no experience with the structure/format; so that'd be a question for ThunderCat.

However, your middle answer is pretty much the right one!

Best,

SC


Back to Top
HonoredMule View Drop Down
Postmaster General
Postmaster General
Avatar

Joined: 05 Mar 2010
Location: Canada
Status: Offline
Points: 1650
Direct Link To This Post Posted: 14 Jul 2010 at 18:32
File size is getting quite unwieldy, but there are many use cases where a gzipped file would be just as handy and faster to fetch besides.  The raw XML is approaching 8MB and still climbing steadily while a gzipped version runs around 600KB.

Think we could get a datafile_towns.xml.gz?

Format amendments (data normalization and JSON) would also be welcome--preferrably keeping the old version around too, at least for a transition period--but (optional) file compression can do the most to improve download time and bandwidth usage.


Edited by HonoredMule - 14 Jul 2010 at 18:36
Back to Top
Dogbert View Drop Down
Greenhorn
Greenhorn
Avatar

Joined: 09 May 2010
Status: Offline
Points: 72
Direct Link To This Post Posted: 15 Jul 2010 at 02:19
it would also be awesome and impossible an illyriad map... now with sov...


(.)
Back to Top
Shrapnel View Drop Down
Wordsmith
Wordsmith
Avatar

Joined: 01 Jun 2010
Status: Offline
Points: 180
Direct Link To This Post Posted: 26 Aug 2010 at 14:46
How can I download this file and look at it?  I tried using my browser to go to the given address, but it keeps freezing up my browser.
Back to Top
GM ThunderCat View Drop Down
Moderator Group
Moderator Group
Avatar
GM

Joined: 11 Dec 2009
Location: Everywhere
Status: Offline
Points: 2157
Direct Link To This Post Posted: 27 Aug 2010 at 11:11
Originally posted by Shrapnel Shrapnel wrote:

How can I download this file and look at it?  I tried using my browser to go to the given address, but it keeps freezing up my browser.
Right-click an choose save as; otherwise your browser will try to open and display the file and it is rather large...
Back to Top
Shrapnel View Drop Down
Wordsmith
Wordsmith
Avatar

Joined: 01 Jun 2010
Status: Offline
Points: 180
Direct Link To This Post Posted: 27 Aug 2010 at 13:33
Unfortunately it wasn't given as a hyperlink, which is why I didn't think of that, but I thought of a way to get around it.  Thanks.




 
Back to Top
Larry View Drop Down
Wordsmith
Wordsmith


Joined: 10 Mar 2010
Status: Offline
Points: 114
Direct Link To This Post Posted: 27 Aug 2010 at 17:28
Originally posted by Shrapnel Shrapnel wrote:

Unfortunately it wasn't given as a hyperlink, which is why I didn't think of that, but I thought of a way to get around it.  Thanks.

curl http://uk1.illyriad.co.uk/data_downloads/datafile_towns.xml -o datafile_towns.xml


Edited by Larry - 27 Aug 2010 at 17:28
Back to Top
fluffy View Drop Down
Forum Warrior
Forum Warrior
Avatar

Joined: 02 Mar 2010
Status: Offline
Points: 335
Direct Link To This Post Posted: 28 Aug 2010 at 05:14
Originally posted by Dogbert Dogbert wrote:

it would also be awesome and impossible an illyriad map... now with sov...




tehee :D
Back to Top
Shrapnel View Drop Down
Wordsmith
Wordsmith
Avatar

Joined: 01 Jun 2010
Status: Offline
Points: 180
Direct Link To This Post Posted: 06 Sep 2010 at 02:19
I'm trying to use the xml data provided by our great GMs, but I'm having difficulty.  I'd appreciate any help.  Here's my code:

<?php
        // create curl resource
        $ch = curl_init();

        // set url
        curl_setopt($ch, CURLOPT_URL, "http://uk1.illyriad.co.uk/data_downloads/datafile_towns.xml");

        //return the transfer as a string
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

        // $output contains the output string
        $output = curl_exec($ch);

        // close curl resource to free up system resources
        curl_close($ch);    


$p = xml_parser_create();
xml_parse_into_struct($p, $output, $vals, $index);
xml_parser_free($p);
echo "Index array\n";
print_r($index);
echo "\nVals array\n";
print_r($vals);


?>

It doesn't work though.  Instead I get the following error:
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 40 bytes) in /home/cased/public_html/IllyriadTownData.php on line 19

Can anyone help?
Back to Top
 Post Reply Post Reply Page  <12345>
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.