New patches: [unrevert anonymous**20060310185905] < > { hunk ./doc/protocol.txt 1 -# Starflag Protocol - -It's OSC. Messages are sent by clients to the engine. -Each message is replied to over the same socket as an OSC message or bundle. - -### Public information - -- /world - - /world/size i - - The response to /team/\* - -- /game/join sss (name, team name, password) - - /game/welcome ii (team id, agent id) or /game/full/{team,game} - - Will be allocated an appropriate agent id and told the appropriate team id. - First agent joining from a team name will be allocated an available team id. - -- /team/\* - - /team/*id* rsi (color, name, size) - - /team/*id*/base fffi (position, size) - - The response to /team/*id*/flag - -### Protected information - -Authorization is determined by originating socket, for agent percepts and -actions, or by hash for /game/state. - -- /team/\*/flag - - /team/*id*/flag/position fff (vector) - -- /agent/\*/\*/perceive - - /agent/*team*/*id*/position fff (vector) - - /agent/*team*/*id*/orientation ffff (quaternion) - *This should maybe be rotational vector (is that pitch,yaw,roll, or what?)* - - /agent/*team*/*id*/momentum fff (vector) - - /agent/*team*/*id*/spin fff (vector) - - /agent/*team*/*id*/thrust ffff (current thrust values: pitch, roll, yaw, main-drive) - - /agent/*team*/*id*/flag i (which flag, only present when a flag is held) - -- /agent/\*/\*/thrust ffff (strength for each thruster: pitch, roll, yaw, main-drive) -- /agent/\*/\*/fire - - maybe /agent/*team*/*id*/reloading in which case no shot was fired - -Read [this paper](http://www.cs.cmu.edu/~baraff/sigcourse/notesd1.pdf) for descriptions of -the state variables returned in response to /agent/\*/\*/perceive. In summary, -the state variables here map to the state variables from the article as: - -- position: x(t) -- orientation: q(t) -- momentum: P(t) -- spin: L(t) - -### For UIs - -In addition to the public messages, UIs can get the entire changing game state -with this message. - -- /game/state s (hash) - - The response to /agent/\*/\*/perceive - - The response to /team/\*/flag - - or - - - /unauthorized s "/game/state" - - The hash is a SHA1 hash of the timestamp followed by the pre-shared key. - This is to allow UIs to see the entire world state while preventing agents - from doing so. - - -### Generic Messages -- /game/over is (winning team, winning team's name) -- /ack - - Always sent in reply by the engine except on error; probably accompanied by - other replies. - -- /error ss (error string, pattern) -- /unauthorized s (pattern) - - Sent when not authorized to access that pattern. rmfile ./doc/protocol.txt } Context: [sample engine skeleton hans@fugal.net**20060310183619] [protocol hans@fugal.net**20060309160402] Patch bundle hash: 3480706944aa894f62b3f1c5b483829e65d20790