[MUD-Dev] Room-based vs. coordinate-based
Shawn Halpenny
malachai at iname.com
Thu Jun 26 10:56:40 CEST 1997
Brandon J. Rickman wrote:
>
> On Mon, 23 Jun 1997, Shawn Halpenny <malachai at iname.com> wrote:
> >An aside--given:
> >Room R at time t=0.
> >An earthquake is scheduled to occur in R at t+5.
> >Room R is spoofed at t+2, creating R' which now exists in lieu of R.
> >Time t+5 arrives, the earthquake occurs. Are the effects of the
> > earthquake applied to R, R', or both? Generalized: are any
> > actions occuring on R to be duplicated on R' and vice versa?
>
> >Note: the spoofing of R and the earthquake are independent events
> >and are completely unrelated in cause, execution, and effect.
>
> This is a great example of a particularly bad (and quite common) way of
> non-atomic coding. "Scheduling" an event in this case is like declaring
> a prophecy: "There will be an earthquake in 5 ticks!"
I disagree. Every event is a prophecy since every event must be scheduled,
else nothing ever happens (events scheduled to happen immediately may be
exempt). The objects affected, however, usually have no idea
about the impending event, nor do they need to.
And why do you consider it non-atomic?
> I'll go out on a limb and claim that events must always immedidately
> originate from objects. There should be no indirection of events, such
> that an event might be scheduled by an object but actually be originated
> as a server action.
I'm not sure I understand. Are you saying that for the earthquake to
occur, the evaluation of the decision (yes, make earthquake, no,
don't) should occur and immediately after that there either is or is
not an earthquake? I.e. there is no concept of having an earthquake
occur in 5 seconds?
> In the above, R (for all practical purposes) is the originator of the
> earthquake. But by scheduling the event at t+5, R has added indirection.
> Now at t+5 either the server emits the event only to R and no one sees
> it, or the server looks for R, can't find it, and dumps the event.
The earthquake was likely scheduled by whatever code was responsible
for handling the success of Bubba's earthquake spell, but the
originator of the event doesn't actually matter. The indirection
doesn't matter either. The event and its (spoof) target can be
considered independently of all other elements in the game (excepting
the non-spoof target). I think the earthquake must be propagated to
both R and R', since (assuming the effects of the quake persist
beyond the life of R') when R' is terminated, you can't have the
effects of the earthquake disappear as well. The +5 delta I
mentioned above has nothing to do with how the event is processed,
but was intended only to show that the spoofing, the earthquake, and
the aftereffects did not occur at the same time. I could have
synonymously said: 'Earthquake occurs in spoofed-room R'. If R' is
destroyed before the effects of the earthquake are completely gone
(i.e. the fissures in the earth, etc.), does R show the same
effects?' To which the answer, I think, is "yes, definitely."
> I'm thinking cold-like frobs provide a way to solve this. Otherwise a
> tighter way of relating the spoofed object to the object of spoofing is
> needed. Then R gets the event and passes it on to it's spoof. This
> would need quite a bit of garbage collection.
I know not of frobs, and in the stuff above don't see where any garbage
collection comes in.
--
Shawn Halpenny
"You can't buy the necessities of life with cookies"
- "Edward Scissorhands"
More information about the mud-dev-archive
mailing list