[MUD-Dev] Scripting Languages and Magic

Jonathon Duerig tyrecius at xmission.com
Mon Oct 6 15:12:51 CEST 2003


On Fri, 3 Oct 2003, gbtmud wrote:

> I am attempting to write a new MUD codebase, and I was wondering
> what people have done as far as magic systems. Specifically, I was
> thinking of letting the players define spells in a custom
> scripting language so that new spells could be created on the
> fly. My question is, has anyone already done this? If so, what
> pitfalls are there to avoid, and what functionality should I
> add/subtract? Any input would be helpful on this.

I have given some thought to this kind of thing. One notion that I
like is to have magic be a series of 'words'. Each 'word' would be
like the next instruction in a very simple byte code. One of the
things I like about this is that one could randomize what the words
mean. Each player would then discover new words and then experiment
to find out what they did.

There are a number of possible problems with this approach. First,
one would have to design the words such that any combination is a
valid spell of some kind. It would be very annoying for the player
constantly receive the message 'that is not a valid spell, try
again'.  Second, one would have to design the system so that things
like infinite loops don't result in infinite rewards. Third, one
would have to remove other possible abuses.

Here is a simple example of how somebody might try this out. Let's
assume that the following commands exists:

  twice: Execute the following instructions (until endBlock) twice.

  fire: Burn target.

  endBlock: end the current block of instructions.

Lets assume that each word executed takes time, and costs mana,
depending on the word. This would also be a solution to the infinite
loop problem.  The spell ends when they are out of mana.

I am also assuming that in this example system, the end of a spell
incantation has an infinite number of optional endBlocks. And
effects just add to some total until when the spell ends, all of
them are unleashed at once.

Let's say that I see the word for 'fire' as 'teltra', I see the word
for 'twice' as 'loxar', and I see the word for 'endBlock' as 'mel'.

I am a player and I already know what 'teltra' does. I've just
learned the word 'loxar', and I want to know what it does. Here is
how a session might go (the comments after the // is why that
response is given):

  chant loxar
    --Nothing seems to happen-- // loxar has no effect on its own.

  chant teltra at monster
    --The monster's fur is charred-- // teltra does some amount of
    fire damage

  chant teltra loxar at monster
    --The monster's fur is charred-- // same damage. The twice
                                     // doesn't modify the fire.

  chant loxar teltra at monster
    --The monster is badly burned-- // Twice as much damage since
                                    // the fire is added twice.

The last two commands might take longer and cost more manna. After
this session, the player might do something like this:

  rename teltra fire

  rename loxar enhance

Because teltra does fire damage and loxar seems to enhance the
command after it. After some more experimentation, the player might
realize a more exact meaning for loxar. Once those commands are
done, the player can use 'fire' and 'enhance' in chants rather than
'teltra' and 'loxar'.

This kind of thing could be a lot of fun, but it would take much
work to ensure that no abuse was possible.

---
"...the best tasting food, the most wonderful music, and the most
beautiful picture you have ever experienced..." -Amy Peterson
_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list