Skip to content
Get started

Browser wall

View as Markdown

The browser wall shows a web page on a wall of maps. Every player who looks at it sees a page of their own, from the same wall. A player clicks the page by swinging at it, scrolls by moving the hotbar selection, and opens another page with /browse <url>.

Source: examples/browser-wall.

  • A page per player. The game opens one browser page per viewer, through the Chrome DevTools Protocol, and sends each player the maps of their own page. Players do not see each other’s pages.
  • Pixels from aim. The rules work out which pixel of the page a player aims at, from where they stand and look. A click is a press at that pixel. A change of hotbar slot scrolls the page.
  • Only changed maps. Each map is 128 by 128 pixels. When a page changes, only the maps that changed are sent.
  • Failure as a message. When the browser goes away, the player’s page breaks off with LostPage, and the player is told why in chat.
  • Two players end to end. browser-wall.e2e.ts joins two real clients. One clicks a button and the other scrolls a list, and each sees only their own change, down to which maps changed. Then one leaves and the other keeps scrolling.

The wall needs a browser that speaks the Chrome DevTools Protocol at 127.0.0.1:8787. The tests use the Kitesurf container.

Terminal window
mk server
mk dev examples/browser-wall

bun test examples/browser-wall runs the rules and the recorded session with two viewers.

  • Test with bot clients: how the two players in the end-to-end test are bundles in real clients.
  • Performance: what Kitesurf measured for sessions, clicks and scrolling.

Was this helpful?