Up to Main Index                             Up to Journal for April, 2020

                     JOURNAL FOR FRIDAY 24TH APRIL, 2020
______________________________________________________________________________

SUBJECT: Some very minor (not body) updates
   DATE: Fri 24 Apr 16:40:35 BST 2020

I’ve just pushed four commits to the public dev branch — sadly it’s not the
big body update yet :( I’ve been working on the body code, but that’s needed
other code changes, which needed bugs fixing and more changes. What was a
simple change or fix soon snowballed. Adding the body attribute to WolfMUD is
a big deal with a lot of associated features making it important to spend the
time and get the details right.

Currently I need to write some tests for the DROP and PUT commands to make
sure items that are in use — being held, worn or wielded — are removed before
being dropped or put into a container. I also need tests for the INVENTORY
command to make sure the usage of an item is reported correctly. Except the
INVENTORY command doesn’t even have tests yet :(

The thing is, since commit c9f01bc640196959 “attr: Always send prompt to reset
input colour” — about 25 commits back — all the tests in the cmd package have
been broken.

I started fixing the tests only to discover a bug buried in the message
package in the Buffer.Deliver method. The bug was not serious but causing a
colour reset to always be prefixed to participant and observer message
buffers. So I stopped to fix that issue which altered the output sent to
clients and had to rework all the cmd package tests again. *sigh*

While working on the tests I had an odd message appearing when tests failed:


  [13/16] 0xc00040b4c0


What the heck? Well it seems to be the address of something. Turned out to be
a rouge “println(actor.Dump())” which wasn’t working properly and had been
accidentally committed when tests for the READ command were added a while
back.

The fourth commit sneaked in while I was writing this entry. Reviewing some
commits and tracing back the history of a change I noticed a redundant ‘if’
statement in the Player.Write method — said statement has now been removed.

I nearly had a fifth commit to reduce allocations in Buffer.Delivery, but the
implications are more complicated and I need to verify an assumption with some
tests and benchmarks first. I’ll deal with that after this post goes up…

So those are my four commits: remove rouge debug statement, remove a redundant
‘if’ statement, reduce number of colour resets sent to clients and fixed cmd
package tests. Nothing big and exciting, but now I can get back to bodies.

I think I’m mostly happy with bodies now. The last big change needed is the
handling of player file upgrades. That and making it easy for admins to define
their own body model — so that they can have a system of body slots that is as
simple or complex as they want.

The idea I have for player upgrades is to have a player.wrj in the data
directory. This would define a basic player template. In the future I plan to
add race and profession templates as well. A new player would then pick a race
and a profession during character creation. Based on the player’s choices the
basic player template would be used and customised using the race and
profession templates. This would allow the player to have items, skills and
other things when they start based on their choices.

For upgrades I’m thinking that the current player can be compared with the
templates and if any fields are missing — such as health or body — then the
template values can be used. This does open up the question of what to do with
existing players when things are changed or removed — as opposed to being
added.

--
Diddymus


  Up to Main Index                             Up to Journal for April, 2020