Wednesday, August 17, 2011

Working on XML System and Stuff to Come.

I've been pretty busy with other commitments at the moment but I wanted to share a bit about my tests with XML.  It is looking pretty fantastic right and I plan on dumping a ton of effort into using it as a primary engine component for storing the majority of the game's data. The idea is to steer away from hard coding much of the expandable features of the game such as items, events, flags, attributes, effects, etc and use robust wrappers to account for all the sort of random things a developer would want to make. Want to create a quest line where you can find the legendary potion of the fertility goddess? You will be able to set up a series of events that can land you the rare potion item that gives entirely new attributes or effects that cause your character to grow in any numerous ways. Certainty you can be more creative that that, but that's the goal with this system.

For those inclined, here's a sample of what an item may look like in xml.


<item name = "apple">
<type>food</type>
<price>10</price>
<icon>apple.png</icon>
<effects>
<effect>targetCow.Health + 10</effect>
</effects>
<description>
A delicious red fruit. Known for keeping medical staff at bay.
</description>
</item>

You will be able to add numerous effects as well as custom ones by adding entries into a separate xml file for effects. I'll try to provide a guide for using this stuff once it gets there.

While this XML stuff is great, I'm currently stuck on writing much of the complex parsers needed to read all this random bit of information. I'm knocking my head against the wall a bit, but I've managed to find an opensource string to math expression parser made just for Actionscript 3.0. I also rediscovered something called "RegExp" or Regular Expressions, something I used for finding and replacing specific text in my last game. Apparently it's much more powerful (and convoluted) than I originally thought, and may prove useful to this part of the engine.

Once this is all taken care of, a HUGE part of the game will be done. Still, it will still be time before I start grabbing alpha testers as I haven't even begun getting any actual interfaces yet. Hopefully that will also mean more previews and less walls of text. Time will tell. And if you actually read this far user, I thank you with this awesome image below.


Milk Maid by Gunneko on Pixiv

No comments:

Post a Comment