Scripting languages in Diku muds
A pair of newsgroup posts summarizing the state of the art in scripting languages on Diku-derived muds.
MobProgs in Merc 2.2 are based on the easyacts system in Worlds of Carnage and are acknowledged as such in the Merc documentation. Carnage had a policy of not releasing its acts system, but recently a second mud, Cythera, has started up using that system. The script functionality includes scipt attachment to objects, rooms, and mobiles, communication between same, many different types of triggers, alteration of attributes, and definition of new global flags. The scripts are read in with the area files, but I am not sure if they are stored in separate files like Merc’s are. Cythera was begun by the fellow who was probably the top quest designer on Carnage (BadMood). Acts were written, as I understand it, by DimWit.
Stock MobProgs are conceptually derived from Carnage’s acts but are nowhere near as elegant. They require a separate file for each script, attach scripts only to NPCs, and were released with several major bugs including a memory leak. Several muds wrote patches in order to use the system, but I do not know whether they are available on the Net anywhere. I assume they are. MobProgs handle basic triggering capability and randoms and not much else.
Addendum in February 1998:
I recently learned that MobProgs were written by Satin, an immortal on Carnage who along with Damion Schubert, aka Heretic, formed a mud after Carnage went down in early 1992 for an extended period of time. The mud never got off the ground, but MobProgs were written in an attempt to emulate Carnage’s acts system.
Damion went on to become a key designer on Meridian 59, and Satin for a time worked for him on that project as well. It’s difficult to underestimate the impact that Worlds of Carnage had on the commercial mud arena, as key people from both Ultima Online and Meridian 59 started their serious mudding careers there.
DikuII’s script system, DIL, as described in the web pages for Valhalla, is a very C-like script that makes use of things such as #defines in order to get global flagging. It has process monitoring and control, triggering, attribute altering, etc, and from the looks of it attaches to mobiles only, though I could be wrong. DIL has not been released to the general public. My personal opinion, in looking at it on the web pages, is that it is fairly cumbersome due to its close relationship with C. Powerful, but ease of use goes out the window. A big plus seems to be the ability to handle independent (i.e. not predefeined) variables. You can see samples of DIL at:
http://valhalla.wtm.tudelft.nl/valhalla/dil-quest.html
Dil and mobile definition, as in the next example, are intimately related.
LegendMUD was founded by a set of players from Worlds of Carnage, and developed their own acts system back in 93 and 94. Scripts attach to mobiles or to rooms, and are loaded with the area file, in fact with each mobile or room as part of the basic definition of the mobile or room. They support pre-emptive and cooperative multitasking, inter-script messaging, global flags of several kinds, attribute alteration, map alteration, procedures, and many triggers including time-based ones for repetitive behaviors. They lack independent variables although these can be simulated with either flags or with setting and checking values in object, room, or mobile attributes. They also do not have a true process control system, and rely on use of the flags to handle it. Legend’s acts are also not available in the public domain. The web page at
has some descriptions of the acts system’s capabilities, although it does not show any sample code. I’m a tad biased towards Legend’s code as I am an implementor there. It’s more elegant than Carnage’s and although ut lacks an important area of functionality in terms of lacking trigger attachment to objects, greater sophistication has been derived from it in the actual building. Legend’s acts were written by Sadist, who is now lead programmer on Origin’s Ultima Online project.
Several other muds have cited having private script systems, many derived from MobProgs. I don’t know anything about these other places, but would appreciate it if descriptions like the above were posted–I am rather curious.
Got an email asking me to clarify some of the things I said in my earlier post about scripting languages. So below will be some clarification.
However, I’ve also had a bunch of people show up at LegendMUD asking for our acts system, and asking the other immortals (who didn’t even know I had posted) to please give them samples or the actual code for the system. Sorry, but Legend’s code is not released to the public domain… I posted as part of my ongoing interest in mud design and in order to help out the guy who asked the original question, not in order to get the immorts at Legend pestered. š
In any case, here’s the requested clarification:
MobProgs in Merc 2.2 are based on the easyacts system in Worlds of Carnage and are acknowledged as such in the Merc documentation. Carnage had a policy of not releasing its acts system, but recently a second mud, Cythera, has started up using that system. The script functionality includes scipt attachment to objects, rooms, and mobiles,
Meaning that you can have actions or such performed by any of those three things. In the case of Carnage, it means a newbie sword that talks to you and offers advice, rooms that can spring traps on you, and mobiles that can talk.
communication between same,
So when you walk into a room, it makes a bunch of rats, then it tells the rats to go hug you. The rats get the message from the room and hug you.
many different types of triggers,
Trigger being a thing you set up to react to a specific event happening. 99% of the time, what you are triggering off of is something someone said. So you the player say ‘Hello’ and your mobile has a trigger that when it hears hello, it says ‘hiya, dope’ back. There are dozens of possible things to react to–just in the case of speech, for example, you can have it react to any text, to questions only (ASK command), to whispers only (WHISPER), to tells, to emotes, to socials, etc.
alteration of attributes,
Meaning setting of stats and values on pcs, npcs, and objects.
and definition of new global flags.
Meaning being able to define a new flag like KILLED_THE_HARPY when you kill the harpy, so that the vampire can check it and say ‘You scum, you killed the harpy!’
Stock MobProgs are conceptually derived from Carnage’s acts but are nowhere near as elegant….MobProgs handle basic triggering capability and randoms and not much else.
A basic action being of course the ability to randomly do things, such as every once in a while hiccup.
DikuII’s script system, DIL, as described in the web pages for Valhalla, is a very C-like script that makes use of things such as #defines in order to get global flagging.
#defines are a C thing. They are sort of global definitions you set up in advance in order to establish ‘ground rules.’
It has process monitoring and control,
Meaning that once you have the script going for the phoenix quest and players are going through it, you can just check periodically to see if the phoenix quest code is still running, and if it’s been idle, set it all back to the starting point.
triggering, attribute altering, etc, and from the looks of it attaches to mobiles only, though I could be wrong. DIL has not been released to the general public. My personal opinion, in looking at it on the web pages, is that it is fairly cumbersome due to its close relationship with C. Powerful, but ease of use goes out the window. A big plus seems to be the ability to handle independent (i.e. not predefeined) variables. You can see samples of DIL at:
Meaning it looks like it can do math, and store numbers it arrives at, or store strings. For example, say you are doing a quest that entails changing your strength. With DIL you can store the old strength value, and then put it back later because your code remembers what it was.
support pre-emptive and cooperative multitasking,
A given mob of room can have several scripts going at once, and set a priority on them. In this case, you can have for example, a trigger on ‘leaves north.’ But if you set the highest priority on it, it will happen before the person is even allowed to leave north–it in effect happens before he left. You can have mobs who regularly walk a particular trade route, but will still be able to converse with you while they are walking.
inter-script messaging,
Like the rats above. You can also use this for recursion, using messages to the self in order to keep triggering a script over and over again while certain conditions are still met (this works because of the multitasking ability).
global flags of several kinds, attribute alteration, map alteration,
You can alter the exits and flags and so on of a room.
procedures,
You can set up routines that are global and callable by any room or any mobile.
and many triggers including time-based ones for repetitive behaviors.
Do something every hour, or only at 12 o’clock every seventh day…
They lack independent variables although these can be simulated with either flags or with setting and checking values in object, room, or mobile attributes.
Meaning Legend would not be able to ‘remember’ the strength you had before, though it could set up a thing whereby it uses a recursive routine to increment a value on a dummy object, thereby setting the strength as the number stored on that object, and later checking it by examining the object. Much more cumbersome.
They also do not have a true process control system, and rely on use of the flags to handle it.
Meaning that unlike DIL, you can’t tell whether or not the quest is ongoing unless some mobile sets a flag on itself when the quest starts, so that you can check if it’s set before allowing someone else to start the quest.
Hope this clarifies everything for those who might not have understood what I was trying to say.