← All articles
Development

Building Ascend Avoid: Keeping Multiplayer Responsive—and Occasionally Civilised

Inside a multiplayer browser game: server-authoritative rules, shared movement prediction, bot parity, and the awkward things a code audit uncovered.

Ascend Avoid gameplay: creatures and colourful gems in a dark space arena, with a leaderboard and minimap.

Ascend Avoid is a multiplayer browser game where players collect gems, grow larger, and fire smaller players at their rivals. This creates several engineering problems, alongside a rather poor working environment.

The browser needs to respond immediately. The server needs to decide what actually happened. Those responsibilities overlap, but they are not interchangeable.

Building the game has meant working across TypeScript, Canvas rendering, real-time networking, gameplay systems, automated testing, and Azure deployment. The interesting part is where those systems meet: making an action feel immediate without allowing each browser to invent its own version of events.

Deciding who gets the final word

Ascend Avoid uses a Node.js server with Colyseus to manage multiplayer rooms and synchronise game state. The browser renders the world and translates keyboard, mouse, and touch input into actions.

The client sends intentions such as:

  • Steer in this direction.
  • Aim over here.
  • Start or stop inhaling.
  • Fire a captive.
  • Place a completed weapon.

The server owns positions, growth, captures, damage, and knockouts. A browser cannot simply announce that it has acquired several thousand gems and would now like everyone else to acknowledge its achievement.

That separation provides a clear trust boundary. It also keeps competing actions within one authoritative simulation rather than asking several clients to negotiate reality over a network.

For movement, the room handler passes the requested direction to the player’s server-side steering function. That function rejects non-finite vectors and normalises directions longer than one. Oversized input therefore does not become extra speed.

The room also applies a per-client message budget, dropping excess messages and disconnecting sustained floods. These are practical safeguards, not a claim that the game is immune to abuse. Server authority gives validation somewhere to happen; it does not make validation unnecessary.

Making movement feel immediate

Waiting for a server response before showing movement would make every change of direction feel delayed.

The browser instead predicts the local player’s movement using the same walking and turning functions that the server uses.

The walking function takes a body, velocity, steering direction, elapsed time, and world dimensions. It calculates movement speed from physical size, eases velocity toward the requested direction, and constrains the result to the arena.

Sharing that implementation matters. If the browser and server calculate acceleration differently, they will disagree even on a perfectly healthy connection.

The current maximum walking speed follows this relationship:

speed = 320 × (20 / bodyWidth)^0.25

This applies to normal legal body widths of at least 20 units. Smaller creatures move faster, while larger creatures retain useful mobility.

The previous movement curve reached a hard minimum speed. Beyond that point, differently sized creatures had the same maximum walking speed. Shrinking could make a player more vulnerable without making escape any quicker—a somewhat ungenerous arrangement.

The revised curve preserves a speed difference throughout the legal size range. It is a gameplay choice with measurable consequences, not a mathematical proof of good balance.

Prediction also needs correction. The server can apply collisions, suction, knockback, and other interactions that make the browser’s estimate diverge.

The client retains recent predicted positions and compares them with received server state using an estimated latency offset. Small differences are corrected gradually; sufficiently large differences cause a snap to the authoritative position. Captured, flying, or stunned players follow separate handling because ordinary walking prediction no longer describes their movement.

This is deliberately a description of the implementation that exists. It is not full input-sequence reconciliation: the client does not rewind to an acknowledged input and replay every subsequent command.

That distinction gives me a useful boundary for future work. The current approach provides immediate local feedback, but stronger claims about behaviour under latency and jitter require targeted measurements.

Treating capture as a lifecycle

“Capture another player” sounds like a single action. In practice, it creates a relationship between two entities that must survive several possible interruptions.

The captor holds a reference to the captive. The captive records who captured it. Firing must verify that those references agree and that both players remain in valid states.

An ordinary capture also requires the captor to release the capture input before a fresh action can fire the captive. The server enforces that requirement rather than relying entirely on the interface.

The lifecycle includes more than the successful shot:

  • The hold deadline can expire.
  • The captor can disconnect.
  • A player can be knocked out.
  • A stun or other state can prevent firing.
  • A captive can be released near an arena boundary.

Those cases are where apparently straightforward features tend to become less straightforward.

For example, releasing a captive requires placing it clear of the captor’s body. Near an arena edge, the preferred release direction may not have enough space, so the code checks alternative directions. Brief protection prevents an immediate recapture from turning the release into an administrative formality.

Disconnect cleanup also matters. Removing a player clears capture and theft relationships before deleting that player from the world.

The general lesson extends beyond games: when two objects hold a relationship, design how it ends as carefully as how it begins.

Giving bots the same rules

