One Game, Three TV Platforms: Keeping Roku Parity on Fire TV and Vega OS

One Game, Three TV Platforms: Keeping Roku Parity on Fire TV and Vega OS

Our games started life on Roku. When we began porting them to Fire TV and Vega OS, we set one goal: the port must look and behave like the Roku original. Not a redesigned Android app, just the same game on a different TV. Here is the rule that makes that possible, and the bugs we hit along the way.

The parity rule

The rule is simple to say and surprisingly hard to keep:

  • The game passes the same coordinates, sizes and texts as on Roku. If a button sits at a certain position in the Roku version, the port asks for exactly that position.
  • No per-platform position tweaks in game code. No "move this label a few pixels down on this platform only".
  • Visual differences are fixed in the framework's rendering. If something looks wrong, the framework draws it wrong, so that is where the fix goes.

A per-game patch fixes one screen in one game and hides the real bug until the next game hits it. A framework fix fixes every game, including the ones we haven't ported yet.

Store purchase dialogs are the one thing we don't copy: each platform shows its own. The purchase rules behind them, meaning what is free, what is locked and what unlocks what, match Roku.

Two frameworks, one shape

On Fire TV we use a Kotlin framework for Android that mirrors our Roku framework. Code placement follows Roku too, so a Fire TV port has the same pieces in the same places as its Roku original.

On Vega OS we use React Native only as a thin shell. The drawing and the game logic live in a TypeScript canvas framework that supports whatever design resolution the game was made for, HD or Full HD. Everything the player sees goes through our own renderer, which is what lets us match Roku.

Our first Vega port is still in progress, and it has already taught us a lot.

The black screen before the first frame

The game runs as a local player page inside a WebView. On the first device run, we got a black screen before the first frame was drawn.

The cause: Chromium treats every file URL as its own origin. So when the page tried to fetch its sibling files (images, fonts, data), those requests were blocked as cross-origin. Turning on the WebView's file-access flags didn't help.

We fixed it by embedding the assets into the player page itself, so there is nothing to fetch. Network calls had the same problem, since HTTPS requests from a file page failed the cross-origin check, so all network traffic now goes through the native shell.

When "204 No Content" counts as a failure

After that fix, the logs showed an analytics "send failed" error right after a hit that had actually succeeded. The server answered 204 with an empty body, and our network code treated an empty body as an error.

Now 204, 205 and 304 all count as success. False errors are expensive: you go looking for a problem that isn't there.

Is this even the build I just made?

During device QA the TV sometimes kept a stale player bundle, and we checked fixes that weren't actually installed. Now every build logs a build stamp at startup, and TV builds reset the bundler cache, so the log tells you exactly what you're testing.

Focus corners that turned into white squares

Our focus highlight is made of corner pieces: white L-shaped masks with transparent centres. Roku tints a mask by recolouring only its opaque pixels. Our first port filled the whole rectangle with the colour instead, so every focus corner became a solid white square.

The fix was to multiply the colour into the mask and keep its alpha, which is what Roku does.

A related bug: a shadow colour given without an alpha byte was drawn with alpha zero, so the outline around the Unlock button simply vanished. Now a colour without alpha is drawn opaque, like Roku's 1-pixel shadow.

Text size is still being matched to Roku. Images and buttons already line up, but text isn't there yet, and we keep measuring it against the Roku screens.

Getting to 60 fps

The first render loop tinted every sprite in JavaScript on every frame, which is a lot of pixel work for a TV stick. Now each bitmap is tinted once, cached, and then simply drawn. In headless tests that gave about 59.8 fps. On a real Fire TV Stick running Vega OS, steady state is 59.1 to 59.9 fps. Menus average about 59.6, gameplay about 59.3, and the lowest dip we measured on a heavy screen was about 54. The first sample after launch can be low before it recovers. Our release rule is to aim for 60 and never go below 30.

Takeaway

  • Pick one reference platform and treat it as the spec for look and behaviour.
  • Same coordinates, same texts, no per-platform tweaks in game code.
  • Fix visual differences once, in the framework, so every game benefits.
  • Learn exactly how the reference renders: tint, alpha, shadows. "Close enough" is where white squares come from.
  • Stamp every build so you always know what you're testing.
  • Do expensive work once, not every frame.
Go To All Articles