Basic operator hierarchy

Introduction About goal for operator hierarchy
Browsing hierarchy How to find operations server supports
op Base operator for all operators
action Base operator for operations that might have effects
create Create new things from nothing.
combine Combine existing objects into new objects
divide Divide existing object into pieces
spell Optional tag
communicate Base operator for all kind of communication
talk Talking
set Sets all attributes for existing entity
change Change existing attributes and/or create new attributes
move Change position
attack Generic attack operation
use Use something
skill Use some skill
get Generic operation for getting info about things
perceive Generic base operation for perceiving things by eyes, ears, etc...
look Looking at something
listen Listen something
sniff Sniff something
touch Touch something
login Logging into server
delete Delete something
info Info about something
perception Character perceives something
sight Character sees something
appear Something appears
disappear Something disappears
sound Character hears something
smell Character hears something
sense Character senses something (with fingers usually)
imaginary Placeholder for perceptions of unimplemented actions
error Something went wrong

Introduction

Goal is to achieve generality and specificity at the same time. If client doesn't understand some operation it can lookup at operation hierarchy for more generic format and use that. It might lose some useful info but it doesn't usually lose all. For examples see article for CB#3.


op

Base operator for all operators. No parameters. Useful starting point for browsing operator hierarchy.


action

Derived from op.

Base operator for operations that might have effects.


create

Derived from action.

Create new things from nothing using this operator. Map editor is main user for this.

Parameters: entity describing object that is being created.

Example:

      <op><id>create</id>
        <from>map-editor</from>
        <ent>
          <attr name="name">Axe</attr>
          <attr name="attack" type="int">3</attr>
        </ent>
      </op>
    

combine

Derived from create.

Combine existing objects into new objects. This is how normal characters create objects.

Parameters: entity describing object that is being created and list of entities that are used as raw material.

      <op><id>combine</id>
        <ent>
          <type><id>axe</id></type>
          <attr name="name">Bjorn's axe</attr>
        </ent>
        <id>Wood_8898</id>
        <id>Iron_6578</id>
      </op>
    

divide

Derived from create.

Divide existing object into pieces. One of the pieces might be original object modified.

Parameters: id of original object and entities describing pieces.

      <op><id>divide</id>
        <id>money12345</>
        <ent>
          <id href="money12345"/>
          <attr name="amount" type="int">10</attr>
        </ent>
        <ent>
          <attr name="amount" type="int">110</attr>
        </ent>
      </op>
    

spell

Optional operation, derived from combine.


communicate

Derived from create. Base operator for all kind of communication.

Parameters: communication entity.

Example: see talk


talk

Derived from communicate.

Parameters: sentence(s) entity.

Example:

      <op>
        <id>talk</id>
        <ent>
          <attr name="say">What has happened there?</attr>
        </ent>
      </op>
    
Talking out of game is same, except you use player id instead of character id.


set

Derived from action.

Sets all attributes for existing entity.

Parameters: entity with id and new attributes.

Example:

      <op><id>set</id>
        <ent>
          <id>9899</id>
          <attr name="HP" type="int">50</attr>
          <attr name="height" type="float">1.8</attr>
          <attr name="width" type="float">0.3</attr>
        </ent>
      </op>
    

change

Derived from set.

Change existing attributes and/or create new attributes. Difference with set is that anything previously defined attribute not touched here remain intact.

Parameters: entity with id and changed/new attributes.

Example:

      <op><id>change</id>
        <ent>
          <id>9899</id>
          <attr name="HP" type="int">30</attr>
        </ent>
      </op>
    

move

Derived from change.

Change position.

Parameters: entity with id and new position.

Example:

      <op><id>move</id>
        <ent>
          <id>9899</id>
          <loc><id>11</id><coords>12.3,3,0</coords></loc>
        </ent>
      </op>
    
More about movement here.


attack

Maybe move_attack instead of attack? Or maybe let attack derive from change and let move_attack derive from attack and move?

Derived from move.

Generic attack operation. Base operation for game specific attack operations (like swing, etc...).

Parameters: entity with id, new position and maybe some other attributes.

Example:

      <op><id>attack</id>
        <ent>
          <id>Sword_99</id>
          <loc><id>Opponent_11</id><coords>0.2,0.2,1.5</coords></loc>
        </ent>
      </op>
    

use

Needs more thinking! Derived from change.

Use something (tool, skill etc..)

Parameters: id for entity to be used.

Example:

      <op><id>use</id>
        <id>magic_wand_24</id>
      </op>
    

skill

Needs more thinking! Derived from use.

Use some skill.

Parameters: id of skill and optionally target id's.

Example:

      <op><id>skill</id>
        <id>woodworking</id>
        <id>target_wood_24903</id>
      </op>
    

get

Derived from action.

Generic operation for getting info about things.

Parameters: id of target entity.

Example:

      <op><id>get</id>
        <id>elf_type_id_45</id>
      </op>
    
Browsing operator hierarchy example:

First start from operator hierarchy root (see op):

      <op>
        <id>get</id>
        <id>op</id>
      </op>
    
