SHADE BEHIND. The lamp is the only warm light there is.
You are here: Home › Making ofPAL · 50 Hz · 13 chapters · 102 rooms

Making Of

Shade Behind began as a game for PC, made with the Godot engine. The PlayStation version shares no code with it. It is a new program, written in C for a 33 MHz MIPS R3000 with 2 MB of main RAM, 1 MB of video RAM and 512 KB for sound, with the original as the reference for feel, look, rooms and story.

No Floating Point

The PlayStation has no floating-point unit, so there is not one float in the game code. Every position and speed is a 24.8 fixed-point number: whole pixels of the original game plus 1/256ths. A metre is still 100 pixels and y still grows downward, so the original's constants and room coordinates carry straight across, and a speed in pixels per second becomes so many 1/256ths per tick.

The screen is the world scaled by 2/9: the 1080-pixel-tall view of the original becomes 240 lines. The camera shows 14.4 by 10.8 metres, and the boy is 30 pixels tall.

Sixty Ticks On Fifty Frames

The game logic ticks at exactly 60 Hz on every machine. On NTSC that is one tick per frame. On PAL the television shows 50 frames a second, so the game runs six ticks for every five frames, always in the same steady pattern: 1, 1, 1, 1, 2. If a frame ever runs late, the next one catches up rather than letting the game drift.

Because input is read per tick and the logic never depends on the frame rate, a recorded run plays back tick for tick the same on the PC test build and on the console.

One Lamp Of Light

The Winch: the lamp lights the cage, the chains and the timber around the boy.“The Winch” (III): one bulb lights the cage, the chain and the props.

There is one light in the world, the bulb, and it goes where the boy's head goes: it follows his pose, his tilt, even the way he falls. Its cone and fall-off are the original game's, but worked out without a single arc-tangent or square root: the angle test uses the squared cosine to the cone's axis, the distance comes from a 33-entry table.

The light is kept as one state, built off-screen a piece at a time across a few frames and swapped in whole. The ground, the walls, every lit sprite and the cone change together, never half a frame apart, and a boy standing still breathing produces a picture that does not change by a single pixel. That rule came straight from the author's playtests: nothing may change on screen while nothing changes in the world.

Under the light, the world is made of what the PlayStation does well: flat and Gouraud-shaded polygons, textured sprites, two or three layers of silhouettes per place, and the console's dithering left on, where it works as film grain.

A Boy On A Skeleton

The boy is not a sprite sheet. He is a skeleton of rotated, textured pieces cut from the original's drawings, posed every frame by the original's animation functions ported to integers: the walk and run driven by distance travelled, the heel roll, the stumble, the reach for the string, the tilt of the shade. Two-bone limbs are solved with the law of cosines, without an arc-cosine.

A Chapter At A Time

102 rooms do not fit in 2 MB at once, and they do not need to. Each chapter's rooms are compiled into one binary file on the disc, about 2 KB per room, loaded into a single fixed buffer when the chapter begins. The sprites a chapter needs and its environment art travel the same way, per chapter and per place.

Sound works in tiers: one bank that stays resident all game (the boy, the lamp, the pup, The Dark), one bank per chapter loaded behind the black of a chapter change, and, where a chapter needs more, a small supplement swapped between groups of rooms. Every room's sounds are in memory while it plays, with at least 15 % of sound RAM spare. Each sound is resampled at the lowest rate its content allows, so nothing is chopped short.

Main memory is mapped and guarded by a test: about 275 KB stays free after the game's reserves.

Two Widths

The Rigging at 320 by 240.320×240 (shown at 2×)
The same moment at 512 by 240.512×240, stretched to 4:3 as a television shows it

The same moment of “The Rigging” in both builds. The 512-wide build has its own native set of sprites and a finer horizontal picture; the 320 build leaves more of the console's time and video memory to spare.

A Test For Every Room

The game also builds for the PC as a headless test program with a software rasteriser that follows the PlayStation's drawing rules. On it run walk plans: short scripts that play a room like a player would (hold right until here, jump, pull the string, wait for the gate) and check what happens. Every room has its solution, and also its deaths, its tempting wrong solutions, a naive player, a run with the pup and one without, and the spark.

The same plans are baked into console builds and replayed in emulators, tick for tick, to prove the PlayStation does exactly what the PC build does. Release gates then hold every room to its budget: no frame over 12 ms, no missed vertical blank, a cap on polygons and on how much of the screen is painted over.

Tools

LanguageC (C99), no floating point in the game
SDKPSn00bSDK, an open-source PlayStation SDK, with GCC for MIPS and mkpsxiso for the disc image
EmulatorsPCSX-Redux (frame-exact tests and profiling), DuckStation, mednafen
Art and soundfrom the original game: its drawings rasterised to small palette textures, its sounds resampled for the sound chip
TypeCormorant Garamond by Christian Thalmann (SIL Open Font License), drawn as bitmap fonts; the headings on this site use the game's own

Credits

Shade Behind, and its PlayStation version, designed and built by st4ck.