Spring/summer 2023 updates

Changes and updates to the mudlib in its v1.21.09 Beregost version. This post will be updated during the spring and summer:

Player updates

  • Weapons reviewed, and lots of weapons added to the Fantasy Demo game.
  • hold/unhold working with weapons.
  • Armours reviewed, and lots of armours added to the Fantasy Demo game.
  • wear/unwear working with clothes and armours.
  • Shields reviewed, and shields added to the Fantasy Demo game.
  • Weapon combat fully functional.
  • Basic materials for items (weapons, clothes, armours, etc).
  • Passed out when equipping reviewed (doesn’t happen recently logged in). equip reviewed.
  • Multiple commands reviewed:
    • user/games
    • user/characters
    • player/help
    • player/look
    • player/prompt
    • player/commands
    • player/glance
    • player/kill
    • player/prompt
    • player/retire
    • player/configuration
    • player/score
    • player/sheet
    • player/verbose
    • player/inform
    • player/bury
    • player/cost
    • player/stop (for both stop fights and stop following)
    • player/encumbrance
    • player/bravery
    • player/condition
    • player/money
    • player/combats
    • player/past
    • player/inventory
    • player/whomai
    • player/away
    • player/consider
    • player/travel
    • player/equipment
    • player/pov
    • player/time
    • player/grope
    • player/map
  • Health messages (health points, death, etc) fully translated.
  • Handle actions (take, drop, give) reviewed and fully translated en/es.
  • Hearthstone item reviewed.

