[MUD-Dev] Event handling
Shawn Halpenny
malachai at iname.com
Fri Jan 9 12:56:02 CET 1998
On Fri, 9 Jan 1998 s001gmu at nova.wright.edu wrote:
>
> On Thu, 8 Jan 1998, Vadim Tkachenko wrote:
>
> > s001gmu at nova.wright.edu wrote:
[ snipped since others are capably currently carrying the ball but the
following was something I'd specially wrestled with in my initial
design stage ]
> > > I haven't spent much time on gracefull shut-down of the
> > > queue, or storing of the event list to rebuild a queue, but
> > > they are next on the hit parade.
> >
> > Two options:
> >
> > - save the event list and process it on the startup
> > - process all the list on shutdown. But, this situation may be
> > more difficult because events being processed may produce some
> > more effects and so on - for example, if you shout (RL) and
> > then try to 'process the event while shutting down', you're
> > likely to:
> >
> > - Hear the echoes,
> > - Which may, in turn, cause the avalanche,
> > - Which may, in turn, kill a lot of people around,
> > - Which, in turn, creates a LOT of other events to process,
> > - and so on.
>
> *nod* good point. I just realized that one of the other things we
> planned to do would work nicely with saving events and processing them at
> re-start... We planned on setting it up so that if you logout outside of
> an inn or other "long-term storage" type safe-room, your character just
> sits there... so, in the event of a... less than expected shutdown, all
> events are saved, all characters out and about are saved as such. reboot,
> all characters are put back, and all events are reloaded. Rather nicely
> takes care of problems like "cast fireball boffo" being reloaded with
> neither the caster or the target being around. I can see players being
> unhappy with the way things would work out, though. It might be better
> to just let the events die.
Does game time pass for your players while they are logged out?
How are your events time-stamped?
Are players outside of long-term storage (the ones just sitting there)
affected by game events? Are those within the storage affected?
I ask because I was initially thinking something akin to what you are
describing when I started down the event-driven road. The reasons I ask
are outlined somewhat:
- Bubba drinks a vial of poison whilst relaxing in a local inn and he
has his poison bit set for the next 20 minutes--the arbitrary
duration of the poison (implying that an event is immediately
scheduled to ripen in 20 minutes that will unpoison Bubba).
- game is shutdown/crashes/etc. 3 minutes later. No events are saved.
Our intrepid hero logs back on 5 minutes post-crash and some weeks later
realizes that the poison he swallowed long ago is still with him
since the unpoison event has disappeared.
Okay, let us save pending events and assume the same above
drink/crash/login happens again. Remember that poison event now has
to ripen in 12 minutes from when Bubba returns to the game, assuming
that for players, game time only passes for them whilst they're
in-game. Depending on how you time-stamp your events, the event
manipulations can become interesting.
So let's say you have a perfect solution for that (something like
saving the time the event was posted as well as the delta from that
time till the ripen time. When Bubba logs back in, the delta on the
event is modified based on the current time and things continue on).
Now,
- assume above poison-drinking, reboot, and saving of pending events
- however, instead of 5 minutes later, Bubba logs back on an hour
later.
What to do with the unpoison event that should have ripened 43
minutes ago, but didn't because it was either saved with Bubba and
removed from the game event queue, or was enqueued but Bubba wasn't
logged in so it silently ripened and died. Sadly, Bubba remains
poisoned.
Or perhaps you note that the event had to have ripened while Bubba
was logged off, so you'd better ripen it post-haste. Now your users
complain of the possibly hundreds of events that spam them off
immediately after logging in upon return from their vacations. All
the effects are still there, just batched. This isn't necessarily
bad, but (IMO) would be in unconscionably bad taste.
The above were my prime motivations for keeping all game objects in
the game until they are removed from the DB (i.e. no longer exist).
I suppose it is possible to log the player out, but continue to let
any pending events have their way with Bubba's player object, but
what if the poison kills Bubba while he's logged out? What happens
to the body? His inventory? What if the vial Bubba drank wasn't
poison but was a slow-acting agent that gradually caused the imbiber
to come under the complete control of the person originating the
potion?
(I don't require an answer to those questions, but Greg might :-) ).
I know that as a player, I would find that anything that happened to
my character while I was logged out (and I'm assuming the general
case with current MUDs that when logged out, the body is no longer
there) would be tremendously unfair. After all, how can something
affect me if my body isn't in the game? OTOH, if I was aware that
when I logged out I was only severing my control with that body and
any game element could still affect it, then what happens, happens
unless I took previous steps to prevent it.
--
Shawn Halpenny
More information about the mud-dev-archive
mailing list