[MUD-Dev] Text Parsing

Adam Wiggins adam at angel.com
Thu Jun 10 15:40:57 CEST 1999


On Thu, 10 Jun 1999, Katrina McClelan wrote:
> On Thu, 10 Jun 1999, Adam Wiggins wrote:
> > Then at the top of act(), which is the routine which get called to turn the
> > markup language into text that everyone in the room can see, I simply checked
> > to see if num_pcs_in_room was greater than zero.  If not, I just returned without
> > doing any processing.  This made quite a difference; up until then it had been
> > constructing the "You leave north" and "A hobbit arrives from the south" strings
> > every time a mobile moved, whether a PC was present or not.
> 
> This works, except that you then don't get full information when you snoop
> a mob... oh yeah... can't do that in standard diku  ;)  (not that you
> couldn't code around this limitation and still "blind" the mobs in
> the general case anyway)

Well, it was actually based on Circle, so it did have snooping.

And actually, I did acount for this - num_pcs_in_room was actually a count
of the active *descriptors* in the room, not the number of !IS_NPC(ch)'s.

So if I switched out of my immort's body and into a hobbit, it decremented
the num_pcs_in_room where my body was, and incremented it in the room with the
hobbit.

> > I also staggered the way that things happened; at the time, most all of the game
> > updating happened on the "tick" mark (every 60 seconds), which caused a slowdown
> > right then.  I made an "object tick", a "character tick", and so forth.
> > By the same token, mobiles, which previous updated every 3 seconds (all of them),
> > I changed to update every second.  However, not *all* of them would update, only
> > about 1/3rd.  I'd just save the linked list pointer until the next second, and
> > pick up where I left off.  When it got to the end it would loop around again.
> > 
> 
> An informative note that this works because the standard game look checks
> start time, and end time, and the last thing it does is sleep for the
> remainder of 1/4 second.  If your one loop takes longer than 1/4 second,
> then you get server side lag.  However if you distribute the computing
> over multiple loops that use less than 1/4 second you don't notice the
> high load on the client side.  Only adding this because I had a mud once
> reject this optimization arguing that it didn't save any CPU time.
> Truthfully it doesn't save any computing time.  It does help with
> server lag however.

Correct.  Thanks for the clarification.

And actually, I think that Circle uses 1/10th of a second pulses, which gives you
an even smaller time sliver.  To help pin down heavy cycles, I had it spit out
a log message whenever it exceeded its 1/10th of a second on a cycle.

Adam W.




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




More information about the mud-dev-archive mailing list