Bots help keep the arena active when fewer people are playing. Their decision-making differs from a human’s input, but their mechanical capabilities should follow the same rules.

They steer through the same movement system, spend breath, capture rivals, collect physical weapon parts, and fire through the shared gameplay functions.

Their advantage is that they remain interested in collecting gems for considerably longer.

This separation between decisions and mechanics makes the system easier to reason about. A bot can choose when to act without receiving a private version of damage, growth, or movement.

It also makes parity testable. The regression suite compares human and bot behaviour under equivalent inputs, including movement, turning, breath use, capture timing, protection, and weapon assembly.

Those tests support a specific claim: the tested mechanics behave consistently across actor roles. They do not prove that the bots make human-quality decisions or provide the ideal level of difficulty.

Testing the system at different boundaries

I use several layers of checks because a gameplay function can behave correctly in isolation while the complete interaction still fails.

Gameplay unit suites exercise rules and boundaries directly. They cover areas such as movement, capture, growth, damage, protection, and resource accounting.

Isolated multiplayer scenarios start a real server and connect clients to it. These exercise message handling and synchronised state, including capture release after a disconnect and disconnection of a flooding client.

Generated client types are checked against the server’s synchronised schema. This reduces the risk of the browser quietly depending on a state shape that the server no longer sends.

During the audit for this article, the reviewed snapshot passed:

  • Client and server type checking.
  • Generated-schema verification.
  • Production client and server builds.
  • All 38 gameplay unit suites and practice-progress checks.
  • All 18 isolated multiplayer scenarios.

Lint completed with no errors and 186 warnings. That is useful evidence of remaining cleanup, rather than a number improved by calling it “technical debt” and moving on.

Browser regression tests also exist, but their CI matrix was disabled in the reviewed version. I did not rerun them for this audit, so these results should not be presented as fresh cross-browser verification.

What the audit caught

A passing suite is evidence about the cases it covers. It is not a certificate of completeness.

The audit uncovered a projectile collision-order defect.

The server checks a projectile’s swept path, which helps detect collisions between its starting and ending positions rather than only at the endpoint. However, the target-selection routine returns the first intersecting player it encounters in the collection.

That is not necessarily the first player along the projectile’s path.

I reproduced this in an isolated scenario using a 200-millisecond simulation step. A projectile crossed two stationary targets. Adding the farther target first caused it to receive the hit. Reversing their insertion order changed the victim without changing the geometry.

Arrival order had quietly become a defensive strategy.

The correction should select the earliest valid intersection along the path. A regression test should then reverse insertion order and require the same nearest target to be hit.

This finding also limits how I describe the simulation. Updates are scheduled at 30Hz, but the server passes elapsed time into the simulation. It is not a deterministic fixed-step engine, and longer steps deserve explicit testing.

Deployment has its own boundaries

The game is deployed to Azure Container Apps through a workflow that runs checks, builds a container image, and deploys an image tagged with the commit SHA. That makes it possible to identify which source version a deployed image represents.

The audit also identified two operational follow-ups.

First, Azure permits up to ten replicas, while this version uses process-local room discovery and presence. Before claiming horizontal scalability, I need to validate multi-instance matchmaking and routing. Allowing more containers is not, by itself, a multiplayer scaling strategy.

Second, the workflow’s final verification step prints deployment information without making a live request. A successful deployment command should be followed by checks of the actual service. For a multiplayer application, that should eventually include a connection check as well as HTTP health.

Neither finding means the current deployment is broken. Both define work that should precede stronger reliability or capacity claims.

Correctness and enjoyment are separate questions

Automated tests can establish that a capture behaves correctly. They cannot establish that being captured is enjoyable. Those are separate conversations.

I use controlled encounters and seeded bot simulations to investigate balance changes. They make comparisons repeatable and help expose consequences that are easy to miss during a short play session.

They do not replace human playtesting, physical-device testing, or production performance measurements.

The same discipline applies to experimental settings. The reviewed code contains support for stronger peer damage and a minimum capture-to-fire delay, but those settings remain disabled in normal games. An experiment in the repository is not automatically a shipped feature.

Ascend Avoid has given me a practical way to work through problems that cross system boundaries: immediate feedback versus authoritative state, shared mechanics versus different actors, and successful deployment versus verified operation.

The next steps are concrete: correct collision ordering, restore browser CI, strengthen post-deployment checks, and test multi-instance behaviour before relying on it.

The game may be about becoming enormous and making questionable decisions with smaller players. The engineering is about making those decisions behave consistently.


Technical scope: this article describes commit 939a97a. The audit findings and verification results apply to that snapshot.

Source references: room handlers, client prediction, shared movement, bot parity tests, and project repository.

Thanks for reading.