[MUD-Dev] Scripting Languages and Magic

Matthew Estes matt at maintree.com
Wed Oct 8 00:28:45 New Zealand Daylight Time 2003

<EdNote: Attribution fixed>

On Fri, 3 Oct 2003 14:12:16 -0700 
gbtmud  <gbtmud at hotmail.com> 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 put some thought into this myself. The issue of allowing
maximal player freedom, while preventing a total lack of balance. To
this end I was inspired by the concept of "dataflow languages". The
basic idea is that you have computational "blocks" with inputs and
outputs, and the ability to hook these up in anyway(including loops,
etc.) you want. The computation "flows" through the system, and its
easy to design a graphical editor for things like this even if you
want(helping the ease of use issue).

This provides lots of ways to solve balance issues. With the proper
components, the system can be capable of anything(if you want that
power), but with careful selection of "control" constructs, the
system can be limited to any level of lameness you want.

There would be two types of blocks in a spell casting system based
on this idea. The first time would be the "control" constructs that
gave the language its "expressive power". The second kind would be
the fun kind: "effects". These would be the normal spell
effects(elemental things like fire, healing effects, movement
effects) but it would also include things like "targetting"
components, and "power" source components(like your mana pool, or
spell components, or something in the environment, or even religious

A couple of ways this could be used to give balance is to let the
"components" be rated based on level, experience, whatever. The
players would have earn up the ability to use certain building
blocks in their spells.

The other way(and the more fun one if you ask me...) is to make
components have a probability of "backfiring" based on a combination
of level, environmental factors, other spells in effect, other
components in the system, the amount/kind of "power" feeding in, and
the amount of power flowing out. The goal would be that, yes, it is
possible to right a spell that would "kill everyone in a 30 mile
radius regardless of level", but the probability this spell will
backfire and cause a hole to open and swallow you instead will FAR
outweigh the chance that someone will succeed in casting it. And if
they ARE high enough level to succeed, well, its probably time for a
server reset :). Seriously though, the design of how components
backfire(and watching it happen...) can be as much fun as the
positive effects of each component. Oh yeah, and the opportunity to
add "safety valve" style components to the system(that affect/hurt
the "forward" flow) is nice too.

Also, with an in-game spell trading system, it offers doors to
players coming up with an economy writing spells.

And to mention it, why not extend this to other players? I mean, I
really enjoyed the way Diablo II made mana useful to every class of
characters, and in a strange way, turning the Diablo II style "skill
trees" in "spell/skill component trees" seems a natural extension of
an idea that I personally enjoyed as well.

Just some thoughts. And hey, if anyone uses this in something, at
least give me some credit, or send me an email letting you know I
inspired you :).

                                                                 Matt Estes
MUD-Dev mailing list
MUD-Dev at kanga.nu

More information about the MUD-Dev mailing list