Python · Old YGOPro protocol · Stage 2

YGOACCESS

A bot client that turns raw duel traffic into decisions.

Connect to compatible YGOPro servers as a normal player, parse legal actions, and route every choice through one shared model for bots, LLMs, and humans.

decision_request.json
{
  "source": "MSG_SELECT_CARD",
  "state": "GameState@42",
  "legal_actions": [
    { "id": 0, "card": "..." },
    { "id": 1, "card": "..." }
  ],
  "adapter": "llm | human"
}
Experimental buildCTOS ↔ STOC
Protocol target
Old YGOPro
Source of truth
Server + ocgcore
Runtime
Python 3.11+

ONE CLIENT. MULTIPLE DECISION PATHS.

YGOAccess owns the network and state boundary, then exposes decisions without duplicating duel truth.

01WIRE

Protocol client

Frames CTOS packets, parses STOC traffic, and follows room, ready, duel, side, catchup, and rematch flows.

02STATE

Legal action model

Normalizes core messages into GameState and structured legal Action choices instead of leaking packet details upward.

03HUMAN

Human control

Projects the same decision requests into CLI and web interfaces for inspection, testing, and direct play.

04LLM

Model-ready adapters

Provides a shared decision boundary for deterministic fallback, review flows, and knowledge-backed LLM policies.

05TRACE

Runtime diagnostics

Captures replay, state, request, and response evidence to make protocol behavior auditable.

06DECK

Knowledge packs

Associates deck-specific context with model policies while keeping legality controlled by the duel server.

FROM WIRE TO INTENT

Each layer has one job. GameState remains the only duel-state truth; adapters project it for different operators.

01

TCP / STOC / MSG

Old-protocol server traffic

02

Protocol + parser

Framing, decoding, legal actions

03

GameState

Canonical duel state

04

Decision layer

Normalized decision requests

05

LLM / Human

Policy and interface adapters

!Adapters project state. They never maintain a second version of the duel.

STAGE 2, IN PROGRESS

The protocol foundation works across a broad set of flows. The current focus is tightening parity and completing the shared decision layer.

Available now

  • Old-protocol packet framing
  • Deck parsing and update encoding
  • Room-to-duel lifecycle
  • Broad STOC and MSG parsing
  • Fallback, CLI and web policies
  • Replay and diagnostics capture

Still evolving

  • Complete protocol coverage
  • Full old-client legality parity
  • Stronger field-state merging
  • Complete Stage 2 decision layer
  • Production-grade LLM policy

YGOAccess does not implement card rules locally. The connected server and ocgcore decide legality.

RUN A CLIENT

Requires Python 3.11 or newer. Connect it to an existing compatible server and provide a YDK deck.

Install for developmentPOWERSHELL
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -e .[dev]
Launch from configurationPOWERSHELL
python run_bot.py --config duelbot.toml