On demand Game Downloads (Gaming over IPFS)


Today I did an experiment, way back when I played SWTOR they allowed you to play in the starting area before the download was finished, similarly World of Tanks allows one to play with low-tier tanks before the high-tier download etc.

It's a nice thought to be able to play immediately, games are specifically great for this since much of their data is stored in separate files most of which are unloaded at any given time.

And with modern tools like FUSE, we can simulate this behaviour for arbitrary games.

So I tried to add some of my games to IPFS.

In this case I have to warn that this is internal, I bought all these games and I did not provide these CIDs to the network, and you should not do that either since that would be against copyright.

IPFS allows peers to exchange data directly before consulting the DHT, so since my devices are directly peered this entire operation is isolated to my setup.

Nevertheless, I tried adding a symlink my games folder pointing at /ipfs/<some-cid>/Morrowind. Unsurprisingly, I could then open OpenMW and immediately saw the data files and configured it all up. However for some reason it did not start until I tried to pin the CID, which is obviously something we don't want to do, as that downloads 100% of the game.

For some slight context, IPFS will retreive the data and then cache it locally, which means that the game references through the FUSE mount will look like it is installed, but actually behind the scenes it will get downloaded on the go as the game touches different parts of different required files.

I then tried a few others and achieved very promising results. The command ipfs files stat --with-local shows us not only the cummulative size but also what portion is downloaded to the given node.

The "Size to Play" is the portion of the game you need to download to load into the first level.

NameSize% to playSize to play
Touhou 10.51.2GB25.79%301MB
Noita1.7GB18.54%307MB
SizeMeUp415MB15.71%65MB
Arx Fatalis (Libertatis)1.1GB23.11%256MB
JazzPunk2.9GB8.33%238MB
FAITH: The Unholy Trinity838MB18.83%158MB
Robin Hood: Legend of Sherwood1.1GB9.24%98MB

The interesting part about SizeMeUp is that that game includes Ren'Py, and downloads about 80% of it, however since many games come with that lib, I guess some deduplication would happen, sadly not much as 98% of the game's size are assets.

Arx booted up essentially immediately, everything was perfectly smooth throughout. JazzPunk took about 10 seconds to start and then ran smooth as well.

However The Soulstream Expansive and Scorn seem to just not boot up, they stop downloading anything after a few hundred megs.

There's a bug with Wine games that when I quit out of them, the directory I was in sort of vanishes and I have to reenter it.

direnv: error LoadConfig() Getwd failed: getwd: no such file or directory

Fascinating the directory doesn't have . and .. entries.

As many will tell you I guess FUSE is slightly flaky for this, however goddamn would this be kinda nice to have, and definitely possible in some ways, I really love how the entire installation process on a laptop for a multi gigabyte game can just be:

ln -s /ipfs/<some-cid>/Scorn ~/Games/Scorn

And all it costs me are occasionally slightly longer (but honestly not by much) loading screens.