<?xml version="1.0"?>
<entity id="1">
<component name="MudObject">
<name>Knife</name>
<aliases>
<alias>blade</alias>
<alias>dagger</alias>
</aliases>
<location><entity refid="2"/></location>
</component>
<component name="Weapon">
<damage>1d10</damage>
<durabilityMax>50</durabilityMax>
<durabilityCurrent>50</durabilityCurrent>
</component>
</entity>
<entity id="2">
<component name="Location">
<!– blah, blah, blah –>
</entity>
entity 1:
MudObject:
name: Knife
aliases: blade, dagger
location: #2
Weapon:
damage: 1d10
duabilityMax: 50
durabilityCurrent: 50
entity 2:
Location:
# blah, blah, blah
DataAccessObject dao = DAOFactory.getCurrentDAOImplementation();
dao.persist(entities);
I went for flat files as well. I was considering using MySQL originally, but it would have increased my hosting costs, and seemed more complex than flat files, so I never really got around to it. However I've been thinking about it again since integrating the mud with the website, particularly as I fancy the idea of having a browser game that shares the same data as the mud.
No MySQL doesn't absolutely mean no web integration! Instead of changing the entire way your mud saves and loads data, why don't you just give your website the ability to load from flatfiles? You don't even have to stick to php (unless your website is already in PHP). The only reason to actually use a DB with regards to web integration is simplicity, and relational mapping. If the task requires you to either rewrite your game, or give the features to the website, simplicity is already out the window :).