A personal journey: travel, technology, reviews, projects & diary — since 1995.
Atic Atac in Go

Atic Atac in Go

A faithful Go port of Atic Atac, Ultimate Play the Game's 1983 ZX Spectrum maze game, built by reading the original Z80 machine code rather than guessing at it.

A faithful Go port of Atic Atac, Ultimate Play the Game’s 1983 ZX Spectrum maze game, built by reading the original Z80 machine code rather than guessing at it.

Atic Atac was one of the games that defined the early Spectrum. Ultimate Play the Game released it in 1983: a haunted house of 150 rooms seen from above, three characters to play, and a clock counting down your health while monsters poured out of the walls. I rebuilt it in Go.

The rule I set myself was simple. No reimplementing from memory or from a wiki. The behaviour had to come from the original Z80, working from Simon Owen’s disassembly. The room layouts, the monster logic, the movement, the scoring, all of it was deciphered from the machine code and ported across rather than approximated.

What is in it

The full 2D game is playable. All 150 rooms, the three classes (Knight, Wizard and Serf, each with their own secret passages), every enemy type, the bosses (Mummy, Dracula, Frankenstein, the Devil and the Hunchback), keys, doors, trapdoors, pickups, weapons, scoring, and the win condition: escape the house carrying all three pieces of the ACG key.

How it is built

The interesting decision was splitting the game in two. There is a headless engine with a Gym-style Step(Action) -> StepResult API, the kind of interface you would use to train an agent, and a separate Ebitengine wrapper for a human to actually play. The engine knows nothing about graphics. The display layer reproduces the Spectrum’s 256x192 screen, its 16 colours, and its famous attribute clash.

Package Job
engine/ Headless logic: collision, movement, AI, scoring
screen/ ZX Spectrum display buffer, 256x192, attribute clash
data/ Sprite and room data extracted from the Z80
audio/ Low-latency sound via oto, around 12ms
render3d/ Experimental first-person renderer

The 3D experiment

There is a first-person mode. Press Tab and the current room renders as a software-rasterised 3D view at 192x192, still in the Spectrum palette, walls extruded from the room’s boundary line segments, with door arches and portraits texture-mapped onto them.

The experimental first-person view, Spectrum palette intact

It is alpha quality and I will not pretend otherwise. The decoration heights are placed by heuristics, so a suit of armour occasionally floats. The field of view is wide enough to make some rooms feel wrong. Cave and stair rooms carry enough geometry to render with visible noise. The floor and ceiling are simply black. It works, it is good fun to walk around in, and it is nobody’s idea of finished.

Filed under: Projects