DE EN FR ES IT

Engine & tech

Headless engine

Also: logic/presentation split, headless runtime

A headless engine is a game engine whose logic can run without any presentation, meaning no window, graphics or sound. It requires a clean split: the logic knows nothing about the graphics library, and the presentation merely displays the logic's state.

Background

Multiplayer servers are the familiar example: they run the same simulation as the players' machines, just without rendering. The approach pays off for single-player games too, because tests, tools and analytics can use exactly the same logic as the real game.

The interface between the two sides should be narrow. The presentation sends commands such as tap, use or choose, and the logic answers with whatever is pending, such as a line of dialogue, a walking path or a dialogue menu. Animation and effects stay on the presentation side.

The most common mistake is creeping coupling, where the logic waits for an animation to finish or reads screen coordinates from the renderer. Tests then quietly behave differently from the game.

How we do it

In the Wurzelwerk engine the logic in core/ imports nothing from the PixiJS graphics library. The presentation only calls runtime commands (interact, useItem, combine, choose, submitPrompt, advance) and displays the runtime's pending state: say, walk, dialog, prompt or ended.

That is why the playthrough test uses the same runtime as the browser. The first-time player test of Spätlese 404 also ran blind through a text driver on this runtime first, then with real mouse clicks in the browser. FaxFight follows the same idea on the server: its fight resolution is pure logic with its own unit tests.

Related terms