Skip to content
Tutorials

Build a multiplayer game in your browser

Plan a tiny two-player game in aukimi Engine. Connect a test room, decide which rules the server owns, and check the exported web build on two devices.

aukimi4 min read
On this page

To build a multiplayer game in your browser, start with a game small enough to test in one sitting. Try a shared arena where two players collect five tokens. Each token awards one point, and the first player to three wins. aukimi Engine provides the scene editor, Play mode, web export and multiplayer room connection. You still need to design and implement the shared game rules.

Define one room and one complete round

Write down the round before building the arena. Both players enter the same room, appear at separate spawn points and see the same remaining tokens. The round ends when someone reaches three points. A restart clears scores and restores the tokens. Leave inventories, matchmaking queues and persistent progression for a later version.

List the shared state on a page. It needs player identifiers, positions, scores, available tokens and the round phase. Keep camera movement, sound volume and decorative effects local to each player. This gives you a practical test for every feature you add. Ask whether the other player must know about the change for the round to stay consistent.

Make the solo scene readable in Play mode

Create a simple floor, boundaries, a player object and five clearly visible tokens. Use scene scripts or gameplay behaviors for movement, pickup feedback and the score display. Test one complete round with Play. Check that you can recognise the next target and understand why the round ended.

Watch Engine’s Console while testing. Keep the first arena compact enough to see both spawn points. Give the players distinct colours and place the score where it remains legible. Save the scene after leaving Play mode and review any reported changes. The Engine documentation describes the scene panels, scripts and build options.

Connect two clients to the same test room

Open the Multiplayer room panel from Engine’s gameplay systems. Select the shared test server and use the same room code for both clients, with different player names. Save the connection settings. The panel configures the scene’s connection to a Colyseus server. Your networking behaviors or scripts determine what the connected game sends and displays.

Begin by confirming that each client sees the other player join and leave. Then check movement before adding scoring. Project sharing can separately let teammates edit a scene together. That editing session has its own permissions and document changes. A playable multiplayer room needs player connections and runtime state in the game you publish. See aukimi’s multiplayer overview for the product context.

Give the server the final decision on scores

In an authoritative design, a player requests an action and the server validates it before changing shared state. Colyseus sends room state to clients and synchronises later changes. Build the pickup rule in the appropriate server-side game logic, then display its confirmed result in the browser. Colyseus state synchronisation

For this arena, the rule checks that the round is running, the token still exists and the player is close enough to collect it. One accepted pickup removes the token and increments one score. Two simultaneous requests must produce a single award. A room connection or a broadcast message alone does not implement those checks. Keep movement validation and score validation in your implementation plan.

Export the game and test its hosting

Use Build and choose the web target. Test the exported build with its multiplayer configuration. Hosting the web files serves the player interface. The room service also needs a reachable running server. For release, configure the project’s server hosting and capacity. Self-hosted Colyseus requires deployment and secure connections for an HTTPS game. Colyseus deployment guidance

  1. Join from two devices, preferably using different networks.
  2. Collect the same token simultaneously and confirm a single point is awarded.
  3. Join during a round and check the current tokens and scores.
  4. Interrupt one connection, reconnect and check the resulting player state.
  5. Restart the round and confirm both clients see the same reset.

Keep the prototype focused until these checks pass. Then open Engine and improve the arena’s artwork, feedback and pacing around a round that already works for both players.

  • #multiplayer
  • #game-development
  • #engine
  • #browser-games
  • #colyseus

Enjoyed this article?

ShareHN

Related Articles

Help Build the Future of Creative Software

Support aukimi development and get exclusive early access to the complete creative suite.

Back the Project