The documentation says that clients receive a detected
event when one of their ships has been seen or radared. This is stated in /server/README.md and /server/DETAILS.md. However, there is no detected
event when a bot has been seen.
Here is an example from a match between two (Javascript) dummy AIs:
server output:
Round 24
EVENTS [ { event: 'move', botId: 0, pos: { x: 3, y: -5 } },
{ event: 'move', botId: 1, pos: { x: 5, y: -13 } },
{ event: 'move', botId: 2, pos: { x: -6, y: 7 } },
{ event: 'move', botId: 3, pos: { x: -7, y: -7 } },
{ event: 'move', botId: 4, pos: { x: -8, y: 9 } },
{ event: 'move', botId: 5, pos: { x: -13, y: 1 } },
{ event: 'see', source: 2, botId: 4, pos: { x: -8, y: 9 } },
{ event: 'see', source: 4, botId: 2, pos: { x: -6, y: 7 } } ]
Anon.JS: [ { botId: 0, type: 'move', pos: { x: 3, y: -6 } },
[...]
bot 1 output:
RECV <- {"type":"events","roundId":24,"config":{"bots":3,"fieldRadius":14,"move":2,"startHp":10,"cannon":1,"radar":3,"see":2,"maxCount":200,"asteroids":0,"loopTime":1000,"noWait":true},"you":{"name":"Anon.JS","teamId":0,"bots":[{"botId":0,"name":"Anon.JS 1","teamId":0,"alive":true,"pos":{"x":3,"y":-5},"hp":10},{"botId":1,"name":"Anon.JS 2","teamId":0,"alive":true,"pos":{"x":5,"y":-13},"hp":10},{"botId":2,"name":"Anon.JS 3","teamId":0,"alive":true,"pos":{"x":-6,"y":7},"hp":10}]},"otherTeams":[{"name":"Anon.JS","teamId":1,"bots":[{"botId":3,"name":"Anon.JS 1","teamId":1,"alive":true},{"botId":4,"name":"Anon.JS 2","teamId":1,"alive":true},{"botId":5,"name":"Anon.JS 3","teamId":1,"alive":true}]}],"events":[{"event":"move","botId":0,"pos":{"x":3,"y":-5}},{"event":"move","botId":1,"pos":{"x":5,"y":-13}},{"event":"move","botId":2,"pos":{"x":-6,"y":7}},{"event":"see","source":2,"botId":4,"pos":{"x":-8,"y":9}}]}
SEND -> {"type":"actions","roundId":24,"actions":[{"botId":0,"type":"move","pos":{"x":3,"y":-6}},{"botId":1,"type":"move","pos":{"x":5,"y":-12}},{"botId":2,"type":"move","pos":{"x":-6,"y":8}}]}
bot 2 output:
RECV <- {"type":"events","roundId":24,"config":{"bots":3,"fieldRadius":14,"move":2,"startHp":10,"cannon":1,"radar":3,"see":2,"maxCount":200,"asteroids":0,"loopTime":1000,"noWait":true},"you":{"name":"Anon.JS","teamId":1,"bots":[{"botId":3,"name":"Anon.JS 1","teamId":1,"alive":true,"pos":{"x":-7,"y":-7},"hp":10},{"botId":4,"name":"Anon.JS 2","teamId":1,"alive":true,"pos":{"x":-8,"y":9},"hp":10},{"botId":5,"name":"Anon.JS 3","teamId":1,"alive":true,"pos":{"x":-13,"y":1},"hp":10}]},"otherTeams":[{"name":"Anon.JS","teamId":0,"bots":[{"botId":0,"name":"Anon.JS 1","teamId":0,"alive":true},{"botId":1,"name":"Anon.JS 2","teamId":0,"alive":true},{"botId":2,"name":"Anon.JS 3","teamId":0,"alive":true}]}],"events":[{"event":"move","botId":3,"pos":{"x":-7,"y":-7}},{"event":"move","botId":4,"pos":{"x":-8,"y":9}},{"event":"move","botId":5,"pos":{"x":-13,"y":1}},{"event":"see","source":4,"botId":2,"pos":{"x":-6,"y":7}}]}
SEND -> {"type":"actions","roundId":24,"actions":[{"botId":3,"type":"move","pos":{"x":-8,"y":-5}},{"botId":4,"type":"move","pos":{"x":-10,"y":9}},{"botId":5,"type":"move","pos":{"x":-12,"y":0}}]}
Two of the bots see each other, and each AI receives a see
event, but there's no detected
event anywhere.
Of course it's not necessary to send a detected
event when a bot has been seen, because the AI will receive a see
event which notifies it that an enemy bot is within range of sight and can then infer that the enemy bot saw one of the own bots as well.
However, the actual behaviour should be reflected in the documentation.