Expose serial API to games - for Playdate<->Playdate multiplayer and Playdate<->PC communication

,

Since the Playdate exposes a serial interface when connected to a PC via a USB-C cable, it's sort of possible to get Lua games to communicate with a PC by misusing the eval serial command to send data in and print() to send data out.

It would be great if there was a simpler way to achieve this "officially", maybe where a game could register its own serial commands with callbacks that get fired when they are received, and send out serial data to whatever is connected.

Additionally, if it would be possible for two Playdates to open a serial connection between eachother when joined with a USB-C to USB-C cable, this could allow for simple Gameboy-Link-Cable-esque multiplayer (for people who are lucky enough to own multiple Playdates!)

16 Likes

Bluetooth would also be great for multiplayer and wouldn't require another cable

What about over LAN via WiFi? If we are looking for no cables, that might be the best option.

I know nothing about play date and networking, just that it has a wifi chip built in…

I totally get why everyone wants wireless (and I do hope we get access to it in the SDK eventually!) but wireless on the Playdate currently is kinda flakey, slow, and eats battery power ravenously. Since the Playdate already supports serial over USB when connected to a computer, it seems slightly more achievable to use that, at least in the short-term.

3 Likes

I like this approach for sure. Thanks for the context.

2 Likes

Im realy interested in this too. especially the usbc to usbc version. Seems the easyest way to me.

Iv looked for some examples
First heres EricLewises 2 player example that conects to a pc and uses a couple scripts on pc

the second is the playwrite project

Id like to make some 2 player fighting games

1 Like