PSXRecomp | Save States, Rewind, and Netplay

Four-player Twisted Metal 4 online, a rewind filmstrip, and twelve save-state slots — three features that turn out to be one capability, built mostly by the community.

PSXRecomp | Save States, Rewind, and Netplay
Tomba! — rewind filmstrip in psxrecomp

Weeks back, two separate PCs across the entire North American continent played two player across Twisted Metal 4, fully recompiled using PSXRecomp.

Through unparalled commitment, TechnicallyComputers set out to bring netplay to PSXRecomp. TechnicallyComputers spent a significant amount of time working on netcode for Battleship, and sought to re-use what he learned to see if he could bring it to an ecosystem. And thus, recomp-net was born

This article one that isn't alone celebrating new functionality, but the accomplishment of collaboration in the new world of AI.

Netplay

PlayStation games recompiled, and now online

PSXrecomp was ground zero for recomp-net, but it won't be PSX only. PSXRecomp is a proving ground, but this tool is one that is ready to be extended soon. Long term, the aspiration between TechnicallyComputers and myself is to bring this to NESRecomp, SNESRecomp, SegaGenesisRecomp, and more. Under the same notion that each console ecosystem becomes battle tested by each game and benefits all future games, the same aspiration is true for recomp-net itself. Each ecosystem is a give and take to see this become the de facto netcode for recompilations.

The Online Player Experience

recomp-ui, an imgui based launcher re-usable across all of my *recomp ecosystems, now exposes an optional Netplay menu for developers who want to support online play in their game.

As a user, you launch the game, you configure your controller, and you head over to the netplay button. You can browser or host a lobby. Lobby hosts can drag and drop players to rearrange controllers, and kick off a game.

All connected players see their game launch in parallel, the netcode ensures players stay in sync as an old couch-multiplayer title is given a second life over the net

This netcodem akes use of prediction. That prediction is the difference between online play that feels like the game and online play that feels like a slideshow. The older approach — everyone stalls until every input for the frame has arrived — is still in there as an option, and it is still the right pick for a LAN or for debugging. But rollback is the default now for the titles that ship it.

Some important notes about this first release of netplay:

  • Multitap works. Lobbies of three or more seats bring up a virtual SCPH-1070, so four-player Crash Team Racing and five-player Bomberman behave the way they would with a real tap plugged in.
  • BIOS reconciliation. Each peer advertises what it can run, and the match picks a single BIOS for everybody. PSXRecomp supports OpenBIOS + Retail BIOS, but ensuring the right BIOS for everyone ensures determinism
  • Disc matching is strict. For multi-track games, “any USA copy” is not good enough. Peers have to be running the same image geometry, or the CD audio drifts apart from the game and the session desyncs. Titles can require a proper cue sheet and an exact track count.
  • Mods are off online. Every netplay session runs the stock game. Your offline mod selection is left alone and comes back when you leave. Mod selection & synchronization are expected to be supported in future releases
  • LAN and direct IP still work. Two players go straight peer to peer. Three or more route through whoever is hosting.
  • Up to 8 player support. Each developer should assign title limits, but recomp-net is ready for games up to 8 players.

Supported Titles

psxrecomp and recomp-net seek to prove themselves as reusable ecosystems. Unlike decompilation ecosystems, which often focus on supporting a single title, the focus here is have a re-usable baseline.

As such, netplay laucnehd not for one title, but for eight titles out of the gate. These titles represent a mix and match of titles that extend beyond Playstation's typical 2-player constraint through use of the multi-tap.

recomp-net

As mentioned earlier: none of the netplay code lives in psxrecomp. It lives in recomp-net, a portable netcode library with no idea what a PlayStation is. It knows about input slots, opaque pad blobs, prediction horizons, and getting two machines to agree on what happened. The rollback host policy — the pacing and prediction feel — lives beside it in retcomm-rbengine. The lobby and signaling server is its own open-source project, so you can point clients at the community instance or self-host your own lobby system.

That separation is the point. psxrecomp is the first host to use it, but the library was written so that nesrecomp, snesrecomp, segagenesisrecomp, and whatever comes next can adopt it without reinventing a netcode stack per console. A recompiled console runs its guest deterministically and can snapshot its entire machine state on demand, which is exactly the contract rollback netcode wants. The consoles differ; the contract does not.

Save States

Many slots, any moment

The way in which recomp-net was built required an important pre-requisite. It needed very good state snapshotting. Such state snapshotting, as it turns out, lends itself well for save states!

Historically, save states were built in for purposes of PSXRecomp development. They were flaky and if they did work, were slow. With the work set forth by recomp-net, save states are now snappy and reliable.

As such, they are now becoming a first class citizen in PSXRecomp, which now features it's own UI and up to 12 save slots for save state management.

💡
Save states are scoped per BIOS, but are re-usable across ecosystems. You can take a save state from Windows to Linux to Apple silicon, so long as the same BIOS is used
psxrecomp save state menu showing slot 01 with a Tomba screenshot thumbnail
Tomba! — save state slots with thumbnails and timestamps

Rewind

Undo the last few seconds

Tomba! Recompiled demonstrating rewind and save states

Capable savestating and netplay means aggressive state management and proper state restoration going forward. When you turn it backwards, you have rewind! Inspired by the Nintendo Switch Online rewind functionality, PSXRecomp now features its own rewind feature, which is configurable in PSXrecomp's launcher-ui interface.

psxrecomp rewind overlay showing a filmstrip of recent game states along the bottom
Tomba! — the rewind filmstrip, scrubbing back through the last fifty states

RetComM

Unication of recomp releases

TechnicallyComputers has been busy! Not only has he been instrumental in netplay and the underlying foundation that gave us save states and rewind, but also a way to find all these games in one place!

RetComM Launcher showing a PlayStation game library with Metal Slug X selected
RetComM Launcher — the PlayStation shelf, with per-title memory cards, BIOS selection, and install state

As ecosystem adoption begins to grow, RetComM (Retro Compilation Manager) seeks to unify the disjointed distribution and management of having many recomps available.

RetComM manages the experience from download to play. It is capable of fetching portable toolchains to help compile titles, manages version updates when titles get new Github releases, stores your ROMs and BIOS dumps in common locations for use, grabs boxart, and can even integrate with your RomM library.

It, too, is using psxrecomp as its starting point, but is positioned to manage recomp titles from other ecosystems, as well as decomps.

It aims to keep everything under one roof, ensuring ease of adoption across the entire recompilation ecosystem.

Closing

Reiterating a sentiment shared in previous articles: My aspiration is not to focus on specific titles, but build an ecosystem. I am very grateful for TechnicallyComputer's contributions today, and am excited to see titles given a second life by others with this framework. I continue to be humbled and overjoyed at the positive energy consumers of these tools have brought, and am excited for the future to see what more we'll be able to achieve.