Unreal Engine 4 on Apple TV

Developers Need to Know…

Nathan Stocks
Agile Perception

--

Apple TV runs on tvOS, a close cousin of iOS. Unreal Engine support for tvOS started with version 4.12 (released recently). We decided to give it a try with our project, Skyfire.

Skyfire 0.3.3 running on the Apple TV. None of the graphics are final!

Developers need to know: Unreal Engine on Apple TV…

  • Analog trigger support for gamepads is missing from 4.12 (Fixed it myself! See next section.)
  • You probably want to be developing on a Mac. At least, it works well for me from a Mac, and I hear that Windows support is...limited.
Notice the beginning of the 30-foot USB repeater cable at the top of the picture…
  • Even though the Apple TV is connected to your network, you’ll need to connect to it via USB to deploy to it. So if your computer is across the room from your Apple TV (like mine), then you just may need a 30-foot USB repeater cable to connect it to your computer. Oh, and did I mention the USB port is a type C connector?
  • There is noleft special” button on iOS/tvOS gamepads. Blame Apple for that one.
  • The “right special” gamepad button is labeled “Menu” on iOS/tvOS gamepads. If it is pressed quickly, it emits “right special”. If it is held down, it is interpreted by the Apple TV as the menu button and suspends your app.
  • tvOS is really, really similar to iOS. This means less fancy rendering features are supported. Fortunately, Skyfire has super simple graphics so far…so no problems there.
  • I really like the Steelseries Nimbus gamepad for the Apple TV. It has a built-in battery that you can charge with a lightning cable (same cable that charges the Apple TV remote). All the buttons feel solid and have good travel.
Steelseries Nimbus. Love it. We’ve got a *lot* of gamepads, so I tag them to keep them straight.
  • I really don’t like the Horipad Ultimate gamepad. Even though it has comparable features to the Nimbus on paper, the triggers are designed so that the further you pull them the more they resist. This makes it so you have to apply about 10 times more pressure to get full trigger input than any other gamepad I have ever used. Very uncomfortable.

Wait, No Analog Trigger Support!?!?

Yep. Sad, but true. I guess not many projects use analog trigger input on iOS or tvOS (since support was missing for both). We do, though! The right trigger in Skyfire is mapped to forward thrust. Pretty important if you want your ship to move!

This frustrated me quite a bit, as it seemed quite a big oversight. So I searched through the Unreal Engine codebase. There is a lot of code. The Epic Games developers are prolific. After several hours of searching, I found the spot where both iOS and tvOS inputs were mapped…and the mappings for analog triggers were simply missing. No crazy bug. No design problems. Just two missing lines that mapped the input for both iOS and tvOS.

So I created pull request #2594 (Unreal Engine developer account required to view) with a patch to add the mappings. Now it works! Epic Games accepted the patch to the master branch, so I expect (and hope) the fix will show up in 4.13.

This is exactly why I chose Unreal Engine over Unity 3D (after spending months evaluating Unity 3D). I always run in to corner cases where something I want to do isn’t quite supported. It must just be my nature. With Unreal Engine, I can dig into the engine source code and fix it.

I wanted to put a screenshot of my patch, but since I don’t want to risk NDA issues, here’s an in-game shot of Skyfire 0.3.3 instead.

--

--

Nathan loves Rust, Python and Indie Game development. He is a veteran software developer (mostly backend infrastructure). He loves family, frisbee, food & fun.