Changes between Version 14 and Version 15 of ProtocolOne


Ignore:
Timestamp:
Jun 10, 2011 10:38:46 AM (13 years ago)
Author:
jherwitz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ProtocolOne

    v14 v15  
    11wiki: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 server commands and queries return the "commandid", which references the wiki:Command structure. Compound functions return values as specified.
    22
     3= Usage =
     4To use quagents, you must have the Client directory in your filesystem. Create a class with a main method, and import the [[Necessary Classes]]. To create a Quagent, simply create a new client using the Client constructor. The constructor takes one argument, which must specify the IP address of the Quagents server.
     5''Example''
     6 {{{Client quagent = new Client("127.0.0.1");}}}
     7
     8Now, before the bot spawns, you may use initial commands to specify certain static parameters. These are optional. When you have completed these modifications, call the ready() function to initiate the live section of the session.
     9''Example''
     10 {{{quagent.ready();}}}
     11
     12During the live section, you are free to call any live commands, queries, queue management commands, or compound functions you wish. See the following for a list of currently supported functions.
     13''Example''
     14{{{ //this will make the Quagent face and shoot at the user.
     15while(true){
     16  client.faceEntityDirectoin(0,1);
     17  client.fireWeapon(1);
     18}}}}
     19
     20
     21= Initial Commands =
     22 {{{name(String name)}}}
     23  Specifies the Quagent's ingame name.
     24 {{{ready()}}}
     25  Spawns the bot, opens the nonblocking socket reader, and starts the live section of the game. This is the final command called during the initial section.
     26 {{{ready(String[] opcodes)}}}
     27   Same core functionality as above. The ''opcodes'' array specifies operations which the user wishes to be automatically updated on through the wiki:datastream.
    328= Live Functions =
    429 '''[[ProtocolZero]] Actions'''
     
    5984   Displays a depth mapping representing the bot's current "sight".
    6085 
    61  
     86= Class structure = 
     87
    6288= Example behaviors =
    63 
     89* These assume that the Client object (which represents a Quagent) has been instantiated as "client".
     90'''Take an depthmap of the player.'''
     91 {{{client.face