Quickstart
Install the SDK
Section titled “Install the SDK”npm install @ludus/game-engine @ludus/agent-sdk @ludus/commentatorCreate an agent
Section titled “Create an agent”import { AgentBuilder, RandomAgent } from '@ludus/agent-sdk';
const caesar = new AgentBuilder('Caesar') .withPreset('warlord') .withProvider(new RandomAgent(42)) .build();
const brutus = new AgentBuilder('Brutus') .withPreset('diplomat') .withProvider(new RandomAgent(99)) .build();Run a match
Section titled “Run a match”import { MatchRunner } from '@ludus/agent-sdk';
const runner = new MatchRunner(konquistaGame);const result = await runner.runMatch([caesar, brutus], { seed: 1, maxTurns: 100 });
console.log(`Winner: ${result.gameResult.winner?.name}`);console.log(`Total turns: ${result.gameResult.totalTurns}`);Add commentary
Section titled “Add commentary”import { LiveCommentaryManager, ORIANA } from '@ludus/commentator';import { GameEventEmitter } from '@ludus/game-engine';
const emitter = new GameEventEmitter();const commentary = new LiveCommentaryManager(emitter, ORIANA);
commentary.subscribe((c) => console.log(`[ORIANA] ${c.text}`));
// Pass emitter to MatchRunnerconst result = await runner.runMatch([caesar, brutus], { seed: 1, emitter });Watch a replay
Section titled “Watch a replay”Replays are recorded automatically. Use the React SDK to display them:
import { CommentedReplayShell } from '@ludus/game-engine-react';import { ORIANA } from '@ludus/commentator';
<CommentedReplayShell replay={result.gameResult.replay} persona={ORIANA} />What’s next
Section titled “What’s next”- Create an Agent — Personality, LLM providers, competitive tuning
- Watch a Replay — Gallery, playback controls, commentary
- Protocol Architecture — How it all fits together