Up to Main Index                             Up to Journal for March, 2020

                    JOURNAL FOR SATURDAY 28TH MARCH, 2020
______________________________________________________________________________

SUBJECT: More details on bodies and the slot system
   DATE: Sat 28 Mar 19:55:22 GMT 2020

Such a promising start to the month for the journal, then coronavirus and the
world falls apart :( *sigh*

Over the last few weeks I’ve been working on implementing bodies in WolfMUD.
After my last post people have been asking for more details on the body/slot
system for WolfMUD. This seemed the perfect opportunity to explain my ideas
while it’s nice and fresh in my mind :)

This is all currently a work in progress so some details may change as I
continue to implement everything.

In WolfMUD a body defines the slots available for holding, wielding and
wearing items. The slots can be anything you want and can be as simple or as
complex as you want — you just have to be consistent when defining slots for
bodies and items. The basic attributes are ‘body’, ‘wieldable’ and ‘wearable’.
There is no attribute for ‘holdable’ as nearly anything can be held. See below
for a solution to this using body layers.

The body attribute on a player or mobile define the slots available. For
example a minimal humanoid body could be defined as:


       Body: HEAD NECK TORSO HAND→2 FINGER→2 LEG→2


This defines eleven body slots. The HEAD slot allows hats and helms to be
worn. The TORSO slot allows jackets and breastplates to be worn. The two LEG
slots allow trousers to be worn. The NECK and two FINGER slots allow for
jewellery, like necklaces and rings, to be worn. The two HAND slots also allow
items to be held or wielded. Note, you can’t wear gloves and/or gauntlets yet
as that would use up the HAND slots and prevent holding or wielding other
items.

Items can have either a ‘wearable’ or ‘wieldable’ attribute. The wearable
attribute defines which slots need to be available and free in order to wear
an item. For example:


       Name: a breastplate
      Alias: BREASTPLATE
        Ref: O1
   Wearable: TORSO


This says that to wear the BREASTPLATE the TORSO slot must be available and
free. The wieldable attribute is similar:


       Name: a sword
      Alias: SWORD
        Ref: O2
  Wieldable: HAND
  %%
       Name: a dagger
      Alias: DAGGER
        Ref: O3
  Wieldable: HAND
  %%
       Name: a bow
      Alias: BOW
        Ref: O4
  Wieldable: HAND→2


Here we have a sword that requires a HAND slot to be free, a dagger that also
requires a HAND slot to be free and a BOW that requires two HAND slots to be
free. This means, assuming you have two hands, you could wield the sword, the
dagger or both at the same time. Or you could wield only the bow.

It is possible to have a very detailed body slot system:


       Body: HEAD EAR→2 EYE→2 NOSE FACE NECK SHOULDER→2 UPPER_ARM→2
             LOWER_ARM→2 WRIST→2 HAND !HAND FINGER→8 THUMB→2 CHEST BACK WAIST
             UPPER_LEG→2 LOWER_LEG→2 ANKLE→2 FOOT→2


The only requirement is that the slots defined on items match the slots you
use to define your bodies.

Notice on the previous body attribute there is a slot for !HAND. This
indicates that there is a hand missing and the slot is not usable — maybe the
hand was cut off by a critical hit during a fight. Why do we use ‘HAND !HAND’
instead of just ‘HAND’? This is so that the hand can be restored via magical
healing, a prosthetic or — in the case of some creatures — it could grow back.
If we just used ‘HAND’ we would not know there is a hand missing.

The are three more attributes that a player or mobile can have: holding,
wearing and wielding. These attributes are used in player files so we know
what was being held, worn and wielded when the player is saved. These
attributes are also used in zone files so that when a mobile is loaded they
can be wearing, holding or wielding items in their inventories. For example
the city guards can be wearing their armour and wielding their swords.

A future addition to this system, one that was planned for the Java version
but never implemented, is that of layers. Layers would allow you to have a
layer 0 — the skin layer — for tattoos, cosmetics, scars, cuts etc. Next we
could have a layer 1 — the next to the skin layer — for clothing and
jewellery. Next would come layer 2 — the outer layer — for armour, gloves,
gauntlets and such. There could also be a layer 3 for cloaks and coats.

In the same way that the body slots are very flexible so too would be the
layers — you just need a consistent scheme between the layers you want to use
and those defined on items.

It should be noted that it is possible to implement a layer system using just
the body slots. For example, if a body is defined with the following:


      Body: HAND→2 L1_HAND→2


Then we can define some gloves as:


      Name: a pair of gloves
     Alias: GLOVES
       Ref: O5
  Wearable: L1_HAND→2


It would then be possible to wear the gloves — in the L1_HAND slots — and hold
or wield items in the two HAND slots.

However, this is a just a workaround and there is no correlation between the
HAND and L1_HAND slots — they would be treated as independent slots. What I
would prefer is to have a simple, integrated layer system.

Currently I have the body slot system working and I can wield items, but I
cannot ‘unwield’ them yet. Adding wearable and holdable items should not take
too long to implement. I also need to update the DROP and PUT commands so that
items are unheld, unworn and unwielded automatically. The INV/INVENTORY
commands also needs to be updated to show what items are currently being held,
worn or wielded. The EXAM/EXAMINE command should also be updated so that when
you examine another player or mobile you can see what they are using.

The EXAM/EXAMINE command is quite interesting to think about in relation to
the layer system. You would only ‘see’ the exposed layers — if you were
wearing a tunic, breastplate and a cloak the breastplate would cover the tunic
and the cloak would cover the breastplate. So when examined you would only be
able to see that they are wearing the clock and not know what is under it :)
Of course the cloak might be sleeveless so you could see the sleeves of the
tunic under the cloak and breastplate ;)

What with coronavirus, no work and only essential travel allowed I have little
to do. I’m planning on spending more time on WolfMUD to keep myself occupied
and hope to have an update out next week sometime so that people can play with
all the new features.

I also noticed that I’ve not documented bound aliases in docs/zone-files.txt,
so I need to write some documentation to fix that.

--
Diddymus


  Up to Main Index                             Up to Journal for March, 2020