Browser wall
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.
What it shows
Section titled “What it shows”- 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.tsjoins 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.
Run it
Section titled “Run it”The wall needs a browser that speaks the Chrome DevTools Protocol at 127.0.0.1:8787. The tests use the Kitesurf container.
mk servermk dev examples/browser-wallbun test examples/ runs the rules and the recorded session with two viewers.
Read next
Section titled “Read next”- 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?
Thanks for the feedback.