All projects

01/11Gamesin production

Afterhush

Multiplayer 3D horror in the browser: a dark town, flashlights and monsters.

  • browser game
  • multiplayer
  • Babylon.js
  • Colyseus
  • horror
Afterhush — preview

Idea

Afterhush is a multiplayer horror game played in the browser, on a computer or a phone, with no install. Dozens of players share one large map: a remote little town surrounded by forest, where it is always night.

Players search houses for food, water, medkits and weapons, keep their hunger and thirst in check and hide indoors, because the things roaming the streets do not enter buildings. Other people can help or shoot you. Proximity voice chat and walkie-talkies for long-range contact are next on the list.

600 mEach side of the one shared map
~30 msTo generate the whole town
60 FPSOn a Mac and an iPhone

Technology stack

08
  • TypeScript
  • Babylon.js
  • Vite
  • Node.js
  • Colyseus
  • SQLite
  • nginx
  • FreeBSD

The client is Babylon.js with the Havok physics engine, written in TypeScript and built with Vite. The game server runs on Node.js with Colyseus and is authoritative: the client only sends intentions (move, shoot, pick up), and the server decides what happened, so damage, ammo and item positions cannot be faked. Accounts, characters and inventories live in SQLite. In production the static client is served by nginx, and the game server runs as its own service in a FreeBSD jail.

The town

The map is generated from a seed, identically on the client (graphics) and the server (collisions): streets, plots with houses and basements, a church with a cemetery, a shop, a police station, a petrol station, a park and cabins in the woods. Rooms are furnished by rules: nothing blocks a door, nothing tall stands under a window, a table comes with chairs. Some houses are falling apart, with cracked plaster, holes in the roof and rubble inside.

The whole town has about a million vertices, so it is split into 50-metre chunks drawn in a single call each and switched off beyond the fog. The image is rendered at a lower resolution and scaled up without smoothing, which gives the game its slightly pixelated look and keeps phones fast.

Light

Light is the core of the atmosphere. Interiors get no light from the sky, only from flashlights, so a house stays pitch black until someone walks in with one. Flashlights cast shadows and do not leak through walls, other players' beams are visible, and some street lamps flicker or no longer work.

Monsters

Instead of a horde of zombies, monsters arrive one at a time, each with its own behaviour. The first one is a possessed shih-tzu: it wanders near the streets, spots a lit flashlight from further away, runs towards gunshots and is faster than a running player. It cannot get into buildings, so it barks under the house. A flashlight shone in its face from up close makes it cower and run, but it comes back bolder.

Characters

Every player has an account and creates a character: body, skin, head shape, hair, beard, eyes, clothes, shoes and backpack, all saved on the server. Characters are built from simple blocks on a ten-bone skeleton, and walking, running, jumping, holding a flashlight and attacking are animated procedurally in code, without animation files.