The 'rcade' Package
rcade.RmdThis article talks about the package itself. For how to use it, see
vignette("guide").
1. Manifest
Why does this package exist?
Until now, no games existed in R that could take live input from the user. This changes that, and provides a powerful framework for creating such games.
I came up with this project to give myself an opportunity to build a lot of skills—package creation, documentation, etc.—while working on something genuinely fun and cool.
2. Directory
This package comes with a full suite of vignettes detailing every aspect of how things work. These are listed below with a short description:
2.1 General Vignettes
vignette("guide") goes over how to use the
package to play games.
vignette("engine") describes the high-level
structure of the game engine and its systems.
vignette("snake") provides a full walkthrough of
game creation using the package.
2.2 Systems Vignettes
vignette("timing") explains in detail how the game
runs at the right speed.
vignette("inputs") describes how the engine
captures and interprets user input.
vignette("render") details everything that goes into
drawing the game to the console.
2.3 Function Documentation
The Reference page has a link to the documentation page for every function in the package. You can also find specific functions with the search bar or by clicking on them in an article.
3. Prebuilt ROMs
Rcade comes with several games included to demonstrate the various capabilities of the package.
3.1 Snake
![]()
A port of the classic game Snake, running quite smoothly. Demonstrates the interactivity of rcade well and serves as a great guide for ROM creation.
3.2 Super Rrio (In Development)
![]()
Super Rrio is rcade’s premier game, a platformer in the style of Super Mario Bros.. ROM and article currently in the works!
3.3 Bad Apple
![]()
This ROM isn’t a game, but rather a proof of concept for the graphical capabilities of rcade.
Bad Apple is the canonical video to demonstrate the graphical capabilities of hardware that… shouldn’t really have these graphical capabilities. People have run it on everything from original IBM computers to oscilloscopes to calculators to glitching pokemon to run the video ingame via ACE.
I’m certainly not the first to make this on a CLI console, nor in R. But I believe this is the first time it’s been done on the R console.
3.4 R2Studio
![]()
It’s RStudio in RStudio!1 This ROM draws its own little console and plotting window, and the user can run R code by sending it through the input system.
Running a program in itself is the pinnacle of wacky software enginnering, in my mind.2 This really shows how robust rcade can be when pushed to its limits.
(…yes, it can run itself too.)
4. Future Plans and Ideas
The package’s code and systems are complete, but there’s plenty more to do with it:
I found a way to completely remove the flickering present when rendering at higher resolutions— I’ll need to rewrite and redocument some things to implement this.
I need to finish Super Rrio and its devlog article.
I’d like to release to CRAN at some point and maybe promote the project more in the R sphere.
I want to make an addon package for online multiplayer functionality, with a Tron ROM+devlog for reference.
A game demonstrating the ASCII (and/or unicode) capabilites of rcade could be cool— the package is capable of much prettier things than I’ve shown so far.
5. History and Motivation
There are a few excellent resources3 detailing the former state of R gaming.
Vanilla R games were restricted to text-based games; action games required shiny or an equivalent package to take live input. But no longer!
I wanted to make a game in base R! It started as a joke idea I pitched to friends, and I ended up developing it into a full engine in Spring 2025. This engine was a bit different—– it used an in-console ASCII display to run a simplified Super Smash Brothers-like game and featured working multiplayer (!) using a node.js server. It worked quite well but I abandoned it because… the fun was all in making it work.
In the winter, I realized this was an excellent opportunity to turn into an R package for the sake of practice and exhibition. Many of the concepts used by the package originate from the old engine, but all the code is new and much nicer, and fully documented!
6. Goals
Adapting the systems from my original project, this package had many goals:
To run in base R with no dependencies! (excepting preinstalled packages like
tools)To work as a cohesive package with high-quality, R-style code— e.g. proper handling of objects, no global assignments, and CRAN compatibility.
To be a game engine, on which people can make their own games; the original project could only be used to play the one game it was designed for.
To have thorough documentation and vignettes— these are a blast to write and I haven’t often gotten the opportunity to make them.
Through all these, to be as convenient as possible for other people to use— much effort was spent manicuring the code and documentation to inter-reference cohesively and maximize readability. UX is a top priority for an R package!
I’m happy to say that this project achieved every goal, and it was a pleasure to develop. Enjoy!
7. Notes
7.1 Style
I choose to write R code in a way that’s slightly easier for people unfamiliar with R to understand;4 mainly forgoing the use of <- and declaring function returns explicitly.
Additionally, for the sake of organization, function names are
prefixed by general context— e.g., functions pertaining to “the
rendering process” take the form render.foo(). This is
against S3 conventions (where the suffix indicates what class a function
operates on) but I find it to be an immensely valuable tool for writing
understandable code.
The documentation for this package was formatted to look nicest
natively in RStudio, i.e. through ?foo. Formatting may be
occasionally wonky on the website, but it shouldn’t interfere with
reading.
7.2 The Name ‘rcade’
The name “rcade” was too perfect to pass up for a host of reasons. Two packages already ‘exist’ with this name, but I don’t think this will cause any conflict:
A deprecated bioconductor package that was removed from bioconductor and CRAN in 2015.
An old github-only package that runs HTML5 games in R.
Both packages are obscure and nearly a decade old— may the R gods be merciful on my usurping of the name.
7.3 AI Disclaimer
No LLMs were used5 in the making of this package. All writing and code was done by me!