Answer might be:
      <op>
        <id>info</id>
        <ent>
          <id>op</id>
          <instance>
            <id>action</id>
            <id>info</id>
          </instance>
          <attr name="description">Base operator for all operators</attr>
        </ent>
      </op>
    
Then you can ask about action and info:
      <op>
        <id>get</id>
        <id>action</id>
      </op>
      <op>
        <id>get</id>
        <id>info</id>
      </op>
    
Etc...


perceive

Derived from get.

Generic base operation for perceiving things by eyes, ears, etc...

Parameters: id of target entity.

Example:

      <op><id>perceive</id>
        <id>elf_3545</id>
      </op>
    

look

Derived from perceive.

Looking at something.

Parameters: id of target entity (optional).

Example:

      <op><id>look</id>
        <id>elf_3545</id>
      </op>
    

listen

Derived from perceive.

Listen (something).

Parameters: id of target entity (optional).

Example:

      <op><id>listen</id>
        <id>elf_3545</id>
      </op>
    

sniff

Derived from perceive.

Sniff something.

Parameters: id of target entity (optional).

Example:

      <op><id>sniff</id>
        <id>flower_3545</id>
      </op>
    

touch

Derived from perceive.

Touch something.

Parameters: id of target entity.

Example:

      <op><id>touch</id>
        <id>cloth_3545</id>
      </op>
    

login

Derived from get.

Operation for logging into server.

Parameters: entity with player name and password attribute.

Example:

      <op><id>login</id>
        <ent>
          <id>JoeBlatz</id>
          <attr name="password">Rqv67.%</attr>
        </ent>
      </op>
    

delete

Derived from action.

Delete something.

Parameters: id of entity to be deleted.

Example:

      <op><id>delete</id>
        <id>foo_bar_344</id>
      </op>
    

info

Derived from op.

Info about something.

Parameters: info entity.

Example:

      <op><id>info</id>
        <ent>
          <attr name="msg">Here is some info</attr>
        </ent>
      </op>
    

perception

Derived from info.

Character perceives something.

Parameters: perceived thing. Base operator for all kind of perceptions.

Example:

      <op><id>perception</id>
        <id>tree_8374</id>
      </op>
    

sight

Derived from perception.

Character sees something.

Parameters: object or event character sees.

Common example:

      <op><id>sight</id>
        <ent>
          <id>grass1</id>
          <stamp>989.24</stamp>
        </ent>
      </op>
    
Reply for looking at 'grass1':
      <op><id>sight</id>
        <ent>
          <id>grass1</id>
          <type><id>terrain</id></type>
          <contains>
            <id>path1</id>
            <id>tree1</id>
          </contains>
          <attr name="description">Grass plains</attr>
          <attr name="polygon" type="coords">
            <coords>0,0</coords><coords>10,0</coords><coords>10,10</coords>
            <coords>0,10</coords><coords>0,0</coords>
          </attr>
        </ent>
      </op>
    
Event example:
      <op><id>sight</id>
        <op><id>move</id>
          <ent>
            <id>orc_23498</id>
            <loc><id>grass1</id><coords>0.5,3.0,0.0</coords></loc>
          </ent>
        </op>
      </op>
    

appear

Derived from sight.

Character sees something appearing: it literally appears or has it come in visible range.

Parameters: object or event character sees.

Example:

      <op><id>appear</id>
        <ent>
          <id>grass1</id>
          <stamp>989.24</stamp>
        </ent>
      </op>
    

disappear

Derived from sight.

Character sees something disappearing: it literally disappears or has it gone too far to be visible.

Parameters: object or event character sees.

Example:

      <op><id>disappear</id>
        <ent>
          <id>grass1</id>
          <stamp>989.24</stamp>
        </ent>
      </op>
    

sound

Derived from perception.

Character hears something.

Parameters: thing character heard.

Example (every operation might have from, to and time tags, not only this operation):

      <op><id>sound</id>
        <from>sentry_34</from>
        <ent>
          <attr name="say">What has happened there?</attr>
        </ent>
      </op>
    

smell

Derived from perception.

Character smells something.

Parameters: thing character smells.

Example (every operation might have from, to and time tags, not only this operation):

      <op><id>sound</id>
        <from>flower_34</from>
        <ent>
          <attr name="smell">sweet</attr>
        </ent>
      </op>
    

sense

Derived from perception.

Character senses something (with fingers usually).

Parameters: thing character senses.

      <op><id>sound</id>
        <ent>
          <id>cloth_34</id>
          <attr name="surface type">rough</attr>
        </ent>
      </op>
    

imaginary

Derived from perception.

When something is not yet implemented in server, then character can pretend to do something ;-)

Parameters: event that is supposed to happen.

Example:

      <op><id>imaginary</id>
        <id>some_unimplemented_action</id>
      </op>
    

error

Derived from info.

Something went wrong.

Parameters: entity describing what went wrong.

Example:

      <op><id>error</id>
        <ent>
          <attr name="op" type="id">foo</attr>
          <attr name="msg">Unknown operation</attr>
        </ent>
      </op>
    

Aloril
Last modified: Mon Jul 5 16:53:08 EEST 1999