Operations

There are two different type of operations: Basic level (create,delete,set,get,info) and game specific operations (summon,forge, etc...)

Server should send info operations in both format. Clients can always interpret info about create,etc.. operations and if they know more complex ones they can play suitable animation or NPC can remember somebody stealing etc...

When client wants to do something or get info about something, it sends some operation derived from action. Server usually replies with some operation derived from info, which might embed original action.

Example:
client: forge("jewel_sword","jewels","iron")
server: sight(forge("jewel_sword","jewels","iron")
server: info(create("jewel_sword",length=1.2, etc...))
server: info(set("iron",amount=current-something))
server: info(destroy("jewels"))

When sending operations use parent:"move" instead of id:"move"
Reason: so we can distinguish between operation and object that tells what operation is about and all operations when used are temporary objects anyway (maybe "magical_crunchy_voice_stepping" is not ;-)

Operation tree

root_operation

Attribute list: Bach version:
{
	arg: {},
	arg_names: ["arg"],
	children: ["action", "info"],
	description: "This is base operation for all other
    operations and defines basic attributes. You can use this as
    starting point for browsing whole operation hiearchy. refno refers
    to operation this is reply for. In examples all attributes that
    are just as examples (and thus world specific) are started with 'e_'.",
	from: "",
	future_seconds: 0.0,
	id: "root_operation",
	objtype: "op_definition",
	parents: ["root"],
	refid: "",
	refno: 0,
	seconds: 0.0,
	serialno: 0,
	summary: "Base operation for all operators",
	time_string: "",
	to: ""
}

    

action

Attribute list: Bach version:
{
	children: ["create", "delete", "set", "get", "imaginary"],
	id: "action",
	parents: ["root_operation"],
	summary: "This is base operator for operations that might have effects."
}

    

create

Attribute list: Bach version:
{
	arg_description: "entity describing object that is being created",
	children: ["combine", "divide", "communicate"],
	description: "Map editor is main user for this in client side. Server uses this inside \"info\" operation to tell client about new things.",
	example: [
		"Creating axe instance",
		{
			arg: {
				e_attack: 3,
				name: "Ordinary axe",
				parents: ["axe"]
			},
			from: "map-editor",
			objtype: "op",
			parents: ["create"]
		}
	],
	id: "create",
	parents: ["action"],
	summary: "Create new things from nothing using this operator."
}

    

combine

Attribute list: Bach version:
{
	arg_description: "first argument is entity describing object that is being created and rest argument(s) are entities that are used as raw material.",
	arg_names: ["arg", "args_source"],
	args_source: [],
	children: [],
	description: "This is how normal characters create objects.",
	example: [
		"Creating axe from wood and iron",
		{
			arg: {
				name: "Bjorn's axe",
				parents: ["axe"]
			},
			args_source: [
				{
					id: "Wood_8898"
				},
				{
					id: "Iron_6578"
				}
			],
			objtype: "op",
			parents: ["combine"]
		}
	],
	id: "combine",
	parents: ["create"],
	specification: "atlas_game",
	summary: "Combine existing objects into new objects."
}

    

divide

Attribute list: Bach version:
{
	arg_description: "id of original object and entities describing pieces.",
	arg_names: ["arg", "args_source"],
	args_destination: [],
	children: [],
	description: "One of the pieces might be original object modified.",
	example: [
		"taking money from pile",
		{
			arg: {
				id: "money12345"
			},
			args_destination: [
				{
					e_amount: 10,
					id: "money12345"
				},
				{
					e_amount: 110
				}
			],
			objtype: "op",
			parents: ["divide"]
		}
	],
	id: "divide",
	parents: ["create"],
	specification: "atlas_game",
	summary: "Divide existing object into pieces."
}

    

communicate

Attribute list: Bach version:
{
	arg_description: "communication entity",
	children: ["talk"],
	example: ["see talk"],
	id: "communicate",
	parents: ["create"],
	specification: "atlas_game",
	summary: "Base operator for all kind of communication."
}

    

talk

Attribute list: Bach version:
{
	arg_description: "sentence(s) entity",
	children: [],
	description: "need to relook at that 'Magic voice that steps on something crunchy and makes magic voice which...' -IRC log",
	example: [
		{
			arg: {
				say: "What has happened there?"
			},
			objtype: "op",
			parents: ["talk"]
		},
		"Talking out of game is same, 
except you use player id instead of character id."
	],
	id: "talk",
	parents: ["communicate"],
	summary: "used for talking"
}

    

delete

Attribute list: Bach version:
{
	arg_description: "id of entity to be deleted",
	children: [],
	example: [
		{
			arg: {
				id: "foo_bar_344"
			},
			objtype: "op",
			parents: ["delete"]
		}
	],
	id: "delete",
	parents: ["action"],
	summary: "Delete something."
}

    

set

Attribute list: Bach version:
{
	children: ["move"],
	example: [
		"This one sets HP=50, height=1.8, width=0.3 for object \"9899\"",
		{
			arg: {
				e_HP: 50,
				e_height: 1.8,
				e_width: 0.3,
				id: "9899"
			},
			objtype: "op",
			parents: ["set"]
		}
	],
	id: "set",
	parents: ["action"],
	summary: "Sets attributes for existing entity."
}

    

move

Attribute list: Bach version:
{
	arg_description: "entity with id and new position",
	children: [],
	description: "More about <a href=\"move.html\">movement here</a>",
	example: [
		"Movement conversation example:",
		{
			arg: {
				id: "9899",
				loc: "11",
				pos: [12.3, 3.0, 0.0]
			},
			from: "9899",
			objtype: "op",
			parents: ["move"],
			serialno: 123
		},
		"Reply from server",
		{
			arg: {
				arg: {
					id: "9899",
					loc: "11",
					pos: [12.3, 3.0, 0.0]
				},
				from: "9899",
				objtype: "op",
				parents: ["set", "move"],
				refno: 123,
				seconds: 19036033149.3,
				serialno: 1230,
				time_string: "0612-01-05 10:59:09.3"
			},
			from: "9899",
			objtype: "op",
			parents: ["info", "sight"],
			refno: 123,
			seconds: 19036033149.3,
			serialno: 1231,
			time_string: "0612-01-05 10:59:09.3",
			to: "9899"
		}
	],
	id: "move",
	parents: ["set"],
	specification: "atlas_game",
	summary: "Change position"
}

    

get

Attribute list: Bach version:
{
	arg_description: "id of target entity",
	children: ["perceive", "login"],
	example: [
		{
			arg: {
				id: "elf_type_id_45"
			},
			objtype: "op",
			parents: ["get"]
		},
		"<h4>Browsing operator hierarchy example:</h4>
<p>
First start from operator hierarchy root (root_operation):",
		{
			arg: {
				id: "root_operation"
			},
			objtype: "op",
			parents: ["get"]
		},
		"Answer might be:",
		{
			arg: {
				children: ["action", "info"],
				id: "root_operation",
				summary: "Base operator for all operatios"
			},
			objtype: "op",
			parents: ["info"]
		},
		"Then you can ask about action and info:",
		{
			arg: {
				id: "action"
			},
			objtype: "op",
			parents: ["get"]
		},
		{
			arg: {
				id: "info"
			},
			objtype: "op",
			parents: ["get"]
		},
		"Etc..."
	],
	id: "get",
	parents: ["action"],
	summary: "Generic operation for getting info about things."
}

    

perceive

Attribute list: Bach version:
{
	arg_description: "object to be perceived",
	children: ["look", "listen", "sniff", "touch"],
	example: [
		{
			arg: {
				id: "elf_3545"
			},
			objtype: "op",
			parents: ["perceive"]
		}
	],
	id: "perceive",
	parents: ["get"],
	specification: "atlas_game",
	summary: "Generic base operation for perceiving things by eyes, ears, etc..."
}

    

look

Attribute list: Bach version:
{
	arg_description: "target entity",
	children: [],
	example: [
		{
			arg: {
				id: "elf_3545"
			},
			objtype: "op",
			parents: ["look"]
		},
		"Conversation examples:<br> When you connect to
        server you need to look to see things. Server sends all new
        things that appear and all changes that you see (like
        movement). But it's clients responsibility to make first
        update of what it sees. Reason is that only client knows what
        it has cached.

        <p>First look can leave argument out (it's by default empty): then server sends
        appropriate top level object for current scheme.",
		{
			from: "Bjorn_10",
			objtype: "op",
			parents: ["look"],
			serialno: 5
		},
		"Server reply:",
		{
			arg: {
				contains: ["tavern_2", "market_3", "home_4", "axe_5", "Nisuf_6", "Miyora_7", "home_8", "smithy_9", "Bjorn_10"],
				id: "world_0",
				parents: ["world"],
				pos: [0.0, 0.0, 0.0],
				stamp: 19035660000.0
			},
			from: "Bjorn_10",
			objtype: "op",
			parents: ["set", "sight"],
			refno: 5,
			seconds: 19035667864.4,
			serialno: 100,
			time_string: "0612-01-01 05:31:04.4",
			to: "Bjorn_10"
		},
		"Client looks at contains attribute of above object
        and then looks for those objects in turn:",
		{
			arg: {
				id: "Nisuf_6"
			},
			from: "Bjorn_10",
			objtype: "op",
			parents: ["look"],
			serialno: 6
		},
		"And then server tells you more about it:",
		{
			arg: {
				e_drunkness: 0.0,
				e_status: 1.0,
				id: "Nisuf_6",
				loc: "world_0",
				name: "Nisuf",
				parents: ["farmer"],
				pos: [20.0, 50.0, 300.0],
				stamp: 19035650000.0,
				summary: "ordinary farmer"
			},
			from: "Nisuf_6",
			objtype: "op",
			parents: ["set", "sight"],
			refno: 6,
			seconds: 19035667864.4,
			serialno: 105,
			time_string: "0612-01-01 05:31:04.4",
			to: "Bjorn_10"
		}
	],
	id: "look",
	parents: ["perceive"],
	summary: "Looking at something"
}

    

listen

Attribute list: Bach version:
{
	arg_description: "target entity",
	children: [],
	example: [
		{
			arg: {
				id: "elf_3545"
			},
			objtype: "op",
			parents: ["listen"]
		}
	],
	id: "listen",
	parents: ["perceive"],
	summary: "Listen (something)"
}

    

sniff

Attribute list: Bach version:
{
	arg_description: "target entity",
	children: [],
	example: [
		{
			arg: {
				id: "flower_3545"
			},
			objtype: "op",
			parents: ["sniff"]
		}
	],
	id: "sniff",
	parents: ["perceive"],
	summary: "Sniff something"
}

    

touch

Attribute list: Bach version:
{
	arg_description: "target entity",
	children: [],
	example: [
		{
			arg: {
				id: "cloth_3545"
			},
			objtype: "op",
			parents: ["touch"]
		}
	],
	id: "touch",
	parents: ["perceive"],
	summary: "Touch something"
}

    

login

Attribute list: Bach version:
{
	arg_description: "entity with player name and password attribute",
	children: ["logout"],
	description: "For more about <a href=\"login.html\">out of game atlas here</a>",
	example: [
		{
			arg: {
				id: "JoeBlatz",
				password: "Rqv67.%"
			},
			objtype: "op",
			parents: ["login"]
		},
		"Conversation examples:<br> When you connect to
        server you either need to have account already or make
        one. Here is \"start by creating account\" -example:",
		{
			arg: {
				id: "player74",
				parents: ["player"],
				password: "player_password"
			},
			objtype: "op",
			parents: ["create"],
			serialno: 1
		},
		"What if you already had account by that name? Then
        reply from server could be something like this (1 argument:
        message, 2 argument: original operation):",
		{
			arg: {
				message: "Account id already exist",
				op: {
					arg: {
						id: "player74",
						parents: ["player"],
						password: "player_password"
					},
					objtype: "op",
					parents: ["create"],
					serialno: 1
				}
			},
			objtype: "op",
			parents: ["error"],
			refno: 1,
			seconds: 19036033149.3,
			serialno: 4,
			time_string: "0612-01-05 10:59:09.3"
		},
		"For more about error operation see 
        <a href=\"#error\">error operation definition</a>.
        <br><br>
        If account login went OK them you might receive something
        like:",
		{
			arg: {
				characters: ["Bjorn_1"],
				id: "player74",
				parents: ["player"],
				password: "player_password"
			},
			objtype: "op",
			parents: ["info"],
			refno: 1,
			seconds: 19036033149.3,
			serialno: 2,
			time_string: "0612-01-05 10:59:09.3"
		},
		"If you don't have character, then you need to
        create one. Creating character is similar to how you create
        account.",
		{
			arg: {
				e_sex: "male",
				name: "Nisuf",
				parents: ["farmer"],
				summary: "ordinary farmer"
			},
			objtype: "op",
			parents: ["create"],
			serialno: 2
		},
		"Result of character creation is same as with account
        creation, only resulting object differs."
	],
	id: "login",
	parents: ["get"],
	summary: "Operation for logging into server"
}

    

logout

Attribute list: Bach version:
{
	arg_description: "entity with player name",
	children: [],
	example: [
		{
			arg: {
				id: "JoeBlatz"
			},
			objtype: "op",
			parents: ["logout"]
		},
		"Most useful with server<->server communication
        telling that certain connection is not anymore pertinent"
	],
	id: "logout",
	parents: ["login"],
	summary: "Operation for logging out"
}

    

imaginary

Attribute list: Bach version:
{
	arg_description: "event that is supposed to happen",
	children: [],
	example: [
		{
			arg: {
				id: "some_unimplemented_action"
			},
			objtype: "op",
			parents: ["imaginary"]
		}
	],
	id: "imaginary",
	parents: ["action"],
	summary: "When something is not yet implemented in server, then character can pretend to do something ;-)"
}

    

info

Attribute list: Bach version:
{
	children: ["perception", "error"],
	example: [
		{
			arg: {
				e_msg: "Here is some info"
			},
			objtype: "op",
			parents: ["info"]
		}
	],
	id: "info",
	parents: ["root_operation"],
	summary: "This is base operator for operations that tell you info about objects or events."
}

    

perception

Attribute list: Bach version:
{
	arg_description: "perceived thing",
	children: ["sight", "sound", "smell", "feel"],
	description: "Base operator for all kind of perceptions",
	example: [
		"Usually derived operations are used, general notes
                   on perceptions and actions:
                   <ul>
                   <li><b>action.from:</b> who made character to do something
                   (talk for example); usually character itself, but
                   not always, examples: 
                   <ul>
                     <li>atlas_irc_gateway does puppet characters it
                         has created for each nick from irc side
                     <li>admin teaches NPCs by making them to talk
                         itself
                     <li>possession by spell
                   </ul>
                   
                   <li><b>action.to:</b> same as character always

                   <li><b>perception.from:</b> who produced this perception:
                   always character itself (for example sound of talk)
                   (well... unless you are made to hallusinate ;-)

                   <li><b>perception.to:</b> you (unless you are
                   server, then it's target to receive perception)
                   </ul>

                   <b>conclusion:</b> should use perception.from instead of
                   inner action.from to decide who produced result
                   <br>
                   See <a href=\"#sound\">sound</a> and 
                       <a href=\"#sight\">sight</a>
                   for actual examples
                ",
		{
			arg: {
				id: "tree_8374"
			},
			objtype: "op",
			parents: ["perception"]
		}
	],
	id: "perception",
	parents: ["info"],
	specification: "atlas_game",
	summary: "Character perceives something."
}

    

sight

Attribute list: Bach version:
{
	arg_description: "object or event character sees",
	children: ["appearance", "disappearance"],
	example: [
		"See <a href=\"#perception\">perception</a> operation too<br>
                Common example:",
		{
			arg: {
				id: "grass1",
				stamp: 989.24
			},
			objtype: "op",
			parents: ["sight"]
		},
		"Reply for looking at 'grass1':",
		{
			arg: {
				area: [
					["grass1.p.0", "grass1.p.1", "grass1.p.2"],
					["grass1.p.0", "grass1.p.2", "grass1.p.3"]
				],
				contains: ["path1", "tree1"],
				id: "grass1",
				p: [
					[0.0, 0.0],
					[10.0, 0.0],
					[10.0, 10.0],
					[0.0, 10.0]
				],
				parents: ["terrain"],
				summary: "Grass plains"
			},
			objtype: "op",
			parents: ["sight"]
		},
		"Event example:",
		{
			arg: {
				arg: {
					id: "orc_23498",
					loc: "grass1",
					pos: [0.5, 3.0, 0.0]
				},
				objtype: "op",
				parents: ["move"]
			},
			objtype: "op",
			parents: ["sight"]
		}
	],
	id: "sight",
	parents: ["perception"],
	summary: "Character sees something"
}

    

appearance

Attribute list: Bach version:
{
	arg_description: "object or event character sees",
	children: [],
	example: [
		{
			arg: {
				id: "grass1",
				stamp: 989.24
			},
			objtype: "op",
			parents: ["appearance"]
		}
	],
	id: "appearance",
	parents: ["sight"],
	summary: "Character sees something appearing: it literally appears or has it come in visible range"
}

    

disappearance

Attribute list: Bach version:
{
	arg_description: "object or event character sees",
	children: [],
	example: [
		{
			arg: {
				id: "grass1",
				stamp: 989.24
			},
			objtype: "op",
			parents: ["disappearance"]
		}
	],
	id: "disappearance",
	parents: ["sight"],
	summary: "Character sees something disappearing: it literally disappears or has it gone too far to be visible"
}

    

sound

Attribute list: Bach version:
{
	arg_description: "thing character heard",
	children: [],
	example: [
		"See <a href=\"#perception\">perception</a> operation too<br>
                   Example (every operation might have from, 
to and time tags, not only this operation):",
		{
			arg: {
				arg: {
					say: "What has happened there?"
				},
				objtype: "op",
				parents: ["talk"]
			},
			from: "sentry_34",
			objtype: "op",
			parents: ["sound"]
		}
	],
	id: "sound",
	parents: ["perception"],
	summary: "Character hears something"
}

    

smell

Attribute list: Bach version:
{
	arg_description: "thing character smells",
	children: [],
	example: [
		"Example (every operation might have from, 
to and time tags, not only this operation):",
		{
			arg: {
				e_smell: "sweet"
			},
			from: "flower_34",
			objtype: "op",
			parents: ["smell"]
		}
	],
	id: "smell",
	parents: ["perception"],
	summary: "Character smells something"
}

    

feel

Attribute list: Bach version:
{
	arg_description: "thing character touches",
	children: [],
	example: [
		{
			arg: {
				e_surface_type: "rough",
				id: "cloth_34"
			},
			objtype: "op",
			parents: ["feel"]
		}
	],
	id: "feel",
	parents: ["perception"],
	summary: "Character feels something (with fingers usually)"
}

    

error

Attribute list: Bach version:
{
	arg_description: "objects describing what went wrong<br>
First argument is error entity which describes error.
Second argument is operation which is wrong (not given if not relevant).",
	children: [],
	example: [
		"Client sent \"foo\" -operation which server rejects",
		{
			arg: {
				message: "Uknown operation foo",
				no: 42,
				op: {
					arg: {
						e_bar: "do some foo thing by using bar"
					},
					objtype: "op",
					parents: ["foo"],
					serialno: 123
				}
			},
			objtype: "op",
			parents: ["error"],
			refno: 123
		}
	],
	id: "error",
	parents: ["info"],
	summary: "Something went wrong"
}

    

Aloril
Last modified: Fri Dec 10 19:38:56 EET 1999