Summary
Extend the bot API to allow bots to send a buffer of queued moves along with the
current move. If the server does not receive a new move in time for a subsequent
tick, it will execute the next move from the bot's provided queue.
Proposed API Change
Add an optional queued_moves field to the move payload:
{
"action": "move",
"direction": "up",
"queued_moves": ["left", "down", "right"]
}
Server Behavior
- If a new move is received, execute it and clear the queue.
- If no new move is received within the tick, dequeue and execute the next move.
- If the queue is empty, fall back to current default behavior.
Backward Compatibility
Fully additive and optional — bots that don't use queued_moves are unaffected.
Implementation Steps
- Update WebSocket handler to parse/store the optional
queued_moves field.
- Modify game loop to consume queued moves when no new move is received.
- Update API.md to document the new field and behavior.
Summary
Extend the bot API to allow bots to send a buffer of queued moves along with the
current move. If the server does not receive a new move in time for a subsequent
tick, it will execute the next move from the bot's provided queue.
Proposed API Change
Add an optional
queued_movesfield to the move payload:{
"action": "move",
"direction": "up",
"queued_moves": ["left", "down", "right"]
}
Server Behavior
Backward Compatibility
Fully additive and optional — bots that don't use queued_moves are unaffected.
Implementation Steps
queued_movesfield.