CI / build (push) Successful in 48s
GameBehavior asks YGOL_Decide at every prompt (idle, battle, cards, chain, yes/no, option, position, place, sum, counter, declarations, sort, RPS, turn order). With no decision maker for the seat (the default) that is the GameAI call and nothing else: the built-in brain plays as before (same 100-duel report, 67-33, avg 18.5). With one, the prompt goes out as a plain-data DecisionRequest (kind, legal options, the seat's DuelView) and comes back as option indices; null, an exception or an illegal answer falls back to the executor. A seat picks a maker with Decisions=<name> (arena: --decisionsA/--decisionsB); DecisionMakers.Register names one. Built in: builtin and random (a random legal answer read from the request's JSON). Tests: 100 random-vs- random duels through the seam with 0 errors and no fallback, builtin == no token, Smart beats random 100-0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2.4 KiB
2.4 KiB
yugioh-legacy-bots
Instructions for any coding agent. README.md has the layout, the contract, the build and the release.
- The game runs this code. Solo duels in the Unity game play these bots, so a change here is a change to the game. Keep game behaviour identical unless the owner asked for the change; say in the commit what a player would see differ.
- The library stays what Unity compiles:
netstandard2.1,LangVersion 9, no Unity, Mono or Microsoft.Data reference, no package it would ship (Newtonsoft is compile-time only). Anything it needs from the game goes throughBotHost(src/YGOLegacy.Bots/Host/BotHost.cs); a new need is a new member there, written inREADME.md's contract table and filed for the Unity repo. - Every bot decision goes through the decision seam (
IDecisionMaker,src/YGOLegacy.Bots/Decisions/, asked byGameBehavior.YGOL_Decide). A new prompt handler asksYGOL_Decide, never the GameAI directly. With no decision maker the seam must do nothing but call the GameAI, so the built-in brain plays as before. Request and answer types stay plain, JSON-friendly data; a field that changes meaning bumpsDecisionRequest.version. Remote brains (LLM, ML) are decision makers registered by name, never edits to WindBot or the hosts. - Keep the namespaces the game uses (
WindBot.*,YGOSharp.*,YGOLegacy.Bot,YGOLegacy.Characters,YGOLegacy.Services) and WindBot's[YGOL]markers on fork changes. - Everything builds in Docker (
Dockerfile); there is nodotneton the hosts.docker build --target test .before every push, and confirm the Gitea Actions run is green after it. - The engine is a release, never built here:
engine.jsonis the pin,build/fetch-engine.shfetches it. - Releases are tags (
vX.Y.Z, with itsCHANGELOG.mdsection). Never re-upload a release; tag a patch. Tag only when asked. - The Unity repo (
donny/yugioh-legacy-unity) is never changed from here: work for it is a ticket. It is huge: never a full or blob-less clone, nevergit grepover it; read single files through the Gitea API or a depth-1, tree-less fetch of only the paths needed. - Test data is
tests/fixture/game, built bytests/fixture/make-fixture.pyfrom the Unity repo'sData/at a named commit. Never read or write the live Syncthing shares (/mnt/nvme/syncthing/). - Git remote: Gitea (
donny), never GitHub. Default branchmain.