Ducks in a Row...


This post is more a running commentary on things I need to do to set up my dev environment for producing the game than anything readable. However, there may be some useful nuggets if you happen to use the same setups that I am...

Environment

I'm developing on Win10, using the Windows Subsystem for Linux to manage source code control. Dev language is latest version of Racket (cs), with the Urlang transpiler to build the JavaScript for the game. 

Source Code Control

Why am I doing something so crazy as WSL for source code control instead of just using Win-Git like anyone sensible? Well, I use the Mercurial DVCS. Like it a lot, actually. Don't particularly care for Git (mainly because of historical reasons with Windows implementation, which I'm sure are fixed now, but so what? The grudge lingers...).

Unfortunately bitbucket.org  decided that they didn't wanna' deal with us Hg guys, so they stopped supporting it and gave a deadline to get off the server before they wiped all non-Git repos. Well, that was _all_ my repos thanks, so I had to look for someplace else to jump. Not too many places are willing to handle Mercurial, it turns out. However, there was Source Hut. They were also set up quite a bit more securely than BitBucket, which meant that it was a pain to get Windows Mercurial to work with them (although it did, and I did it... Eventually).

So, if I use WSL, then I can deal with Source Hut as if I'm using Linux, which fits with their infrastructure and tutorials. It's also much more convenient that messing about with the putty agent stuff and all, with the slight annoyance of launching a WSL shell when I am ready to push changes. But... I'm participating in a Game Jam, using Lisp. Really, "sensible" doesn't enter into it.

So, to make this work, I had to set up a WSL account. Fortunately, I'd already done that when I installed Win10. Then updating local packages and installing Python3 for Mercurial:

sudo apt update && upgrade
sudo apt install python3 python3-pip ipython3

Then to install Mercurial itself:

pip3 install mercurial

(Apparently, there's a Python3 "hg" package that does nothing. It didn't seem to have any actual script files in it, so maybe a botched setup in the Python Package Index? I hope it wasn't some sort of awful virus...)

I wasn't able to run the "hg" command at first. It turns out that stuff installed per-user in WSL goes into %~/.local/bin. This was where "hg" had gotten installed, but because I didn't have the %~/.local directory until hg was installed, my %~/.profile hadn't added it to the path. The easy fix was to log out and start a new WSL shell, and there it was!

Now you have to have an SSH key for dealing with Source Hut (see above, more secure). I had an old %.ppk from when I had first gotten everything working, but it was all stale now and I couldn't remember the passphrase. So I blew it away and made a new one:

ssh-keygen -t rsa

I named this one for source_hut so that hopefully I could keep them all straight. ssh-keygen provides a private and public (%.pub) key. The latter needs to be added to the keys in the Source Hut account so that it can identify me. Now I was able to checkout the game project that I had created on Source Hut through the web interface.

However, I wasn't quite done. I needed to also update my Mercurial settings to use my proper username. I had a %mercurial.ini file from where I had been using it in Windows. I just copied that to my WSL home directory and renamed to %.hgrc, and then Mercurial picked it up. I checked the new config with:

hg config ui

Publishing an HTML Game

So, now that I had that working, I wanted to try to get my game test working on the Itch game page.

The test-game is a quick thing I hacked together when I was first evaluating JavaThrcript. Unfortunately, that one had some problems, but then I got introduced to Urlang, which runs in Racket to generate JavaScript from Lisp code (hat tip: @spdegabrielle). There's also RacketScript, apparently, but it needs NodeJS, which I hate, so will stick with Urlang for now.

Itch provides useful hints for HTML5 game uploads here: https://itch.io/docs/creators/html5.

However, they seem to be assuming you'll be exporting from a known game engine, which I totally am not. So there are some hints as to how to set it up, and it looks like if I just park a canvas of the appropriate size on the page I'll be set, but there may be some more learning to be done here.

In the meantime, I'm going to run with what I've got. Which is the dynamic HTML file generated by my test program with the accompanying Urlang Javascript. I had to drag the %.html file over from the temp directory where the program put it (will need to fix that), rename it to %index.html and then zip it up along with %game-test.js.

Once uploaded, you can specify that the file "will be played in the browser".

And that's it! There's a bunch of test junk on the page and the size is all wrong, but it's on the game page and you can "click to play"!

Files

game-test.zip Play in browser
Oct 16, 2021

Get Qube*Cat

Leave a comment

Log in with itch.io to leave a comment.