| Author |
Topic Search
Topic Options
|
Larry
Wordsmith
Joined: 10 Mar 2010 Status: Offline Points: 114 |
Posted: 12 Jul 2010 at 06:47 |
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
|
 |
GM Stormcrow
Moderator Group
GM
Joined: 23 Feb 2010 Location: Illyria Status: Offline Points: 3820 |
Posted: 13 Jul 2010 at 08:57 |
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
|
 |
HonoredMule
Postmaster General
Joined: 05 Mar 2010 Location: Canada Status: Offline Points: 1650 |
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
|
 |
Dogbert
Greenhorn
Joined: 09 May 2010 Status: Offline Points: 72 |
Posted: 15 Jul 2010 at 02:19 |
it would also be awesome and impossible an illyriad map... now with sov...
|
|
(.)
|
 |
Shrapnel
Wordsmith
Joined: 01 Jun 2010 Status: Offline Points: 180 |
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.
|
 |
GM ThunderCat
Moderator Group
GM
Joined: 11 Dec 2009 Location: Everywhere Status: Offline Points: 2157 |
Posted: 27 Aug 2010 at 11:11 |
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...
|
 |
Shrapnel
Wordsmith
Joined: 01 Jun 2010 Status: Offline Points: 180 |
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.
|
 |
Larry
Wordsmith
Joined: 10 Mar 2010 Status: Offline Points: 114 |
Posted: 27 Aug 2010 at 17:28 |
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
|
 |
fluffy
Forum Warrior
Joined: 02 Mar 2010 Status: Offline Points: 335 |
Posted: 28 Aug 2010 at 05:14 |
Dogbert wrote:
it would also be awesome and impossible an illyriad map... now with sov...
|
tehee :D
|
 |
Shrapnel
Wordsmith
Joined: 01 Jun 2010 Status: Offline Points: 180 |
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?
|
 |