Menu PocketGamer.biz
Search
Home   >   News

Roblox begins public beta for browser-based game access on Chrome

The company plans to add support for more browsers over the next few months
Roblox begins public beta for browser-based game access on Chrome
  • JSPI-based fibres switch 14 times faster and use around 70 times less memory than thread-backed fibres.
  • Roblox fixed a memory leak that caused suspended JSPI stacks to remain in memory.
  • The browser technology lets Roblox retain its existing C++ engine code while supporting browser-based play.
Stay Informed
Get Industry News In Your Inbox…
Sign Up Today

Roblox has begun releasing a public beta of a technology that lets users with an account play games through Chrome browsers on desktop and Android without downloading the app.

The company said users will be able to click a link to launch Roblox games directly in their browser. Support for more browsers is planned over the next few months.

Making this work required changes to several parts of the Roblox engine, including networking, rendering and content delivery. 

Roblox said the biggest challenge was adapting its system for handling concurrent programming, which was built around 20 years of C++ code that expects tasks to be able to wait for responses.

Faster fibres

Roblox uses fibres, or lightweight threads, to manage tasks without relying on the operating system to switch between threads. However, the browser’s WebAssembly environment does not allow the engine to pause and resume its execution in the same way.

“Making this possible on the web, for Chrome browsers, meant rethinking several of the assumptions that have been baked into the Roblox engine, including networking, rendering, and content delivery," said Roblox principal software engineer Fatih Bakır in a post. 

The company tried using Asyncify, a tool that rewrites code to allow it to pause and resume, but said the size of the engine caused too much code bloat and slowdown. A second approach using real threads reached the game joining stage on a high-end MacBook but ran out of memory on Android.

Roblox then used JavaScript Promise Integration (JSPI), a feature available in Chrome that allows WebAssembly to pause while waiting for a JavaScript Promise and resume once it is ready.