10 July 2026

Hex-games

I played turn-based games on hex-grids in the late 1970, and have wanted to write a computer version for a long time. I have actually started (and abandoned) such projects at least 3 times. The problem has been what language, and graphic environment to use. This take I use HTML5/canvas and JavaScript.

Current projects:

The source is available on github. All games are Work in Progress (WiP). Only WS&IM has an AI, the others can only be played Solitarie. The graphics look good, not thanks to me, but thanks to artists on BGG.

Save game?

Short answer: Doesn’t work.

Slighty longer answer: Save is possible. The user can download a save in json format, but the problem is restore. A browser script will never ever be allowed to read the local file system! For obvious security reasons. If the game is loaded locally (from a “file://” URL), there is a work-around: the user can manually copy the save to the game directory. But then you must download the game.

Player v.s. Player (PvP)

This requires an active server. On this site, which is Github pages only static content is allowed. I know how it’s done using a server relaying messages via Web sockets. But, as said, an active server is required. I have not found a free hosting that doesn’t request my credit card. I have made a container, and can load it on a virtual server, or Kubernetes. The Waterloo game is prepared (but not ready) for PvP, the other require some work.

I am not prepared to pay for this, since I expect like zero users, but if some one can give me access to a server, I’ll do it (probably).

AI

This is really really hard. I am not going to hook up some LLM or something, but an old fashioned algorithmic “AI”. For WS&IM I was fortunate that a solo-play method was already invented (it’s very clever, read the article), so it was easy to adapt. For Waterloo, tactics is not so hard, but battle stategy is. For RDTR I can’t enough express my respect for the programmers who pulled this off on DOS, Amiga and Atari!

tags: