Repository navigation
How do I integrate my own game? What's the minimum GameAdapter? #2
Answered
by
SkYContact
SkYContact
asked this question in
Q&A
|
I have my own game engine (C++). What exactly do I need to implement to run it on the farm? |
Answered by
SkYContact
Sep 24, 2026
Replies: 1 comment
|
Implement ten hooks on struct MyGame : inferfarm::GameAdapter {
void NewGame(uint64_t seed, bool we_first) override; // reset cleanly = determinism
bool AdvanceToDecision() override; // run to your next decision point
void AssembleInto(inferfarm::SlotWriter& slot) override; // write features into the slot row (zero-copy)
int CollectOutputs(inferfarm::OutputDest* d, int cap) override;
void ApplyResult() override; // consume outputs, advance the game
bool IsDone() override; int Outcome() override; // 1 win / 0 loss / -1 draw
inferfarm::ITlsFrame* TlsFrame() override; // only if you have cross-yield thread_local state
};Three contracts (one page,
An untrained model runs the whole pipeline (seed protocol, direct slot writes, bank batching, determinism gates) — swap in your trained model later without touching the adapter. |
0 replies
Answer selected by
SkYContact
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Implement ten hooks on
inferfarm::GameAdapter. The full Gomoku adapter is ~200 lines (examples/gomoku/gomoku_adapter.h). The skeleton: