Article posted on: 2021-09-12 19:57
Last edited on: 2021-10-09 13:36
Written by: Sylvain Gauthier
New project just out of the oven, qirc is the result of my angry fist shaking at cloud-based Go playing platforms.
I’m a big fan (although a poor player) of the game of Go, and I have been
enthusiastically coding a 3D interface to Go-playing programs since last year or
so, called weiqi, following my
profound disappointment with existing solutions, which are either too old and
not maintained like
cgoban, written in Java like
cgoban2 (which is a big
no-no for a tasteful, elitist programmer like myself), or simply a pure
Soylectron abomination like
sabaki (why yes my 2D Go program eats up 1.5Gb of
RAM, what’s wrong with that?).
weiqi –which I wrote in C using our 3D rendering engine called 3dmr–
can communicate using the GTP protocol with Go engines such as
gnugo. It does
so with the use of UNIX pipes, but it can also use UNIX domain sockets. It
consists in less than 3000 lines of code (not counting the ones in
I added UNIX sockets as a proof-of-concept and not thinking too much of it, and I assumed that if I wanted to have proper network support and be able to connect to mainstream Go servers, I would have to write a whole different built-in module.
But instead, I ended up having an elegant, very configurable 3D interface that
can run as a separate front-end to whatever is in charge of deciding game
parameters and transmitting moves over the network. Turns out I don’t have to
integrate a module for each network backend I want directly into
weiqi. I can
simply write a daemon for each protocol, website or backend I want, that will
connect and forward moves to the UNIX socket.
qirc is one such daemon. It’s basically a simple CLI program that connects to
a IRC server, using the given nickname, and joins the given channel. A simple
command set allows the user to create and publish games on the lobby channel.
The protocol is extremely simple, each
qirc-related message sent to IRC is
:qirc, games are a one-line message
game <parameters>. The
host of the game is inferred from the message’s sender.
When a new user joins the lobby, of course he doesn’t have access to the
previous chat history, so he can’t get the list of open games. To solve this, he
can just send
:qirc games? in the channel. All
qirc instances listening to
the channel will then send him their open game (if they have any) with a private
message so as to not pollute the main channel.
qirc is able to list open games and display them to the user, who can then
join one by sending a private
:qirc join message to the host of a game. If the
host accepts, the game starts, the UNIX socket for the graphical client is
created for the UI to connect to it and start displaying/querying moves to the
user. Successive moves are then sent back and forth between the two players
using private IRC messages, which of course won’t show up in the main channel.
What’s interesting with this method, is that it’s effectively using a plain IRC server with no requirement on the server’s side as a thin TCP wrapper/proxy to distribute/route TCP packets between IRC users.
IRC servers are ubiquitous, they don’t (generally) require any registration, so they fit quite nicely a slow, turn-based game like Go.
This method, unlike most if not all modern day Go websites, is
interface-agnostic at least theoretically (in practice, not really considering
weiqi can connect to the
qirc daemon, to the best of my
knowledge). It’s (finally) a simple, decentralized, convenient way of playing Go
with your mates, without needing to register, and most importantly, it removes
the God forsaken web browser from the equation.
So there it is, I don’t expect many of my readers to both be into Go and willing
to experiment with this (very much alpha) piece of software, but if you do, be
aware that I set up a channel called
#weiqi on our IRC server
(pedantic.software) and I’m monitoring it regularly, so if you want to have a
Go, it’s just a matter of
qirc_wrapper <your-nick> pedantic.software '#weiqi'.