PadPlay

How it works

Is the connection safe, what leaves the network, and how it works, on one page. The details are behind the links.

How data moves

When the game starts, a QR code appears on the PC's screen. It holds the PC's address and port, plus a token and an encryption key made for this session. The phone app scans it and asks to join that PC only.

An accepted phone gets a player slot (P1, P2 …). Every touch, gyro reading and button press after that carries the slot.

Touch, gyro and buttons send the whole current state every 8 ms. A lost packet is replaced by the next one, so nothing waits for a resend. Finger and button presses and releases, the button layout and vibration are resent until the other side confirms them, so they are never lost.

Video is a camera's or RenderTexture's picture, encoded as H.264 or JPEG. Pieces lost on the way are rebuilt from the forward error correction (FEC) sent with it.

Security and encryption

Some things are not protected. Others on the network can see that traffic exists, and its size and timing. Anyone who sees the QR code can join, like the players you show it to. Wi-Fi jamming cannot be stopped. Only two short replies are not encrypted, "the app version does not match" and "the QR code is old"; they carry no game data.

After the QR code is renewed, new phones need the new one. For 60 s after renewing, phones that had joined can still return to their slot with the old code. If your game renews the code to keep someone out, set RenewGraceMs to 0.

What leaves the network

The PC and the phones connect directly on the same Wi-Fi or LAN. No internet connection, server or account is used, and you cannot play over the internet.

The SDK sends nothing to the internet. What arrives from phones (input, model and OS, screen size, a random device ID the app made) is kept in memory only; it is written to a file only when a report is saved.

While Announce On LAN is on, the host sends a short notice on the same Wi-Fi, which helps find out why a phone cannot connect. It holds only a name nobody can join with, the port and the PC's address.

The phone app also sends nothing anywhere except to the PC chosen with the QR code. It has no ads, analytics or crash-reporting components. It reads the QR code on the phone and neither keeps nor sends camera images.

Problem reports (from the Editor, the game or the phone) are made only when someone presses the button. Names and addresses are taken out, and that person decides whether to send it.

Privacy policy of the PadPlay app

Windows settings and administrator rights

A built game never asks for administrator rights and never changes Windows settings. When the firewall or another setting stops phones, a button only opens Windows' own settings page for the player, who makes the change.

The reliable way to let the game through the firewall is to add the rule at install time. After a Windows build, PadPlay writes Steam's installscript.vdf and the netsh lines for your own installer next to the build folder.

Only in the Editor, the Connection tab of PadPlay Debug can add or remove a rule after asking you. Windows then shows its administrator prompt.

When Windows' own prompt has no check boxes (as on Windows 11), Allow lets the program in on both Private and Public networks. When the prompt has Private / Public check boxes, only the ticked types are allowed. The netsh lines PadPlay writes and the rule added from the Editor allow Private networks only.

How it is built

The package has two assemblies. PadPlay.Core is C# with no engine references (C# 9, netstandard2.1): the connection and its encryption, player slots, coordinate mapping, gyro math, clock sync and the QR code. Everything that can be tested without Unity lives here.

PadPlay.Unity is everything that touches Unity: PadPlayHost, injecting uGUI events, the raycaster, the Input System device PadPlayPad, capturing and encoding video, and the gyro components. The types you use are all in the PadPlay namespace, so using PadPlay; is enough.

No packages are needed besides Unity's Input System and uGUI. H.264 is encoded with Windows Media Foundation; no codec library is bundled.

The phone app is built with Flutter, and its connection is C++. The C# on the PC and the C++ on the phone are checked against the same test byte sequences, so they talk the same way.

Free and paid editions

In behavior, the only difference between PadPlay Lite (free) and PadPlay SDK (paid) is second-screen video. Lite has no PadPlayView, and the four samples that use video are not included.

Player count, touch, gyro, buttons, vibration and encryption are the same, with no time limit or watermark. The paid edition also includes the phone app's source, so you can publish the app under your own name. Your code can tell the edition with PadPlayEdition.IsLite.

Different versions of the app and SDK

One app works with every PadPlay game. When the app and the SDK are different versions, each side skips what it does not know, and a new feature is used only with a side that says it knows it. If only one side is newer, everything works as before.

Only when the protocol version itself differs, the phone does not connect and shows "Update the PadPlay app."