Keeping Engine & Game Separate In Arcanum

Abstract

Problem: How did the Arcanum team keep the game engine separate from game-specific mechanics, and why did that matter?

Approach: Tim Cain explains the file-level and library-level separation strategy used during Arcanum's C codebase development, drawing on lessons from his earlier TIG/GNOL abstraction libraries.

Findings: By organizing code into separate C files (engine vs. game), compiling the UI into its own library with one-way data flow, and enforcing strict boundaries, the team was able to reuse the Arcanum engine to build Temple of Elemental Evil in roughly 20 months β€” replacing all game files and UI while keeping core engine code intact.

Key insight: The UI should never decide game state or be queried by game logic β€” data flows up to the UI but never back down. This one-way dependency, enforced at the library level, prevents architectural rot and enables rapid engine reuse.

Source: https://www.youtube.com/watch?v=NcIchbZ4eK8

References