Re: NEWBIE: DG Events?

From: Erwin S. Andreasen (erwin@ANDREASEN.COM)
Date: 08/06/98

On Thu, 6 Aug 1998, Mark A. Heilpern wrote:

> >I was gonna ask the same question, and was glad someone asked it.  But....
> >This answer doesn't quite clear it up for me.  What other kind of events
> could
> >you use it for (my imagination just isn't working on this one).

> I've used events to code teleporting rooms which take a while before the
> teleport occurs (and the teleport only occurs if the player is in the room

I use an event queue system to replace most of the CPU-intensive loops
that loop through everything in the world, i.e.:

combat (a violence event is put on the room instead)

stun/paralysis (a character can be stunned/paralyzed for just a few
seconds or even fractions of a second, so a normal tick-duration affect
won't cut it

area reset

mobprogs that trigger with a certain frequency - random and time based
(rather than ask every object , mob and room every tick if it should
trigger a mobprog yet)

wandering/scavenging mobs

skill gain (e.g. when you go up in a skill, it'll be a while before you
can go up again)

standing up after being bashed

teaching - so that you cannot keep teaching someone a skill but must take
a break occasionally

death - low level characters do not die but are transported from death -
but after that, they lose this special for 2 hours

Lots of time based things that were before some sort of check every minute
are now events - and that makes them far more precise. E.g. PK timers.

falling objects and characters - rather than fall all rooms at once, you
fall slowly, giving you a chance to cast e.g. feather fall to stop the

delayed actions - e.g. picking a lock will take N seconds after you type
"pick" before you get any result. Or telekinesis which also has several
stages of execution.

mobprogs can also use events themselves - e.g. delay for 2 seconds before
executing next statement

bard songs - the effects happen every few seconds after the bard has
started singing, also controlled with an event

chain lightning - the chain lightning jumps from target to target with a
second's delay

various psi spells plant a time-delayed "mental bomb" in a character which
then later hurts the target in various ways

Stats: 7187 events queued (60.69 added/second). Max was 7246.

I run one of those "ugly" MERC-derivatives BTW.

<>      Herlev, Denmark              UNIX System Programmer
<URL:>     <*>         (not speaking for) DDE

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/15/00 PST