Tactical cRPG Architecture: D&D 5e SRD & Godot 4 Infinity Engine Masterclass
The definitive architectural deep-dive into party-based tactical isometric cRPGs for video game nerds and D&D dungeon masters. Covers D&D 5e SRD mathematical action economy, Godot 4.3 GL Compatibility 2.5D isometric rendering, physical collision pathfinding, Flare RPG CC-BY-SA paperdoll asset pipelines, 3-mode expandable Activity Log, and autonomous Infinity AI Agent verification with 1080p video proof-of-work.
Take this masterclass directly in your browser with interactive lab checklists, instant quiz checks, and verifiable Knowledge Graph completion certificates.
Table of contents
1. TOC
1. Executive Architecture & Engine Topology
The Tactical cRPG & Infinity AI Engine (crpg-realm) is RobOS's reference implementation of a complete, production-grade video game built from scratch by AI agents adhering to Knowledge Graph-First standards. Inspired by legendary Infinity Engine classics (Baldur's Gate, Icewind Dale, Planescape: Torment), the project combines authentic Real-Time with Pause (RTwP) combat, a 6.0-second combat round timer, multi-branch dialogue, and physical building collision geometry with cutting-edge autonomous AI verification.
Figure 1: Oakhaven Village Square (2560x1440 pre-rendered plate) featuring 11 physical buildings, stone ramparts, animated NPCs, and the Infinity Engine HUD.
2. Module 1: D&D 5e Ruleset & Mathematical Action Economy
At the heart of the combat simulation is a strict mathematical implementation of the D&D 5th Edition System Reference Document (SRD 5.1) ruleset.
Mathematical Combat Formulas
1. Ability Modifier Calculation:
(e.g., Strength 16
\rightarrow +3, Dexterity 14 \rightarrow +2, Constitution 8 \rightarrow -1)
2. Armor Class (AC) Equations:
3. d20 Attack Roll Resolution:
- Natural 20 (Critical Hit): Always hits regardless of AC; doubles all damage dice rolled before adding flat ability modifiers.
- Natural 1 (Critical Miss): Always misses regardless of modifiers.
4. Advantage & Disadvantage Probability Shift:
When rolling with Advantage (\max(d20_1, d20_2)), the expected roll increases from 10.50 to 13.825 (+3.325 equivalent bonus). When rolling with Disadvantage (\min(d20_1, d20_2)), the expected roll drops to 7.175 (-3.325 penalty).
5. Spell Save DC & Spell Attack Bonus:
Figure 2: Complete D&D 5e Character Sheet tracking ability scores, modifiers, AC, saving throws, and status conditions.
Figure 3: Tactical combat battlefield showing active threat aggro indicators, round progress timers, and spell targeting.
3. Module 2: Godot 4.3 Engine Runtime & 2.5D Isometric World
Why Godot 4.3 GL Compatibility Profile?
The engine uses Godot's GL Compatibility (OpenGL 3.3 / ES 3.0 / WebGL 2.0) renderer rather than Vulkan Forward+: - Zero Shader Stutter: OpenGL eliminates the infamous pipeline compilation freeze present in modern Vulkan pipelines. - Headless Virtual Framebuffer Stability: Runs flawlessly inside Docker containers and headless Xvfb displays (:99) without requiring expensive hardware GPUs.
- Cross-Platform Parity: Identical rendering across Linux, macOS, Windows, and lightweight dev machines.
2560×1440 Pre-Rendered Plates & 1920×1080 Viewport Clamping
Maps are constructed using ultra-detailed 2560×1440 pre-rendered background plates (village_open_world_2560.png, Homestead.tscn, WhisperingForest.tscn). The player camera viewport runs at 1920×1080 native resolution, smoothly interpolating and clamping to map boundaries:
# Camera2D Boundary Clamping in Godot 4
func _process(delta: float) -> void:
if target_hero:
var target_pos = target_hero.global_position
global_position = global_position.lerp(target_pos, delta * 5.0)
global_position.x = clamp(global_position.x, 960, 2560 - 960)
global_position.y = clamp(global_position.y, 540, 1440 - 540)
Physical Collision Geometry (Layer 1)
Every building in Oakhaven is a true physical obstacle with aStaticBody2D collider on Layer 1, preventing characters from walking through solid walls:
| Building Name | Node Name | Footprint Dimensions | Map Coordinates | Door Transition ID |
|---|---|---|---|---|
| **The Rusty Dragon Inn** | `HouseInn` | $360 \times 180\text{ px}$ | $(410, 640)$ | `door-id-inn` |
| **Town Hall & Guildhouse** | `HouseTownHall` | $320 \times 260\text{ px}$ | $(1090, 330)$ | `door-id-townhall` |
| **Brand's Forge & Armory** | `HouseBlacksmith` | $220 \times 140\text{ px}$ | $(1520, 460)$ | `door-id-blacksmith` |
| **Maybelle's Remedies** | `HouseApothecary` | $280 \times 140\text{ px}$ | $(1810, 600)$ | `door-id-apothecary` |
| **Farmer Giles' Cottage** | `HouseCottage` | $240 \times 190\text{ px}$ | $(140, 1120)$ | `door-id-farmhouse` |
| **Elder Martha's Cottage** | `HouseElderCottage` | $280 \times 180\text{ px}$ | $(670, 1340)$ | `door-id-elder` |
| **Royal Guard Barracks** | `HouseBarracks` | $340 \times 220\text{ px}$ | $(1620, 1250)$ | `door-id-barracks` |
| **Ranger Kaelen's Lodge** | `HouseRangerLodge` | $320 \times 200\text{ px}$ | $(1990, 990)$ | `door-id-ranger` |
| **Sister Althea's Shrine** | `HouseShrine` | $240 \times 200\text{ px}$ | $(2310, 340)$ | `door-id-shrine` |
| **Miller Hob's Windmill** | `HouseMill` | $220 \times 220\text{ px}$ | $(2330, 130)$ | `door-id-mill` |
| **Northern Garrison Gate** | `GarrisonGate` | $400 \times 120\text{ px}$ | $(1280, 220)$ | `door-id-1` |
Figure 4: Physical house footprints blocking movement; party routes through safe street corridors.
Figure 5: Custom dynamic Fog of War shader revealing shrouded terrain as heroes advance.
4. Module 3: Open-Source Asset Harvesting & Infinity Engine HUD Replica
100% Genuine Open-Source Creative Commons Pipeline
No copyrighted Bioware or Wizards of the Coast assets are used. RobOS sources all visual assets from: 1. Flare RPG (flareteam/flare-game): CC-BY-SA 3.0 animated 8-directional isometric characters (walk, attack, take damage, death animations) and modular paperdoll items (armor, robes, swords, shields, bows).
2. Game-Icons.net: Over 4,000 CC-BY 3.0 vector SVG icons for abilities, spellbooks, inventory, and status buffs.
3. OpenGameArt.org: CC0/CC-BY sound effects for sword impacts, spell chanting, and UI clicks.
Three-Mode Expandable Activity Log
The game replicates the iconic Infinity Engine console at the bottom of the screen with three reactive expansion tiers:Compact Combat & Telemetry Log"] -->|Click Expand / Talk NPC| ModeMed["Medium Mode (240px)
In-Log Numbered Dialogue Trees"] ModeMed -->|Click History| ModeLarge["Large Mode (420px)
Full d20 Roll Breakdown & Quest Journal"] ModeLarge -->|Click Minimize| ModeSmall
Dialogue choices are presented directly inside the activity log, allowing keyboard selection (1–9) or direct mouse clicks without intrusive full-screen popups:
Figure 6: Multi-branch dialogue with Blacksmith Brand inside the 240px Activity Log showing numbered options and NPC facing.
5. Module 4: Autonomous Infinity AI Agent & Headless BDD Verification
The Infinity AI Agent (qa_player/infinity_ai_agent.py)
Rather than relying on human clickers or brittle hardcoded input recordings, RobOS features an autonomous decision-making agent capable of playing through the entire 5-Act campaign from character creation to defeating Captain Malakor.
Figure 7: BDD scenario verifying enemy pack aggro alerting and frontline fighter peeling.
Figure 8: Autonomous campaign completion reached with 100% test pass rate across 482 steps.
6. Module 5: Knowledge Graph-First Game Architecture (.robos/kgraphs/crpg)
The 4-Phase Generation Pipeline
.robos/kgraphs/crpg/package.jsonld & W3C SHACL Shapes"] --> Phase2["Phase 2: Schema & Data Store Layer
schemas/v1/*.json & games/crpg-realm/data/v1/*.json"] Phase2 --> Phase3["Phase 3: Open-Source Asset Harvesting
Flare RPG CC-BY-SA Sprites & Game-Icons.net SVGs"] Phase3 --> Phase4["Phase 4: Scene & Systems Composition
Godot 4.3 GL Compatibility & DataStoreV1.gd Singletons"]
Figure 9: The 4-Phase RobOS Knowledge Graph-First Game Generation Paradigm.
Strict Zero-Hardcoding Rule
In RobOS, no game stats, monster health values, spell formulas, or dialogue trees may be hardcoded into engine scripts. Everything is defined in.robos/kgraphs/crpg/package.jsonld and JSON Schemas under schemas/v1/, which compile directly to typed GDScript singletons under src/generated/v1/DataStoreV1.gd:
# Auto-generated statically-typed DataStoreV1.gd
class_name DataStoreV1
extends Node
static func get_class_data(class_id: String) -> Dictionary:
match class_id:
"fighter":
return {
"hit_die": 10,
"primary_ability": "STR",
"saving_throws": ["STR", "CON"],
"base_hp": 12
}
"wizard":
return {
"hit_die": 6,
"primary_ability": "INT",
"saving_throws": ["INT", "WIS"],
"base_hp": 7
}
return {}
7. Interactive Hands-On Labs & Certification
You can launch and complete this full course interactively inside the RobOS eLearning Hub or online via GitHub Pages:
- 🌐 Interactive Web Edition: www.rowbose.com/projects/crpg-realm/elearning/
- 🖥️ Desktop Player:
# Launch central eLearning player loaded to the cRPG Masterclass
electron packages/robos-elearning --course=robos-crpg
# Or launch the dedicated standalone desktop app
electron packages/robos-crpg-elearning
Upon completing all 5 module labs and passing each module's knowledge check with \ge 80\%, the system automatically issues a cryptographically verified RobOS Knowledge Graph Certificate of Completion conforming to schema:EducationalOccupationalCredential.