[MUD-Dev] Creating a MUD - Overview of design

Sean Kelly sean at ffwd.cx
Fri Feb 1 09:50:36 CET 2002


From: "Valerio Santinelli" <tanis at mediacom.it>
> From: "Neil Edwards" <neil at anyisle.org>

>> Firstly, object persistance. By this I mean that objects in the
>> game (inc.  rooms etc) are always stored in some form or another
>> for backup and actual use. In my MUD I just read everything from
>> text files (XML formatted) and then keep everything in memory
>> until it periodically saves everything again in case of a crash
>> (Not yet implemented online creation but should be easy
>> enough). I was hoping to move this system to a database system
>> (been looking at MySQL (free) ) but I don't think I fully
>> understand what goes into the database or how it is referenced.

> Having objects stored in XML files isn't that bad after all. If
> I'm not wrong, people at Skotos use the same way to store items as
> you do.  Moving to an SQL database is a whole different thing. The
> first issue that comes to my mind is the fact that with MySQL you
> don't actually have all the objects loaded in memory, but rather
> they are queryed off the database every time you want to access
> them. This is a big overload if you've got plenty of users roaming
> in rooms with many objects.  Of course you could still do a query
> and load the objects in memory from MySQL, but this way you lose
> all the "ons" of a RDBMS.

I would do it a third way.  Store everything in memory and hit the
database when objects changed ownership, were destroyed, created,
etc.  Put all your transactions in a queue and have a separate
thread doing nothing but operating on the database.  Give every
object an object ID and when ownership is transferred, just remove
the ID from one inventory and place it in another, inside a
transaction.  This all by itself would eliminate all duping issues.
It would be up to you if you really wanted to hit the database for
small things like a sword wearing down or if you wanted to do that
kind of thing in periodic bursts.  I think a lot of the smaller
stuff would depend on that game you were creating.

Sean

_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list