SEEDS ships a full Linux machine inside the game, on its studio's own RISC-V emulator
Against All Odds explains how the in-game computer in its space game SEEDS boots real Alpine Linux on PasRISCV, an open source RISC-V emulator written in Object Pascal, and why its network is switc...
AI-drafted from 2 sources. This story was written with AI from the outside reporting listed under Sources, and checked by automated tools before it went up. The originals have the full detail.
The computer in the home base of SEEDS, a space game from the studio Against All Odds, is not a menu dressed up as a terminal. According to a post on the studio's dev blog, it is an emulated 64-bit RISC-V machine that boots Alpine Linux when you start or load a game, and the planetary overview and stats screens the player opens on it are ordinary Linux programs. That holds even when SEEDS itself is running on Windows.
The emulator is the studio's own. PasRISCV is written in Object Pascal and released as free software under the zlib licence, along with a frontend called pasriscvemu, and the post invites other developers to use it.
A whole machine, not just the programs
The post says the team chose to emulate a complete virtual machine, with display, storage, interrupts and the rest, rather than only running Linux programs in isolation. The kernel sees what looks like real hardware. The emulated CPU supports multiple cores and the RV64GC and RVA23 profiles, including the hypervisor and vector extensions.
Instructions run through a mix of an interpreter and a tracing JIT compiler. The JIT only works on x86-64 hosts for now, but the post says it covers about 99% of the instructions the game hits. There is also an optional software floating point mode, because some behaviour in the IEEE 754-2008 standard cannot be reproduced exactly on x86 hardware.
Booting follows a conventional chain, OpenSBI to U-Boot to the kernel, so the system can live on a normal disk image. SEEDS uses that to keep a read-only root partition that game updates replace, plus a separate partition for the player's own data, such as the high score tables for the mini-games.
Retro screens and an OPL3 sound card
The in-game screens draw from a simple framebuffer, which the game then runs through its own shaders to add scanlines and phosphor glow. PasRISCV can do more: the post lists a VirtIO GPU with experimental 3D support, and the team got an X server running the Motif window manager inside the VM, though they say it is too slow to be usable on most machines.
On sound, the emulator offers retro cards such as the CMI8738 and FM801 with PCM and Yamaha OPL2 and OPL3 synthesis, as well as Intel HDA and VirtIO sound. The small game that runs on the in-game computer, Space Prowler, has a title theme that mixes OPL3 synthesis with sampled drums. The author wrote it in chOPLin, a tracker of their own that runs in a Linux console, and says they plan to release it as open source once it is more polished.
Talking to the game, but not the internet
The VM and the game talk over Linux virtual sockets using a compact binary format, so a program inside the machine can ask the game for things like terrain data or where the animals are. The post says most of the wiring is in place for players to eventually program and automate the planet in languages such as Python, Ruby, Rust, C or Go, though that is not the focus of the game for now.
PasRISCV also has its own userspace networking, enough for the team to install packages with Alpine's apk from inside the VM. In SEEDS, though, networking is switched off: the post says the machine cannot make any outbound connection at all, for security, isolation and reproducibility.
Sources
- Show HN: Our space game has a built-in RISC-V emulator that runs Linux (againstallodds.games)
- Discussion: Show HN: Our space game has a built-in RISC-V emulator that runs Linux (Hacker News)
Image: againstallodds.games