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.

Notifications system

The old tell_player() function has been removed, and a better notifications system is in place. Now, every time we need to notify a player of something really important, we can use:

user->add_notification(type, message);

and it will be shown after the pending actions and current heart_beat has finished (this is useful to avoid situations like entering a new room, something happening and the message would be shown before seeing what is inside said room).

The player will be able to show their last notifications:

> notifications

╒════════════════║ Past notifications β•žβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β••
β”‚ β”‚
β”‚ 19:18:55 - You are connected! Welcome to Hexagon. β”‚
β”‚ β”‚
β•˜β•β••/════════════════════════════════════════════════════╛

Autumn/winter 21/22 updates

Changes and updates to the mudlib in its v21.09 Beregost version. This post will be updated during the autumn and winter:

Player updates

  • kill command translated.
  • Help about multiple commands reviewed, use help <cmd> to test it.
    • coder/exec
    • coder/exits
    • coder/grep
    • coder/home
    • coder/ls
    • coder/peace
    • coder/sar
    • login/finger
    • login/who
    • player/kill
    • player/look
    • player/prompt
  • Some ascii/ansi improvements using box drawing characters.
  • Unarmed combat messages heavily improved.
  • Notifications system for players: use notifications command.
  • alias and nicknames reviewed.

Developer updates

Summer 2021 updates

Changes and updates to the mudlib in its v20.09 Anduin version. This post will be updated during the summer:

Player updates

  • Aliases reviewed and working.
  • clear command working.

Developer updates

Winter 20/21 updates

Changes and updates to the mudlib in its v20.09 Anduin version. This post will be updated during the winter:

Player updates

  • Fixed error with characters command.
  • Help for several commands has been reviewed and/or translated.
  • demo-fantasy game included.

Developer updates

  • Fixed some errors with several commands:
    • tail
    • ls
    • grep
    • sar
    • peace
    • exits
  • Door system reviewed and translated.
  • Coder room translated.
  • Some problems with find_match solved.
  • Races and gender translated and reviewed.
  • /lib/npc.c -> /lib/monster.c
  • Some fixes with load_chat() and load_a_chat() in npcs.
  • actions reviewed, private_actions added. actions command.
  • Everything related with read_mess reviewed and translated.
  • vaults fixed and translated.
  • ious working. ioulist command.
  • contents, event_enter/exit and hud working.
  • write/say and tell_object/tell_room reviewed.
  • Npc combat and death reviewed and working.