Re: [CODE] Weapon Speeds

From: Patrick Dughi (dughi@imaxx.net)
Date: 08/20/00


> I am creating a system where weapons have an assigned speed, so that a
> player with faster weapon might hit twice for another players one hit.  I am
> thinking about doing this by having pulse violence call every 1/10th second
> and decrement a GET_HIT_WAIT(ch).  If GET_HIT_WAIT(ch) == 0, then the
> character hits, and GET_HIT_WAIT = find_time_to_next_hit(ch);
> easy enough I think.
>
> Now my question is, with between 10 and 30 players, will scanning through
> the combat list and decrementing everybody 10 times a second lag the MUD
> significantly?  If so, what would be the smallest number of times per second
> you could scan without lagging?

        This is really, _really_ machine dependant.  I don't just mean the
physical hardware either, but what's running, and who's running what at
the time.  There is no fixed measure of 'significant lag', and there's
really no fixed measure of how many undefined (as in technique) scans of a
given randomly sized list on any arbitrairy machine will cause the above
undefined significant lag.

        That's like asking one of those funny sound-of-one-hand-clapping
zen riddles.  But, if you want to make it more efficient, why don't you
just set up a fight event queue which is generated at each 'violence'
pulse, and immediately dequeued.  Basically, you'd just stick each person
fighting in as an entry into the queue, and give them an attack 'time'.
If mr. quick with a dagger gets 3 attacks evenly spaced, say, at times 3,
6, and 9, and mr big gets only 2 attacks at 5 and 10 (he's got a small
sword), then stick those events in there.  If you're smart, and insert to
the list inorder, you'll just be able to dequeue straight from the top.

        There's other ways to do this, so think about it for a bit.


>
> Btw...I am running my MUD from win98 with a dos autoscript which restarts
> the mud when it crashes.
> However, the mud will not restart until the illegal error box is closed.  Is
> there anyway to avoid this?

        I believe this has been covered a few times on the mailing list,
I'd suggest you search for it.  I believe there was some sort of
application that automatically closed those windows, or something.

                                PjD


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/11/01 PDT