Up to Main Index                            Up to Journal for August, 2021

                     JOURNAL FOR SUNDAY 8TH AUGUST, 2021
______________________________________________________________________________

SUBJECT: Updates for exits, where and messaging
   DATE: Sun  8 Aug 17:12:32 BST 2021

First of all I’d just like to give a shout-out to Mcgiwer who was kind enough
to point out a broken link on the downloads page. The link shouldn’t have been
an actual clickable link and was part of a command in some instructions:


  For the really impatient, who know what they are doing:

                    git clone https://code.wolfmud.org/WolfMUD


Due to my static site generator auto-detecting the link it was made clickable.
If you’ve got a link you’re going to click it right? I’d known about the issue
and had been meaning to fix it for ages as I could see it might cause a bit of
confusion[1]. So thanks for kicking my butt on that one Mcgiwer! :)

Mcgiwer also suggested I make source downloads available for the Git branches
at tip for users who don’t use Git. It’s something I’ve been considering for a
while, especially for the experimental branch. Due to my current setup that is
going to take a little longer to implement than the link fix…

Talking of Git branches, I’ve just pushed updates to the experiment branch.

There are two big changes. Where something is has moved from Thing.As[Where]
to Thing.Ref[Where] and is stored as a *Thing instead of a string UID. The
other change relates to exits for locations. Instead of being Thing.As[North]
for example it’s now Thing.Ref[North], again using *Thing instead of a string
UID. Using direct pointers instead of two or three nested map lookups has
improved performance a little…

However, you may not notice the performance gains due to the addition of the
SHOUT and SNEEZE player commands. While these two commands are reasonably
efficient, they can broadcast messages up to three locations away. In theory
with a broadcast radius of 2 locations to 45 locations are covered — that’s 44
locations that are reachable within 2 locations of the central location. In
reality not all locations use all exits. For the stock zones I’m guessing we
broadcast to a third, or 14 locations, on average.

Without any mitigation SHOUT and SNEEZE can generate a huge amount of network
traffic. In testing the server went from 112% CPU usage with 64,000 bots to
over 350% CPU usage — with only 32,000 bots. Most of the time was spent in the
kernel handling all of the additional network traffic.

The SHOUT and SNEEZE commands now use some aggressive crowd control.

Priority messages have been added. A priority message is always sent to the
recipient. A non-priority message is only sent to the recipient when it is not
exactly the same as the previous non-priority message sent. Messages sent to
an actor send are always priority — so you always see your own messages, like
responses to commands. Messages that are sent to participants and observers
are non-priority. This helps reduce network traffic and de-spams messages,
preventing repeated runs of “You hear a sneeze” or “You hear talking nearby”.
Everyone still sees all their messages, just not repeated duplicates.

The message buffer handling in core/state has also been updated to use *Thing
instead of string UIDs. This lets us message players in places that are not
reachable via a simple World[UID] lookup — such as nested locations and
containers.

With these mitigations and other changes in place the server is about 2%-3%
faster overall with 64,000 bots running around, shouting and sneezing all over
the place ;)

As a bonus there is a crowd check fix in the MOVE command when a non-player
moves. There is a fix for Thing.Any values not being copied properly. Some
dumb typos have been fixed in the stock zone files.

All of this now puts me in a better position to finish off sorting out resets
and respawning. Changes on the experiment branch now for those that want to
play along.

--
Diddymus

  [1] It also generated a lot of 404’s from bots & spiders in my server logs…


  Up to Main Index                            Up to Journal for August, 2021