[MUD-Dev] Combat Systems

Ben bjchambers at phoenixdsl.com
Tue Jul 18 19:07:39 CEST 2000


  In my Mud, basically each action would have a given speed.  You would have
a speed, your skills have speed, your weapons have speed.  This gives the
illusion of everything happening in realtime.

    To prevent lag from killing basics reactions are programmed in, if you
don't react, the server reacts for you, thus compensating for lag if
necessary.  You can always override the server, for instance if you are
under attack, it is going to automatically defend, but you can tell it
instead to run, or cast a spell.

    The threads are engineered in such a way that there is a universal
command qeue, into which all commands are processed.  The primary thread of
execution is the server thread, where the commands are actually executed.
The player thread waits for input then preprocesses it, by filtering it,
parsing it, etcetera, then adds it to the command qeue.

    The server thread allows everything to happen in realtime relative to
each other.  The way the command qeue works is it is an array, say 60 units
long, of pointers.  Then each unit is a linked list.  Each linked list
contains all things that are supposed to happen in that ammount of rounds
from now.  For example it executes all things that are in array 1, then
shifts it down, moving 2 to 1 etc, but instead just changing the pointers.
But then for things that take longer than 60 rounds to complete, they also
have a cycle attribute, for example if it is 1, and it is in array one it
would execute, if it is 2 and the item is in array one, it would subtract
one from the attribute and shift it over to 60, in this way all the events
are just appended to the command qeue, so for thread locking you just lock
the pointers in the command qeue...

    Has anyone documented a combat system similar to this?  Anyone have any
ideas about ways to improve this?  Any thoughts about whether this is
actually possible?




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



More information about the mud-dev-archive mailing list