nilFM

xrxs

xrxs is a game server which provides networking capabilities to the uxn virtual machine Varvara via the 9p protocol. It provides catridge and game data management, user sessions, and server-side game state synchronization.

9p exposes server resources as a filesystem, allowing the client to see the cartridges (uxn ROMs) available on the server, load one and its associated external resources, join a realm (a room for multiplayer play or a "save slot" for single player games), manage and see properties of the realm, read and write the shared game state (the universe), etc.

The system allows different users to load different cartridges, join different or share realms, and load different associated resources for their cartridges (that is, users don't necessarily see the same thing). The ctl file is used to issue commands to the server, and the universe file is used to write to the shared game state or read it back. The scope file can be written to in order to request only certain properties (atoms) of the universe to read, and reading it back displays those properties in the same order their names were given.

There is a basic security protocol for realms, allowing the creator of the realm to set a password which must be provided by other users who wish to join. The owner of the realm can transfer ownership to another user if they wish or reset the password at anytime. When created, realms have a maximum number of users set as well.

While uxn can seek up to 4GB into a file, it can only read as much data as remains in the 64KB total of its RAM. xrxs allows organization of game assets by implementing a command (chunk) that pages data files for sprite, audio, and text data, letting cartridges expand their resources and enabling resources used together to be stored semantically together in the same file, without piling resources into a single 4GB file.

The xrxs server is (more or less) feature-complete; check the readme for more details on its 9p interface or how to build/run it. There is also a uxn ROM and wrapper shellscript that acts as a client to list, download, and load cartridges. Cartridges should handle their own realm management, since each game or application will have its own rules regarding realm naming conventions, user limits, and password protection.

See my blog post: xrxs deep dive for more info on the motivation, design, and implementation, as well as screenshots and demo videos of the client.