[MUD-Dev] Languages

Miroslav Silovic silovic at srce.hr
Sun May 25 01:21:51 CEST 1997


> [Miro:]
> :> [Clarification: the internal representation is available to the system
> :> (of course!) but not to MUD programmers. They *can* get a decompiled
> :			   ^^^^^^^^^^^^^^^
> :Builtin bytecode disassembler saved my rear end on at least one occasion.
> :And it's not hard to implement (it's great for bytecode compiler debugging).
> 
> Agreed. However, since I compile to a parse tree, rather than to any
> lower-level byte-code, my pretty-printer essentially plays the same role.

That's anoter neat way to handle it. :)

> :Both, as well as tags for text generation (which may be context
> :dependant, as they can include senses). Once you allow each player
> :to 'see' the hypertext depending on its internal status, it has some
> :pretty neat consequences.
> 
> Could you show us an example, in some kind of ASCII-fied form?

Sure.

[actor] {switch value=[sense:magic]:[range:1..5]mumbles something,
pointing a finger toward[default]casts magic missile at} [victim].

Note about syntax: Everything in []'s is evaluated before the message
starts to propagate (in this case, actor and victim). {}'s are
evaluated when they reach the players, and in some cases evaluation
of []'s inside is delayed.

The idea is that everybody in the room will interpret the event
accorting to their ability to sense magic. {switch} will automatically
delay the evaluation of [sense] until the message reaches the actual
player, and then will figure up the strength with which player can
detect particular information in the message (magic, in this case.
[sense] mechanism isn't yet cast in stone and is very easy to
extend). If an observer isn't very sensitive to magic, he will only
see what the caster does with his arms and mouth, otherwise he
gets the complete information.

Now if this message propagates to another room, or to the realm object,
all sense values get lowered, so players looking at the event from
afar have much lower chance to recognize the spell. I have no idea
how it could be done with prints, short of writing 20-50 lines of
code each time you need to print a context sensitive message that
can reach a large number of players.

Oh, for efficiency this is internally compiled to pretty weird
format (basically a tree of strings and lightweight objects),
and decompiled/pretty-printed whenever a player wants to edit it.

> :Good thinking!!! ;)
> 
> Aw, here I was waiting for some flames!
> 

. o O (disarms them every time...)

	Miro



More information about the mud-dev-archive mailing list