CrossCode is a retro-inspired 2D action RPG that takes place in the distant future, developed by Radical Fish Games.

Amazingly, the game is written entirely in HTML and JavaScript. That means with just a few tweaks, it's possible to play this wonderful game natively on NetBSD with Firefox!

Most of the information here comes from Solene Rapenne and Thomas Frohwein (thanks!), but this page shows some NetBSD-specific tricks.

Where to buy

GOG is the best place to purchase CrossCode for playing on NetBSD due to ease of installation (see below).

Installation and setup

Obtain and extract the game files

Download GOG's Windows offline backup game installer for CrossCode. (It shouldn't matter whether you get the 64-bit or 32-bit version.)

Download innoextract from pkgsrc:

# pkgin install innoextract

Create a new directory, change into it, and extract the game files from the installer:

$ mkdir crosscode
$ cd crosscode
$ innoextract --gog setup_crosscode_1.4.2-3_(32bit)_(65218).exe

(Alternatively, you could download the Linux installer and unzip it, as Solene explains.)

Apply a patch

Find the file called node-webkit.html inside the assets folder. You need to comment out (or delete) the indicated block of code; it's toward the bottom of the file. (Patch courtesy of Solene Rapenne.)

--- node-webkit.html.orig   Mon Dec  9 17:27:17 2019
+++ node-webkit.html    Mon Dec  9 17:27:39 2019
@@ -51,12 +51,12 @@
 <script type="text/javascript">
     // make sure we don't let node-webkit show it's error page
     // TODO for release mode, there should be an option to write to a file or something.
-    window['process'].once('uncaughtException', function() {
+/*    window['process'].once('uncaughtException', function() {
         var win = require('nw.gui').Window.get();
         if(!(win.isDevToolsOpen && win.isDevToolsOpen())) {
             win.showDevTools && win.showDevTools();
         }
-    });
+    });*/

     function doStartCrossCodePlz(){
       if(window.startCrossCode){

Configure bozohttpd

The next step is to make CrossCode available on a local web server. Fortunately, NetBSD comes with bozohttpd out of the box, and it is easy to set up. Just add a line like the following to inetd.conf(5):

9000 stream tcp nowait:1200 _httpd /usr/libexec/httpd httpd -X /path/to/crosscode/assets

NOTE. The first number is the port number. 9000 is just an example. Please pick a number that won't be used for any other applications on your system. Your game progress will be lost if you host the game from a different port, so choose a number that will be reserved for CrossCode!

NOTE. The "1200" nowait:1200 represents bozohttpd's maximum spawn rate. It's important for this number to be high enough, otherwise the game may crash. The default value of 40 is not suitable for CrossCode. 1200 works in my testing, but in case of failure, try raising this number and restarting inetd.

To start bozohttpd, add inetd=YES to /etc/rc.conf and then start (or restart) the inetd service:

# service inetd start   # or 'restart'

Play on!

Point Firefox to http://localhost:9000/node-webkit.html. The game should load now. Have fun, and try not to lower the difficulty setting!

What works

What doesn't work