Skip to content

Feature Request: Add support for queued moves in the bot API #39

@revodavid

Description

@revodavid

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

  1. Update WebSocket handler to parse/store the optional queued_moves field.
  2. Modify game loop to consume queued moves when no new move is received.
  3. Update API.md to document the new field and behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions