Daniel Lepage on 25 Dec 2003 00:27:18 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[spoon-discuss] Robot Commands


Here are some rough sketches for the wording around sending commands to robots. This is a quick, ugly version I just threw together now; I intend to make it nicer later.

Thoughts?

{{
__Commands__


There exist objects called Commands, and Game Documents called Command Descriptions.

A Command Description describes a valid type of Command. A Description consists of a Command, a Cost, a set of Choices (which may be empty), and a list of effects.

Commands must be submitted in the following format:
<time>: <name> <choice1> <choice2>...
where <time> is either 1, 2, or 3, <name> is the name of the command, and <choice1>,<choice2>,etc. are the choices required by the Command Description (if there are any). The number signified by the <time> is the Command's Time.

The admin may designate an email address and/or webform to which Commands should be sent; if e does not, e is assumed to have designated eir own email address. Commands sent to other addresses are ignored. All Commands submitted during an nweek are private information until the end of that nweek.

At the end of each nweek, the administrator should make all Commands sent during the previous nweek available for public review. The Commands sent during a given nweek are said to be the Active commands for the next nweek; the set of all Commands legally sent to a given robot during a given nweek is that Robot's Command Queue for the next nweek.

At the end of the first checking period of each nweek, every Robot executes all commands in its Command Queue that were sent with Time=1, in the order in which they were submitted. At the end of the second checking period of each nweek, every Robot executes all commands in its Command Queue that were sent with Time=2, in the order in which they were submitted. At the end of the third checking period of each nweek, every Robot executes all commands in its Command Queue that were sent with Time=3, in the order in which they were submitted.

When a Robot executes a Command, the following occurs:
If the command has a cost, the Robot pays that cost if able. If it does not have what is needed for the cost, it pays as much of it as it can, and ignores the rest of the command. If it successfully pays the cost, the effects of the Command occur; if any one of them is forbidden by a rule, nonsensical, or impossible, then that effect fails to occur.
}}

Some Sample Command Descriptions:

Name: Move
Cost: 15 Energy
Choose: a direction (N,S,E,W)
Effects: The Robot moves one square in the chosen direction.

Dig
20 Energy
Choose: a direction
The square immediately adjacent to the Robot's location in the chosen direction becomes Empty, if it is Filled, and the Robot moves to that square.

SelfRepair
10 Energy, 5 RUs
Choose: none
The Robot gains 10 hit points, unless this would put it over its MaxHP, in which case it gains hit points up to its MaxHP.


These would be sent as follows, for example:
1. Move N
1. Dig E
2. Move E
2. Move E
2. Dig S
3. SelfRepair
3. Dig S

The above command list would mean:
At the end of the first checking period, do the following in order:
Move to the north.
Dig to the east.
At the end of the 2nd, do these in order:
Move east.
Move east.
Dig south.
At the end of the 3rd, do these in order:
Repair yourself.
Dig south.

If any of these were impossible, it would be skipped - so if the Bot has only 5 energy at the end of the 2nd Checking Period, it wouldn't do anything. Note that if the effects are impossible, the cost is still paid - if something blocks the Bot's motion east at the end of the 2nd checking period, it will still spend 30 energy trying to move east and failing.

--
Wonko

_______________________________________________
spoon-discuss mailing list
spoon-discuss@xxxxxxxxx
http://lists.ellipsis.cx/mailman/listinfo/spoon-discuss