Up to Main Index                             Up to Journal for March, 2017

                     JOURNAL FOR TUESDAY 7TH MARCH, 2017
______________________________________________________________________________

SUBJECT: There is no exit…
   DATE: Tue  7 Mar 22:16:03 GMT 2017

I’ve just updated the public dev branch with some additions to the event
package and to doors. There is also a bug fix.

When using event.Queue you can now specify a jitter duration. The jitter is a
random amount of time that will be added to the initial delay of an event. For
example, if you specify a delay of ‘5m’ and a jitter of ‘1m’ the event will
trigger between 5 and 6 minutes after being queued. So the actual delay is
between delay and delay+jitter.

I’ve also added a JITTER attribute to doors. So you can now have:


  Door: EXIT→E RESET→1m JITTER→1m


Which will reset this particular door to its initial state between 1 and 2
minutes after being opened/closed. It just adds some unpredictability to
things. If you don’t want any randomness you can specify a JITTER of 0. If you
want totally random you can specify a JITTER value and a RESET of 0.

While playing with doors I found and fixed an issue I don’t think anyone will
have come across yet. If you place a door between two zones the loader will
log a warning similar to:


  There is no exit "south" for Door "the tavern door" to block, cannot add
  other side


This is despite having exits and locations setup correctly. This particular
bug is now fixed in the public dev branch.

My next task was looking into improving the loader in the zones package. My
efforts so far have been frustrating. First of all, when populating the world
copies of things should be used and not originals. This is so that you can
define something once and then place it at different locations. An example
would be the four runestones scattered around the Zinara zone. Currently there
is only one runestone — but it’s in four different locations at the same time.
You can pick them up, move around with them and drop them again. You can carry
all four or drop all four in the same location. But they are all the same
runestone — literally, it’s the same object reference just being put into
different inventories.

While this is marvellous for reducing memory consumption it causes havoc with
everything else! Take doors for example. You end up with one complete door and
however many half-doors where only the original side is copied and there is no
‘other side’. But, and here is the thing, open or close one door and they all
do the same!

Currently if you were to define a torch and place it multiple times when one
was lit they would all light up. If you defined an apple and filled a basket
with copies then ate one all the rest would be eaten as well. As I said,
havoc.

I thought I had a solution, and it even nearly worked. However I ended up with
a lot of difficult corner cases to deal with. Looks like I need to rethink and
rebuild the loader so it’s fit for purpose. At the moment instead of becoming
simpler it’s turning into a rats nest of issues.

So for now these changes are out while I go away and cogitate for a bit.

--
Diddymus


  Up to Main Index                             Up to Journal for March, 2017