[Ohrrpgce] SVN: pkmnfrk/2428 Breaking the ground on my XML idea. for the time being, I'm not hacking

Ralph Versteegen teeemcee at gmail.com
Wed Nov 5 22:51:41 PST 2008


2008/11/6 James Paige <Bob at hamsterrepublic.com>:
> On Wed, Nov 05, 2008 at 01:41:23PM -0500, Mike Caron wrote:
>> James Paige wrote:
>> >On Wed, Nov 05, 2008 at 12:03:28AM -0800, subversion at HamsterRepublic.com
>> >wrote:
>> >>pkmnfrk
>> >>2008-11-05 00:03:27 -0800 (Wed, 05 Nov 2008)
>> >>467
>> >>Breaking the ground on my XML idea. for the time being, I'm not hacking
>> >>the OHR directly. Instead, I'm going to work on a separate "test" program.
>> >>
>> >>The main reason is because using libxml adds three DLLs as dependencies,
>> >>and I'm going to try and make them all static libraries, or at least roll
>> >>them into one DLL.
>> >>
>> >>I assume this is not such a big deal on Linux, since Linux users are used
>> >>to having to apt-get a bunch of stuff before trying new things out,
>> >>right? :P
>> >
>> >I was reading up on the differences between XML, YAML and JSON. I really
>> >liked the minimalism of those other formats. XML really is astonishingly
>> >bulky.
>>
>> Truthfully, I'd never heard of YAML until this very moment. However, I
>> glossed over the spec to get an idea of it, and here are my thoughts,
>> and why I like XML.
>>
>> YAML: It uses indentation for block levels. As I'm sure I've expressed
>> before, I dislike this, due to the possibility of screwing it up by
>> having the wrong tab settings as the last guy. Indentation is good,
>> delineation by indentation is bad, IMO. It also prevents me from copying
>> one block from any random place and popping it in wherever I want
>> without fixing the indentation. (altogether, this is also why I
>> personally can't stand python)
>
> Interesting. That never bothered me about python, because I was already
> used to re-indenting when copying-and-pasting in every other language I
> have worked in. (just because python is the only language that enforces
> indentation, doesn't mean I don't religiously indent in every other
> language)
>
>> JSON: If you look at the example page
>> (http://www.json.org/example.html), then you'll notice something
>> disconcerting. Barring the last example (a servlet definition), the XML
>> versions of all those examples are more readable. It may not be as
>> concise, but it... I dunno, it looks better to me. Also, the fact that I
>> can't see at a glance which brace matches which block bugs me, slightly.
>
> Ah, I think I spot a big reason why we disagree about this. For you, an
> important goal of using XML is the human-readability, right?
>
> For me, human readability iss nice-to-have, but it isn't a big deal. I
> can see myself looking at the text of a data file to verify that it
> serialized correctly, but I wouldn't dream of hand editing or
> copying-and-pasting unless I had no other choice.
>
> What is cool about XML to me is the fact that it can store hierarchical
> tree-like data, the fact that it can store variable length lists of
> arbitrary objects, and the fact that new data members can be easily
> inserted and old data will just get the defaults.
>
> ...Byt other formats fith the above description just fine. I could even
> make a binary format that had all those features.
>
>> XML: Yes, XML is the bulkiest of the lot. But, it's the most mature
>> format as well. And, lots of tool support is available. But, the thing
>> that really sells me on XML is that I could, in theory, write an XSLT
>> stylesheet, attach it to my textbox document, and get a preview of every
>> textbox in my game, for example. Or, also in theory, I could embed every
>> data lump in one document (if I ever decided that was necessary or a
>> good idea).
>
> If we are talking XML as an import/export format, I can't find any
> argument against it, but as an internal format, I don't care for it.


I think the whole idea of replacing the current format with a textual
markup is a bit crazy because:

1) If game had to be decompiled and recompiled every time it was
played, that would really blow out already totally awful loading
times.

Actually, I want to look at ways to shorten the current unlump and
upgrade process. Unlumping large games takes ages, and typically some
major lump get expanded every month or two meaning nearly every game
needs to be upgraded to be played.

First of all, I'm going to revive Neo's plan on bugzilla from eons ago
(bug 92) with the additional suggestion that lumps don't need to be
expanded if the new data doesn't have to be written to (to be
initialized with non zero default data): the wrappers will hide the
fact that the actual lump data is smaller.

2) RPG filesize bloat. The big lumps, graphics and tilemaps, usually
compress very highly. Even when compressed, XML descriptions are
probably going to be many times the size of the binary file
uncompressed. Which should mean that they'll end up taking up most of
the space in a compressed RPG file.

>
>> Lastly, for the purposes of OHR development, XML is the only format in
>> the bunch that has a library included with the compiler. For the other
>> formats, I'd have to translate their headers into FB, which may or may
>> not be impossible (it likely is possible, but it's still a lot of work).
>
> Yeah, I do see that XML headers come with FreeBasic.
>
> The inclusion of another dll dependency isn't a dealbreaker, but I am
> not excited about it. I do notice that libxml2.dll + iconv.dll >
> (SLD.dll + SDl_mixer.dll) * 2
>
> ---
> James Paige
> _______________________________________________
> Ohrrpgce mailing list
> ohrrpgce at lists.motherhamster.org
> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>



More information about the Ohrrpgce mailing list