A quagent is Quake II bot that is controlled by an external program. The Quake
II quagent mod provides a quagent server which quagent client code connects
at port 33333 in order to establish a communications channel. Instructions to,
and feedback from, the bot is accomplished using a simple text based protocol
(see Quagent Protocol Reference). The idea is that
programs can be written external to the Quake code base, with no knowledge whatsoever
of the Quake game engine code, in any programming language. All that is required
is a basic socket connection and knowledge of the quagent messaging protocol.
Quagent programs provide the "brain" for the bot and through commands
and feedback provide a system for the bots behaviors and reflexes.
mapping tip: Walk the client (FPS) around and type ]viewpos at the console. It will give your current world vector coord. (see console commands for more commands) |
tip: You can add a quagent.config file to control which character and location your bot will be spawned as well as adding some other items to rooms in the map. (see Quagents Configuration File for more info) |
Find the code at examples/QuagentControl in the source bundle (see Obtaining
the Code).
Example code snippet from QuagentControl.java which show the code that controls
the direction buttons for walking the quagent bot around.
out is a handle on an output socket. (See Quagents Protocol
Reference) Each directional button simply prints a quagent command to the
communications channel (the socket) to control the bots behavior. A more sophisticated
quagent would analyse feedback from the bot and make decisions about how to
direct the bots behavior beyond simply steering.
// private void moveForward(){ } } } } |
(see the instructions for running the QuagentControl example)
Command cmd = new WalkCommand(20); this.send(cmd); Query query = new RadiusQuery(33.0); Answer answer = this.ask(query); if (answer.isOK()) { ... extract answer.value() and cast or something ... }