Hexed Dev log

Firstly, I think the theme this year worked really well. More of the games I've played have felt finished than in previous contests, probably because the theme encouraged people to pick an idea with a scope appropriate to a weekend game jam. This certainly applied to me.

I didn't plan to do this jam very long in advance - I heard the contest was happening a few hours before it started. My game idea was one I'd considered when looking at the themes in the final round of voting - a variant of a game a friend and I had invented with pen and squared paper, where each player controls one end of a line and must move at right angles to their previous move. I did implement a computer version of that about a decade ago, but I should be able to do it better now I'm more experienced at programming.

I decided to use a hex grid, so that I am actually making a new game, and to use SVG for graphics, since I'm familiar with that, and simplicity is a good look for abstract strategy games. It took around 4 hours to draw a hex grid and some lines and circles on top of it, which is longer than I felt it should, partly because there's an SVG rendering bug where browsers don't draw lines that are exactly vertical and have a color gradient. It didn't take long after that to get a working UI (SVGs interact nicely with browser event handlers).

The first version: v1 screenshot.png

It felt too easy for the starting player to win, but I needed to sleep, which I probably should have done sooner. The next day, I changed the board to the current one, which was a very small change to the code once I worked out what the change needed to be. I later realized that there's a trivial winning strategy of mirroring in the original version (exhibited in the screenshot above), so I'm very glad I changed it.

The current grid, showing a poorly played game: Hexed.png

I then started work on multiplayer. The server side code for my last multiplayer Ludum Dare (LD49, post compo version) wasn't specific to that game, so didn't need changing. I'd used it in another turn based game, so the client side code for that gave me a good starting point to get it working quickly. It's a bit janky - there can be problems for people trying to join a new game if someone has left a game in the middle of it and the other player has left the tab open, but there aren't enough people playing simultaneously during Ludum Dare for that to be much of a problem, and the connection closes after 5 minutes of inactivity. Some friends helped me playtest it that evening, and it was fun to play, which hasn't really been true for my prior games, certainly not halfway through the contest.

The simple nature of the game meant that implementing a Monte Carlo tree search AI wasn't too difficult, I got it done later that evening. Having made one of those before for another game helped. I beat it consistently if I'm paying attention, so I was worried I'd got something wrong, but I think the difficulty is reasonable for people trying out the game in Ludum Dare; maybe I'll make a better AI in the future. Monte Carlo tree search is quite hard to incrementally improve with heuristics, since taking the time to calculate them reduces the number of games that can be played out and it can give the computer a blind spot towards strategies that aren't using it.

I spent the last day finishing off the AI, getting customizable keybindings to work, and adding some information about controls. I spent a while trying to improve multiplayer so that if you reconnected, the opponent would be able to resend the state, and you could resume the game, but it wasn't very reliable when I ran out of time, so I reverted to an earlier version without that feature.

Overall, I didn't try try to implement something technically challenging like I have in previous jams, so I don't feel like I learnt much new, which is a pity, but the result was a more fun and polished game than I usually make in 48 hours and I'm more confident in being able to do things I know I've done before.

It still needs some more ratings, so give it a try, I'll be joining multiplayer games for the next few hours: https://ldjam.com/events/ludum-dare/54/hexed