ID:151654
 
Well, I've been working with XML, on my MUD with basic stuff like room, mobs and objs loading. It works pretty well, but I wonder how far should someone use XML. Also what would someone use it for.
As far as you feel appropriate. It's a data management approach, and like all approaches it requires you to make a judgement call on how far you take it.
It's like a hammer, and, when you have a hammer, everything looks like a nail.

If you start pounding and realize it's not a nail, grab a screw-driver.
In response to Loduwijk
Loduwijk wrote:
It's like a hammer, and, when you have a hammer, everything looks like a nail.

If you start pounding and realize it's not a nail, grab a screw-driver.

And if it doesn't screw, proceed with stabbing motion with said screw-driver.
In response to Stephen001
I can understand that, but I mean what have people really used it for game wise??
In response to Lundex
Lundex wrote:
I can understand that, but I mean what have people really used it for game wise??

XML does nothing in terms of gameplay. XML is just plain text in a standardized human and computer readable format. Where XML shines is in its ability to transfer information between two programs, between a program and a human, or between a human and a human.

Consider, for example, that you're making a rogue-like, and you want to have an endless supply of monsters. Perhaps you've found a site online where users upload monster definitions in a standard XML format:

<monster id="fire_golem">
    <name>Fire Golem</name>
    <glyph>
        <character>G</character>
        <color>#ff6600</color>
        </glyph>
    <level>24</level>
    <hp>100</hp>
    <strength>10</strength>
    <skills>
        <skill href="http://somesite.com/fire_breath.xml" />
        </skills>
    </monster>


You could program your game to make use of that database by picking random monster definitions (level appropriate) to populate each level of the dungeon as your player travels deeper. You could also allow users to write their own monster definitions and load them directly into the game, or use them in a level editor. Or, you could randomly generate monsters and save them as XML if the player really liked them (so if they really liked the randomly generated monster on level 40, they could save it as XML for use in the level editor, or perhaps the game sometimes randomly picks saved monsters instead of loading them from the external website).

The important thing here is that the XML is only serving as a storage and transfer medium, it doesn't actually do anything in the game. In the game itself the player is interacting with monsters that were generated based on the XML, but the XML is long gone by that point. And how far is too far? The only places you need XML are when you need to transfer data in a standard format to some other program or the user (or sometimes another module of the same program)(note XML is good for saving data, too, which is really just transferring data to the same program at a later date). Anything more than that is too far.
In response to IainPeregrine
Well, that does answer my question. I know that XML by itself doesn't do anything. I meant what can you do with XML because I couldn't really think of anything aside from what I said before.