MArcomage

Free multiplayer on-line fantasy card game

Please log in

dindon on 04:32, 22. Nov, 2010
I don't think this really belongs in any of the other forums, so I'm just throwing it in off-topic. This is mostly addressed to the devs, but if anyone else has thoughts I'd be curious to know.

My question is why information about cards is stored in an XML file rather than storing it in a DB table like everything else. Is it so that changes to card costs and effects and so on are reflected in diffs?

My understanding is that XML DBs are much slower than full relational DBs. Is this in any way an issue? Did you ever consider having the XML DB and also a regular DB table in parallel, with some kind of routine to sync them?

Just curious.
Mojko on 20:39, 29. Nov, 2010
In the first versions of MArcomage card related data were stored in relational DB. Of course both relational DB and XML DB have pros and cons. Then u-mage came with an idea to transfer all persistent data (data that would not be changed by user) to XML files. Sure, they are slower, but acceptable for our purposes. The development of cards has much improved since then. Before, the card effect code was stored separately from the rest of the card data. Now, all card related data is stored in one place and also all keyword related data as well.

The diffs are much easier to read and consistency between card effect text and card effect code are more easier verified. I think this change was a vast improvement. Not to mention that this change reduced the parsing time of card effect.
dindon on 22:04, 29. Nov, 2010
Cool, thanks for explaining. Now that you mention it, I think I actually remember looking at the code a long time ago when card effects were all hard-coded into the source code under one big switch statement - maybe I'm just imagining that though.

I wonder if you could have the best of both worlds by having database fixtures in YAML or XML or Json or whatever. Then you could have all the card information in a human-readable form, while also having the speed of accessing them through a relational DBMS. This is very easy to do in Django, but I don't know how difficult it would be in PHP.