From: Jeff Moore Date: 2008-10-06T09:27:23+09:00 Subject: Re: Object Persistence for a MUD Brent Dillingham wrote: > Hi all, > > For fun, I'm writing a MUD with Ruby. I've been doing something similar with a multi-user space game. I haven't arrived at any firm conclusions but the first thing that I have observed is the split between static/stateless data and dynamic/stateful data. There is a tremendous amount of static data (maps, buildings, locational characteristics, etc) so it seems to make some sense to separate this from the dynamic data/stateful (current health, ammo, factional affiliations and status, etc). At this point, I'm generating the static part of the universe and Marshaling it to file so it can be re-used. Some would argue with Marshal as a choice but I'm using DRb between clients and servers and Marshal is the default object protocol within DRb so in for a penny, in for a pound as they say... On the plus side, it's considerably faster than YAML or a database. On the minus side but isn't readable or mindful changes in object version. If you've modified the object definition between store and load, you need to rebuild. This is the reason I've relegated it to managing static data only. The dynamic/stateful part looks like it's going to require a database of some sort largely to provide a relatively stable/secure repository. SQLite looks like my first choice at this point as it's supposed to be fast, small and zero maintenance. We'll see... Best of luck djief -- Posted via http://www.ruby-forum.com/.