wiki:ProtocolOne

Version 12 (modified by jherwitz, 13 years ago) (diff)

--

wiki:ProtocolOne is the Java API which abstracts the Quagents game engine to a simple Java interface. The underlying clientside structure maintains data transmission, reception, and storage, while providing an API of all possible Quagent actions. Currently implemented functions are described below. It is important to note that these functions mirror those defined in wiki:ProtocolZero, with slight syntactic differences. For all functions, a priority '1' indicates a "now" command and a priority "0" indicates a "then" command (this will change to a more intuitive format soon). All commands return the "commandid", which references the wiki:Command? structure.

Live Functions

Server Actions

move(double dir, double dist, double speed, int obstacles, int priority)

Moves by dist towards the dir direction at speed quickness. obstacles indicates whether the bot automatically maneuvers past simple obstacles.

move(double dir, double speed, int obstacles, int priority)

Moves indefinitely towards the dirdirection at speed speed. obstacles is as above.

jump(double dir, double speed, int priority)

Jumps in the dir direction at speed speed.

rangeFinder(int type, int range, double rot, double azi, int priority)

Uses the wiki:rangefinder? at a limited range, in the direction specified by the rotational angle and the azimuthal angle. The rangefinder is of the given type (for more information, see wiki:rf).

rangeFinder(int type, int priority)

Uses the wiki:rangefinder? in the current direction, with no limit on distance. Uses the specified type.

rangeFinder(int priority)

Uses the wiki:rangefinder? in the current direction, with no limit on distance. Uses type #1.

rotate(double rot, double azi, int priority)

Rotates the bot by a rotational angle rot and an azimuthal angle azi.

Command Queue management

forgetAllTasks(int priority)

Clears Quagent command queue, acts as a soft "reset".

pause(int time, int priority)

Pauses command queue execution.

pop(int priority)

Pops action off command queue.

skip(int priority)

Skips the next AI game frame. For more information, see wiki:sk.

Server Queries

currentHealth(int priority)

Returns Quagent's current health.

maxHealth(int priority)

Returns Quagent's maximum health. Kind of useless.

currentArmour(int priority)

Returns Quagent's current armor. British spelling adds class.

maxArmour(int priority)

Returns Quagent's maximum armor.

canSee(int entityid, int priority)

Returns true if entity can see specified wiki:entityid?. Also returns distance, yaw, and pitch to target.

wiki:ProtocolOne Actions (compound functions)

  
= Example behaviors =