3031 source-verified AI-built games from 2724 repos, attributed to GPT-6 Astra, GPT-6.1 Sol, Gemini 4 Argon, Claude Opus, Claude Sonnet and Claude Fable
Python ai-gamesai-generatedawesome-listbrowser-gamesclaudeclaude-opusclaude-opus-5-5game-developmentgeminigemini-4gemini-4-argongpt-6-astrallmopen-source-gamesopus-5-5threejsvibe-coding
{
"repo": "shotif/synapse-2076",
"created_at": "2026-10-04T09:41:15Z",
"pushed_at": "2026-10-04T12:27:25Z",
"description": null,
"homepage": null,
"default_branch": "main",
"language": "GDScript",
"readme": "# SYNAPSE-2076\n\n**A hard-systems, turn-based simulation of the compounding effects of AI, energy saturation, labor displacement and machine alignment from 2026 to 2076.** Built in Godot 4.3+ (GDScript), headless-first.\n\n\n\nYou pick one of four asymmetric perspectives: Frontier Lab CEO, Global AI Governance Chair, Emergent Superintelligence or Post-Work Citizen Coalition. You then play 100 semi-annual turns while the other three factions act on their own. They are driven by an LLM when an OpenAI-compatible endpoint is reachable, and by a deterministic heuristic engine otherwise. Six coupled macro-metrics evolve every turn. The world drifts, tips and settles into one of eight civilizational end-states.\n\n| Crisis card | Neural lattice (alignment drift view) | Endgame debrief |\n|---|---|---|\n|  |  |  |\n\n**Play it in your browser at https://shotif.github.io/synapse-2076/.** It needs a desktop browser with WebGL 2 and nothing to install. The web build starts with the heuristic engine driving the other factions; see the [web build note](#llm-decision-layer) to connect a model. Every push to `main` redeploys it.\n\n## Quick start\n\n**Requirements:** the [Godot 4.3+](https://godotengine.org/download) standard build (not .NET). The project uses the GL Compatibility renderer, so it runs on modest GPUs and exports to the web.\n\n1. Open `project.godot` in the Godot editor and press **F5**. The main scene is `res://ui/main_dashboard.tscn`.\n2. Pick a perspective and a seed. Tick **SPECTATE** to watch the AI play your role.\n3. Each turn:\n - Resolve or defer the **crisis card**. A deferred card comes back two turns later, escalated.\n - Select up to **two directives**. Each has an intensity slider from 1.0× to 2.0× of its cost; effects scale as intensity^0.8.\n - Press **EXECUTE DIRECTIVES**.\n4. Toggle the 3D view between **GLOBE** and **NEURAL LATTICE**. Drag to orbit, and use the wheel to zoom.\n5. Click the LLM badge in the header to configure an endpoint.\n\nTo run headless from the command line (the first command builds the `class_name` cache on a fresh clone):\n\n```bash\ngodot --headless --path . --import\ngodot --headless --path . -- --role=CEO --seed=42 # autoplay one campaign, print the end-state\ngodot --headless --path . --script res://tests/headless_sim_test.gd # PRD smoke test: 100 turns x 4 roles\n```\n\n## Testing\n\nAll tests run headless, with no addons and no GPU:\n\n```bash\ntools/run_tests.sh # import, lint every script and shader, unit tests, 100-turn sim\ntools/run_tests.sh --suite=engine --filter=async # one suite, filtered by test name\nGODOT=/path/to/Godot_v4.3-stable_linux.x86_64 tools/run_tests.sh\n```\n\n- **`tests/run_tests.gd`** is a zero-dependency runner. Assertion names mirror [GUT](https://github.com/bitwes/Gut) (`assert_eq`, `assert_almost_eq`, `assert_between`, …), so suites port to GUT by changing their `extends` line.\n- **Suites** live in `tests/unit/`. There are 13 of them with 147 tests:\n - world dynamics fuzzing (2,000 extreme ticks with no NaN or overflow)\n - tech tree, compute physics, factions and the PRD loss conditions\n - heuristic decision trees (PRD 7.4 rules)\n - crisis deck\n - victory matrix\n - the engine state machine, including async providers and stale or invalid decisions\n - prompt validation\n - the LLM service against a real mock HTTP server (timeouts, HTTP 500, garbage JSON, auth failures)\n - headless dashboard smoke tests\n - balance guardrails\n - full 100-turn campaigns in automated and scripted-interactive modes\n- **The wrapper fails on script errors.** `tools/run_tests.sh` fails if Godot prints any `SCRIPT ERROR`, because GDScript runtime errors don't change the exit code.\n- **CI** runs the same script on every push against Godot 4.3 (the minimum) and 4.7 ([`.github/workflows/ci.yml`](.github/workflows/ci.yml)). The suite has also been verified locally on 4.4.1 and 4.6.\n- **Pages** runs it again on every push to `main` before exporting and deploying the web build ([`.github/workflows/pages.yml`](.github/workflows/pages.yml)).\n\nOther tools:\n\n| Command | Purpose |\n|---|---|\n| `godot --headless --path . --script res://tools/monte_carlo.gd -- --runs=60` | Balance report: end-state distribution, termination reasons, verdicts, per-role outcomes and metric trajectories |\n| `godot --headless --path . --script res://tools/check_scripts.gd` | Compile every `.gd`, `.gdshader` and `.tscn` file |\n| `xvfb-run -a godot --path . --rendering-driver opengl3 --resolution 1600x900 --script res://tools/capture_dashboard.gd -- --out=docs/screenshots` | Drive the real UI through a campaign and save screenshots (works without a GPU through Mesa llvmpipe) |\n| `... --script res://tools/capture_scene.gd -- --scene=res://viewports_3d/globe_viewport.tscn --out=/tmp/globe.png` | Render a single scene |\n\n## LLM decision layer\n\nThe three non-player factions are queried through any **OpenAI-compatible `/chat/completions` endpoint**, such as Ollama, vLLM, LM Studio, OpenRouter, OpenAI, or Anthropic's OpenAI SDK compatibility layer.\n\n**Request and response.** Each faction receives:\n\n- a persona and objective\n- its directive catalog with costs\n- a compact JSON snapshot of the world and its own currencies\n- the PRD 7.3 response schema\n\nIt must answer with:\n\n```json\n{\"faction\": \"GOVERNANCE_COUNCIL\", \"turn\": 42, \"rationale\": \"...\", \"selected_action\": \"PASS_AUTOMATION_DIVIDEND\",\n \"resource_expenditure\": {\"political_capital\": 35, \"enforcement_budget\": 15}, \"public_statement\": \"...\"}\n```\n\n**Validation.** Replies are untrusted:\n\n- The JSON is extracted even from prose or code fences.\n- The action must exist in the catalog and be available this turn.\n- Spending is clamped to 2× the base cost, and unknown currencies are dropped.\n- Free text is sanitized and truncated, then BBCode-escaped before display.\n\n**Fallback.** One `HeuristicFallback` decision replaces the reply when:\n\n- the service is offline,\n- the request exceeds the timeout (5,000 ms by default),\n- the server returns an HTTP error, or\n- the reply fails validation.\n\n**Circuit breaker.** Two consecutive transport failures flip the badge to `▲ [LLM OFFLINE - RUNNING HEURISTIC FALLBACK ENGINE]`, and the service re-probes every 60 s.\n\n**Determinism.** Decisions that arrive asynchronously are applied in a fixed faction order, so a seed replays identically regardless of latency.\n\n**Configuration.** Each source overrides the ones above it:\n\n1. Project settings `synapse/llm/*`: enabled, endpoint_url, model_name, timeout_sec, json_mode, probe_on_start\n2. `user://synapse_llm.cfg`: written by the in-game settings dialog. The API key is only saved if you tick the box.\n3. Environment variables: `SYNAPSE_LLM_ENDPOINT`, `SYNAPSE_LLM_MODEL`, `SYNAPSE_LLM_API_KEY`, `SYNAPSE_LLM_ENABLED`, `SYNAPSE_LLM_TIMEOUT`, `SYNAPSE_LLM_JSON_MODE`\n\n```bash\n# Local Ollama (the default endpoint)\nollama pull llama3:8b && ollama serve\n\n# vLLM\nSYNAPSE_LLM_ENDPOINT=http://127.0.0.1:8000/v1/chat/completions SYNAPSE_LLM_MODEL=meta-llama/Llama-3.1-8B-Instruct godot --path .\n\n# Claude through Anthropic's OpenAI-compatible endpoint (or point at your own Claude API proxy)\nSYNAPSE_LLM_ENDPOINT=https://api.anthropic.com/v1/chat/completions SYNAPSE_LLM_MODEL=claude-sonnet-5-5 \\\nSYNAPSE_LLM_API_KEY=sk-ant-... SYNAPSE_LLM_JSON_MODE=0 godot --path .\n```\n\nAPI keys are sent as `Authorization: Bearer`. If an endpoint rejects `response_format`, set JSON mode off; the prompt still demands JSON-only output and the parser copes with prose.\n\n> **Web build:** the browser build never contacts the default localhost endpoint on its own, because a public page reaching into your machine triggers browser permission prompts. To use a local model, click the LLM badge and press **TEST CONNECTION** or **SAVE & CLOSE**. Your browser may ask you to allow access to local services, and the endpoint must allow the page's origin through CORS, for example `OLLAMA_ORIGINS=https://shotif.github.io ollama serve`. Anything shipped to the client is public, so point a web build at your own proxy rather than embedding a provider key. A key you choose to remember is stored in that browser's site storage.\n\n## Architecture\n\nThe design is headless-first: everything under `core/`, `entities/` and `systems/` (except the `LLMService` node) extends `RefCounted`. It runs without a scene tree, and the UI and 3D views bind only through signals.\n\n```\n┌────────────── ui/main_dashboard.gd (Control) ───────────────┐\n│ meters · directive panel · crisis dialog · event feed · badge │◄── signals ──┐\n│ SubViewports: viewports_3d/globe_viewport · neural_lattice │ │\n└───────────────┬─────────────────────────────────────────────┘ │\n │ submit_player_turn / advance │\n┌───────────────▼──────────── core/simulation_engine.gd (RefCounted) ─────────┴┐\n│ 1 WORLD_TICK ComputeScaling → TechTreeManager → WorldState.resolve_coupling │\n│ 2 ACTORS build_observation → LLMService ⇄ HeuristicFallback → resolve │\n│ 3 PLAYER DilemmaDeck.draw → crisis option + directives → EffectResolver │\n│ 4 TELEMETRY losses / collapses / catastrophes → history → VictoryMatrix │\n└──────────────────────────────────────────────────────────────────────────────┘\n```\n\n```\ncore/\n simulation_engine.gd four-phase turn state machine and signals\n world_state.gd six macro metrics, secondary indices, coupled equations, history\n tech_tree_manager.gd scaling laws, thermal walls, eras, paradigm shifts, emergence, alignment tax\n victory_matrix.gd eight end-states, nearest attractor, role verdicts\n effect_resolver.gd applies declarative effect dictionaries (actions, cards, emergences)\n sim_constants.gd faction IDs, calendar, role descriptions\nentities/\n actor_base.gd currencies, costs and intensity, cooldowns, grievances, observations\n ceo_faction.gd governance_faction.gd asi_faction.gd citizen_faction.gd\n faction_registry.gd\nsystems/\n compute_scaling.gd grid capacity, power demand, efficiency, saturation, throttle\n dilemma_deck.gd 22 procedural crisis templates, injection, deferral and escalation, autoplay chooser\n llm/llm_service.gd HTTPRequest client, probe, 5 s timeout, circuit breaker, fallback\n llm/prompt_templates.gd personas, request bodies, JSON extraction, strict validation\n llm/heuristic_fallback.gd deterministic decision trees for all four roles\nui/\n main_dashboard.tscn/.gd 2D Cyber-Telemetry HUD (#0D1117 / #00E5FF / #FFB300 / #FF1744)\n components/ meter_bar, llm_status_badge, directive_panel, dilemma_dialog,\n role_select, endgame_debrief, trajectory_chart, llm_settings_dialog\n theme/ runtime Theme (JetBrains Mono + Inter)\nviewports_3d/\n globe_viewport.tscn wireframe Earth, Natural Earth land dots, datacenter heat, cables, embargo rings\n neural_lattice.tscn force-directed layered graph, drift-driven glow and jitter, loss landscape\n shaders/ wireframe_globe, neural_glow, data_flow, hologram_point, loss_landscape\ntests/ tools/ docs/\n```\n\nThe coupled equations, scaling laws, faction economies and endgame logic are specified in **[docs/SIMULATION_MODEL.md](docs/SIMULATION_MODEL.md)**.\n\n## PRD roadmap status\n\n| Milestone | Status |\n|---|---|\n| **M1:** headless simulation core | ✅ `project.godot` (headless autorun settings), `world_state.gd`, `simulation_engine.gd`, 100-turn NaN and overflow tests |\n| **M2:** asymmetric entities and heuristic fallback | ✅ `actor_base.gd` and four factions with PRD currencies, directives and loss conditions; decision trees for all four roles; autonomous actors every tick, with retaliation and crisis injection |\n| **M3:** LLM integration and status flag | ✅ `llm_service.gd` over `HTTPRequest`, schema parsing and validation, 5 s timeout fallback, `llm_status_badge.tscn` |\n| **M4:** 2D cyber-telemetry UI | ✅ `main_dashboard.tscn`, custom theme, directive panel with intensity allocation, `dilemma_dialog.tscn` |\n| **M5:** 3D SubViewport integration | ✅ globe in a `SubViewportContainer`, `wireframe_globe.gdshader`, `Camera3D` orbit dragging, `neural_lattice.tscn` with drift-driven color shift |\n| **M6:** endgame matrix and polish | ✅ `victory_matrix.gd` (8 end-states), debrief with trajectory line charts and affinity matrix, full 100-turn end-to-end tests in automated and interactive modes |\n\n## Design notes\n\n- **Test harness.** The PRD asks for GUT tests. I used a small built-in runner with GUT-compatible assertion names instead. It has no addon dependency and isn't tied to a particular GUT/Godot version, which keeps fresh clones and coding agents on a single command (`tools/run_tests.sh`).\n- **Section 3.1 equations.** The PRD left the \"coupled mathematical interdependence\" section empty. The model in `docs/SIMULATION_MODEL.md` fills it in and was calibrated with `tools/monte_carlo.gd`. Every end-state is reachable, and the player's choices measurably change outcomes.\n- **Ambiguous PRD wording**, interpreted as follows:\n - \"Labor Obsolescence = 100\" means L ≥ 99.5.\n - Diaspora's \"Alignment < 30\" refers to the Alignment Drift Index.\n - \"Governance Enforcement\" is a world enforcement index.\n - The heuristic action `COMMERCIALIZE_DISTILLED_WEIGHTS` is the \"Aggressive Weight Distillation\" directive (+8 labor displacement).\n - Endings that match no signature resolve to the nearest attractor, and the debrief says so.\n- **Early catastrophes.** World war at tension 100, and saturated drift under near-total autonomy for two turns, end the campaign for every role and resolve to end-states consistent with the catastrophe.\n\n## Exporting\n\n`export_presets.cfg` defines Linux, Windows, macOS and Web presets. Install the Godot 4.3 export templates, then run, for example:\n\n```bash\ngodot --headless --path . --export-release \"Linux\" build/linux/synapse-2076.x86_64\nmkdir -p build/web && godot --headless --path . --export-release \"Web\" build/web/index.html\npython3 -m http.server 8000 --directory build/web # browsers won't run it from file://\n```\n\n- **Web.** The preset is single-threaded (`variant/thread_support=false`), so it runs on hosts that can't send cross-origin isolation (COOP/COEP) headers, GitHub Pages included. It needs only the `web_nothreads_*` export templates.\n- **GitHub Pages.** [`.github/workflows/pages.yml`](.github/workflows/pages.yml) runs the test suite, exports the Web preset with Godot 4.3 and deploys it on every push to `main`. You can also start it from the Actions tab. In a fork, set **Settings → Pages → Build and deployment → Source** to **GitHub Actions** once.\n- **`build/.gdignore`** keeps Godot from importing exported files back into the project, where the next export would pack them.\n\n## Credits\n\n- Code: MIT ([LICENSE](LICENSE)).\n- Fonts: [JetBrains Mono](https://github.com/JetBrains/JetBrainsMono) and [Inter](https://github.com/rsms/inter), both under the SIL Open Font License 1.1 (see `ui/fonts/*-OFL.txt`).\n- Land mask: rasterized from [Natural Earth](https://www.naturalearthdata.com/) 1:110m land polygons (public domain).",
"commits": []
}