Developer updates

  • Multiple commands reviewed (see issue #15)
    • coder/goto
    • coder/stats
    • coder/cat
    • coder/clone
    • coder/exits
    • coder/exec
    • coder/grep
    • coder/head
    • coder/more
    • coder/restore
    • coder/rm
    • coder/sar
    • coder/tail
    • coder/uptime
    • coder/armours
    • coder/discard
    • coder/actions
    • coder/backup
    • coder/cp
    • coder/cplines
    • coder/du
    • coder/ioulist
    • coder/load
    • coder/malloc
    • coder/mkdir
    • coder/mv
    • coder/rmdir
    • coder/ls
    • coder/nls
    • coder/visible
    • coder/invisible
    • coder/multi
    • coder/resistances
  • Command handler translation and meta commands (use command rehash to reload all of them).
  • Multilanguage commands: now commands are not executed depending on their file names, but a list of alias specified in code.
  • Some tests done with binary connections.
  • Start working with packages: pieces of code included in the /packages directory, each of them with its own code, license, authors, etc.
    • Each package can add their own commands automatically.
  • Issue tracker working (new package).
  • Start working with a test suite (new package).

Some more info in a timeline in the about page

Trying to add some more useful information to the web, and adding some documentation, this week I made a timeline of the versions of ccmudlib and Hexagon, and added it to the About page so you can take a look.

Not very game-designy, but is a way of stating the amount of work done during the last years, giving dates and specific versions. Maybe some other time I could add some more information there.

Pubs fully operative and translated

The same as shops were reviewed the last month, now pubs have been reviewed and they are operative. You can take a look to the ones included with de Fantasy Demo game:

  • /demo-fantasy/areas/elfereth/rooms/z19.c
  • /demo-fantasy/areas/erken/rooms/BP.c
  • /demo-fantasy/areas/naduk/rooms/ap.c

One in every town.

The Slaughtered Lamb [-n-].
Arak is here.
Sign.

By default, a sign will be added:

> read sign
You read a text written in common:

┌───────────────────────────────────────────────────────────────┐
│ │
│ Food: │
│ Ribs : 3 bronze coins │
│ │
│ Soft drinks: │
│ │
│ Alcoholic beverages: │
│ Firewater : 1 gold coin and 1 silver coin │
│ Whisky : 1 gold coin │
│ Dark Beer : 3 bronze coins │
│ Liquor : 2 bronze coins │
│ │
│ Use 'buy' to ask for what you want. │
│ │
└───────────────────────────────────────────────────────────────┘

And the commands can be used in any pub:

> buy liquor
You drink a glass of liquor.
> [ HPs: 172 (172) EPs: 172 (154) ]

As you can see, food and drinks will recover partially your health, and alcoholic beverages will also affect your perception, getting your character drunk.

Tinkering with the vt100 terminal

I’ve been playing with the vt100 terminal specification (read some history on the wikipedia, or some very technical specification), and although is not very useful yet, some results can be shown:

Has to be really, really improved, as at the moment everything is recalculated with every message sent to the user, but now we can draw characters (and boxes with content) at any position of the screen. Obviously, this will be optional and configurable per player, as not every mud client is compatible with the vt100 spec.

The worldmap is fake for now, but I’m working on it 😃

Some ascii/ansi improvements using box drawing characters

Some improvements have been done in the way some ascii/ansi characters are handled, doing extensive use of the new chr() efun, so problems wouldn’t appear with the encodings of the files in the mudlib. Still a work in progress with some things to polish, but seems to be working.

Take a look to the frames handler that renders boxes with text inside if you need more info, in /lib/handlers/frames.c.

Shops fully operative and translated

At last, shops have been reviewed and they are operative. You can take a look to the ones included with de Fantasy Demo game:

  • /demo-fantasy/areas/erken/rooms/BS.c
  • /demo-fantasy/areas/naduk/rooms/as.c
  • /demo-fantasy/areas/elfereth/rooms/z21.c

One in every town.

Shop.

You are in a small shop in the town of Erken. Here you can buy or sell every
kind of item with any value.

There is one obvious exit: -north-
Sign.

By default, a sign will be added:

> read sign
You read a text written in common:

┌───────────────────────────────────────────────────────────────────────────┐
│ │
│ Shop information: │
│ - 'list' to see items on sale. │
│ - 'browse <item>' to see item information (price, condition, etc). │
│ - 'buy <item>' to buy something. │
│ - 'value <item>' to know how much will be paid for something you own. │
│ - 'sell <item>' to sell something you own. │
│ │
└───────────────────────────────────────────────────────────────────────────┘

And the commands can be used in any shop:

> list
We have fourteen items available:

Just one Cape (1)
A great selection of Daggers (9)
Two Shirts (2)
Just one Small wooden shield (1)
Just one Trousers (1)

Max amount: 30000, current amount: 1136

> buy cape
You buy Cape for 4 bronze coins and 8 copper coins.

Cron + Crontab

Originally, in the old library used on MudOS, we had a handler for functionalities that needed to run periodically, which was timed.c. Its operation was somewhat archaic, requiring each desired action to be added manually in a not very intuitive way, and it wasn’t very maintainable. We have evolved this towards a cron + crontab system, similar to how it operates in an operating system.

Now there exists a crontab file at /save/crontab, structured like this:

# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined in a single line,
# indicating when it will be run, the file that will be
# loaded, and the function that will be called in the file.
#
# Times are indicated using values for
# minute (m), hour (h) or use '*' in these fields (for 'any').
# */n for minutes or hours divisible by n

# m h object function

# every minute, update_ventures
* * /lib/handlers/ventures.c update_ventures

# old timed.c checks
*/5 * /lib/handlers/cron.c do_stat_users
* * /lib/handlers/cron.c do_idletest
* * /lib/handlers/cron.c net_dead_purge


# every 23 hours, auto reboot
0 */23 /lib/handlers/shutdown.c auto_reboot

# every ten minutes, check if a reboot is needed
# if we are using too much memory
*/10 * /lib/handlers/shutdown.c memory_reboot

Each line represents a functionality to be executed periodically, a specific function from a specific file. The left values represent the minutes and hours of the day. For example, we can see that 0 */23 means that at hours divisible by 23 (actually eleven at night, we could have just put 23), at 0 minutes (exactly eleven o’clock), an auto_reboot will be executed. Or that every hour (*), at minutes divisible by 10 (*/10), it will check if we are using too much memory or not, to potentially force another reboot.

It doesn’t have as many configuration options as a real crontab from an operating system, but it’s probably sufficient for the needs we’re going to have, and it’s already much better than what we had before.