Skip to content

All case studies

01 / Case study

GridRun: a multiplayer browser game with an authoritative server at 60 ticks per second

How I built GridRun: a neon multiplayer game of tag that runs in the browser, with an authoritative server at 60 ticks per second, up to 20 players and bots.

Industry
Multiplayer browser game
Status
In production
Role
Own project, built by Wenderson Belko
Stack
Node.js · WebSocket · JavaScript · Canvas 2D · Web Audio
Cover image of the GridRun case study

02 / Context

Context

GridRun is a multiplayer game that runs right in the browser, with nothing to install. It is a project of my own, live at gridrun.fun.

The idea is a neon game of tag. You open the browser, pick a codename and you're in the arena. Everyone starts as a Runner, who runs, shoots a laser and drags crates to close doors. When the hunt begins, some players are drawn as Overcharged, and their touch is contagious. Whoever gets caught switches sides and starts hunting too.

An arena holds up to 20 players. Each match is a tournament of 7 waves, and whoever scores the most points climbs onto the podium.

03 / The challenge

The challenge

The game had to work with up to 20 players running, shooting and infecting each other at the same time, each in their own browser and with nothing to install. The hard parts:

  • Everyone has to see the same match: who got caught, who hit with the laser and who scored.
  • The map changes every wave, so nothing can depend on a fixed scenario.
  • Anyone who joins alone needs someone to play with.
  • A new version has to go live with no manual step.

04 / The solution

The solution

I chose a server that decides everything. The browser only sends what the player wants to do and draws what it receives.

Authoritative server at 60 ticks per second

The server runs on Node.js and talks to the browsers over WebSocket. All the logic runs on it, at 60 ticks per second (a tick is each step of the simulation), and the match state is sent to the browsers 20 times per second. Who got caught, who hit with the laser and who scored is decided in one place.

There is a single room and the state lives in memory, with no database.

Graphics and sound in the browser

The client uses Canvas 2D to draw and Web Audio for the sounds. There is no plugin and no install: the game opens in a tab.

Procedural map every wave

The arena is generated anew every wave. The 20-second warm-up exists precisely so the player can learn the round's map before the 2-minute hunt. Between one wave and the next, there are 15 seconds to pick 1 of 3 upgrades that last until the end of the match.

Bots so the arena isn't empty

Anyone who joins with no friends online can call up to 8 bots, which also run on the server. Each has a personality: aggressive, defensive, collector or saboteur. They flee, flank, build barricades and even shop at the store.

Rules that create choices

The two sides play differently. Runners shoot with the Neon Impulser, and three hits take a hunter down for 10 seconds. The Overcharged don't shoot, but they infect on contact and regenerate when standing still.

The coins scattered around the map buy powers at the Grid Shop: shield, teleport, walk through walls, camouflage, web, vortex, radar and others. Points come from surviving, hitting the hunter and infecting, and they add up across the 7 waves.

Release on every push

A push to the main branch on GitHub puts the new version live, with no manual step in between.

How it works inside
How a GridRun match runsThe browser sends what the player wants to do over WebSocket. The authoritative server runs the logic at 60 ticks per second, generates each wave's map and controls the bots, and sends the match state back to the browser.

Real product screens

A hunt in progress in GridRun: lasers, powers and infection
GridRun title screen, with the codename and color picker
Grid Shop and live leaderboard during a match

05 / Results

Results

  • 60ticks per second: all the logic runs on the server
  • 20players per arena
  • 7waves per match, with a new map for each one
  • 8bots for those who join alone, each with its own personality

Have a similar challenge?

Tell me the problem in the project brief. I reply within 1 business day.