[MUD-Dev] World Persistence, flat files v/s DB v/s ??
Nathan F Yospe
yospe at hawaii.edu
Tue Mar 31 08:23:33 CEST 1998
On Mon, 30 Mar 1998, Ben Greear wrote:
:On Mon, 30 Mar 1998, Orion Henry wrote:
:> This is where you can have a little fun. These records are people...
:> places.. things... whatever you need to use for your mud. Each contains
:> references (unique ID's, not pointers) to other records. Lets say that the
:> back end process ( the one that holds the "snapshot" ) holds a huge number
:> of records and the ones it dosnet have RAM for (if you dont have enough)
:> are written to disk. Your front end process (the MUD) holds less, say
:> MAX_RECORDS. Each time a refrence is dereferenced it checks the local
:> cache and if its not there its requests it from the back end process. When
:> the number of local records exceeds MAX_RECORDS it drops the oldes ones (
:> LRU or Clock algorithms will do nicely). Now dont panic... I see the
:> problems with this too. There's more.
:> 1) Whenever a record's reference is dereferenced, the front end process
:> fetches all the recrods associated with it... Thus, when you dereference
:> Boffo the Half-Troll you also bring over his moth eaten shirt. His deadly
:> tree branch. His manky underwear and the room he's in. (because you will
:> proboly reference all of this very shorty after looking at Boffo) This way
:> when you make a reference its (probobly) always there...
:> 2) Whenever a record is changed it is marked as dirty and schedueled for
:> upload back to the back end... otherwise its just forgotten when it falls
:> off the LRU list.
:This model would work fine for a MUD, but my game will have every object
:in motion of some kind. I'm using F=MA, and all the fun that goes with
:it, including a partial gravity computation (I'll re-compute every now and
:then, and adjust orbits accordingly.)
If all you're using is F=MA, there's no reason to compute motion when it is
not being observed. Even with the partial gravity computation. I assume you
use a third order two body equation of motion, for most cases, and a second
order expansion of the Hamiltonian (using precalculated constants) for more
complex systems. I would hate to think what the effect of doing a mass-mass
force calculation and extrapolating would be. (And have I really been using
sixth order equoms in my software for over four years? That's what this old
software development file says.) I've been doing a much more complex status
check (thermodynamics, fluid dynamics, friction depreciated mechanics, most
of the complex elements of complex bodies, but only when they are observed)
without having to keep anything but a bare minimum instantiated, po6 forbid
actually computing it all. The nice thing about physics is, it all works if
you watch it, but there's ways to get from point A to point B without going
straight down the line. And they often amount to folding the map... without
walking down the fold. In other words, calculate what you need to, estimate
what you can, and fudge what you have to. If you do it well enough, noone's
gonna ever find out. Or maybe someone will... "Hey, guess what! I think the
server doesn't actually make a tree fall in the forest if noone is there to
hear it! It just becomes fallen!"
:Basically, with the AI, the game should remain at almost constant levels
:of computation/action, regardless of the number of ppl logged on. Of
:course, many things will be just estimated, for example, a battle between
:two AI clans won't do a lot of the details if no one is watching...but
:the end results should be about the same.
Well... yes. But... why compute it at all? I mean, if it is something where
a computation can get you most of the intermediate... and randomized fudges
can get you something as good as... it seems wasteful to have the CPU going
for nothing. This does depend, of course, on the complexity of the AIs. For
really complex AIs, I pretend they are players too. In fact, I'm looking at
making the AIs remotely hosted and dialing them into the main computer, the
same way I would a PC.
:> Sockets and pipes would work well for this but (I'm not sure) but I think
:> that unix messages will be very fast for this implimentation.
:I'm using Java, so probably going to use sockets, as that seems to be
:the least common denominator across platforms. The DB itself will just
:be an object I instantiate in the server program...(and clients too I
:guess.)
Java for the host? I'm using it for my clients now (got to see how well the
Metrowerks java-to-native compilers for MacOS and Win32 work... they may be
just what I need.)
--
Nathan F. Yospe - Aimed High, Crashed Hard, In the Hanger, Back Flying Soon
Jr Software Engineer, Textron Systems Division (On loan to Rocketdyne Tech)
(Temporarily on Hold) Student, University of Hawaii at Manoa, Physics Dept.
yospe#hawaii.edu nyospe#premier.mhpcc.af.mil http://www2.hawaii.edu/~yospe/
More information about the mud-dev-archive
mailing list