Up to Main Index                           Up to Journal for January, 2019

                    JOURNAL FOR SUNDAY 13TH JANUARY, 2019
______________________________________________________________________________

SUBJECT: A possible crafting system…
   DATE: Sun 13 Jan 15:29:52 GMT 2019

First entry for 2019, and it’s a lot later than I would have liked. Mostly
because I kept thinking, rewriting and tweaking as I went along.

New years day I had a nice email from Chris “Gwaed” asking if there was a list
of currently implemented features and commands for WolfMUD. There isn’t, but
there probably should be. Maybe a current status page?

We emailed back and forth a few times before Chris asked about crafting in
WolfMUD. I had always planned to add crafting, but it certainly wasn’t on my
radar at the moment. Anyway, I sat and had a think. What would be required to
implement crafting? I then emailed Chris my ideas and we started batting more
emails to and fro.

I think we may have come up with a simple plan for crafting that can be as
simple or as complex as you want. Gory details follow…

Let’s start with an example. First we need something to craft from: plans,
guides, instructions, blueprints, books, recipes, etc. Here we will use a
simple plan for a basic table:


  %%
        Ref: O1
       Name: plan - table, common
      Alias: PLAN TABLE
      Craft: O2
     Skills: CARPENTER→1
  Materials: WOOD→2 NAILS→12
  Equipment: SAW HAMMER PLANE
   Duration: 4H

  These are the plans for making a simple, common, wooden table.
  %%
     Ref: O2
    Name: a wooden table
   Alias: TABLE

  This is a simple, common, wooden table.
  %%


To use the plan you would use one of it’s aliases:

  >craft table

The CRAFT command would look for an item with TABLE as an alias and a craft
attribute. In this case it would find our plan. It would then check to see if
we have the requisite materials, equipment and skills. If we meet the
requirements we make a table and use up the materials needed in the making.
Under the covers the craft attribute is a reference to an item to clone and
give the player. In the above ‘Craft: O2’ refers to the item with ‘Ref: O2’,
similar to how items are put into inventories and containers.

To make the table in the example we would need 2 lots of wood and 12 nails. We
would also need the carpenter skill at level 1 or above. In addition we need
to have a saw, hammer and plane available. Time to make the table would be 4
hours. Sudden idea — this could be modified depending on the difference
between the skill level required and your current skill level.

The skills, materials, equipment and duration attributes would be optional. If
the plan had no time specified the table would be made there and then. If no
skills were specified anyone could make the table with no special skills. If
no materials were specified then no materials would have to be collected
before making the table.

Omitting all of the optional attributes would be the simplest crafting system.
Find or buy the plan and use it to make something. You could setup crafting
stations, for example a smithy or a mill. Then you could specify SMITHY or
MILL as the equipment required and assume all the necessary tools are
available there. You just have to visit the right place when crafting an item.

On the other hand, things could get very complex.

In the table example there may be a plan, guide or instructions for wood and
nails:


  %%
        Ref: O3
       Name: plan - wood, sawn
      Alias: PLAN WOOD
      Craft: O4
     Skills: LUMBERJACK→1
  Materials: TREE
  Equipment: AXE SAW
   Duration: 4H

  This is a guide on felling trees and turning the lumber into sawn planks.
  %%
     Ref: O4
    Name: some rough wood planks
   Alias: WOOD

  These are some rough, sawn wood planks.
  %%
        Ref: O5
       Name: plan - nails, iron
      Alias: PLAN NAILS
      Craft: O6
     Skills: BLACKSMITH→1
  Materials: IRON-ORE
  Equipment: FURNACE
   Duration: 4H

  This is a plan for making nails from iron ore.
  %%
     Ref: O6
    Name: some iron nails
   Alias: NAILS

  These are some blank iron nails.
  %%


Now you have the option of buying the wood and nails or making them yourself.
If you make them yourself you could sell them to other players or shopkeepers.
Depending on the item being crafted materials could be difficult to acquire or
could only be crafted.

What about crafting a better table?


  %%
        Ref: O7
       Name: plan - table, ornate
      Alias: PLAN ORNATE TABLE
      Craft: O8
     Skills: CARPENTER→3
  Materials: TABLE
  Equipment: CHISEL GOUGE MALLET KNIFE
   Duration: 4H

  These are the plans for making an ornately carved wooden table.
  %%
     Ref: O8
    Name: an ornate wooden table
   Alias: TABLE

  This is an ornately carved wooden table.
  %%


Now you can turn a simple table into an ornate one, if you are a skilled
enough carpenter — level 3 or above. You just need to craft or buy a simple
table first.

There is also the question of where the tools and equipment come from. Can you
buy them or do you have to craft them? Some equipment may be very specific and
hard to acquire, like glassware for alchemy.

When deciding on your own crafting system you could mix the simple and complex
styles. Simple things are easy to craft and complex things are difficult. Of
course the chain of crafting things in order to be able to craft other things
could be a very long and complex one.

Implementing crafting, sans material quantities and skills, is quite simple
and probably an evening of programming. However, there is one fly in the
ointment — isn’t there always? The parser is going to need to understand
qualifiers.

The parser has always needed to understand qualifiers and I’ve put off doing
the coding for it. What is a qualifier? It’s the ‘red’ in ‘red apple’. For
example if we have two apples, one red and one green, we should be able to say
‘GET RED APPLE’ or ‘GET GREEN APPLE’.

Why do we need this? If we say ‘GET PLAN’ which plan do we mean? We need to be
able to say ‘GET TABLE PLAN’ or even ‘GET ORNATE TABLE PLAN’ as well as ‘CRAFT
TABLE’ or ‘CRAFT ORNATE TABLE’. We might even have small tables, large tables,
round tables, small round tables, large round tables — you get the idea I
hope. Modifying the parser also means updating the command processing so that
commands can understand what the parser is telling them.

Now that is a lot of work :(

I also want to make a change so that aliases starting with a hash ‘#’ symbol
are for internal use only and not player use. Hacking on the parser would seem
to be a sensible time to make the change.

For now I can implement crafting as a proof of concept, but I’m guessing it’s
going to be a bit unwieldly without the parser changes. Before I go ahead I’d
like to hear what other people think of our crafting ideas. Is this the sort
of crafting you would like to see in WolfMUD?

As always, I welcome comments and suggestions: diddymus@wolfmud.org

*sigh* Just as I was putting this to bed thought of something else. Making a
note here least I forget. Should you be able to learn some plans, recipes,
etc. while others need to be at hand to use? Maybe the player learns a plan
after using it a number of times? This falls under the bigger umbrella of
player knowledge, where players can learn things but also forget things if the
knowledge is not used. Yes, I have big plans…

--
Diddymus


  Up to Main Index                           Up to Journal for January, 2019