Back when I worked on the Pivotal Tracker team, we did full-time pair programming. As in, two people sitting at one computer, each with their own monitor and keyboard, working on the same problem. Occasionally, we'd need to take a quick break from work, and so we developed a small backlog of web-based games we could play to take up ~15 minutes of our time. These games were always browser-based, and didn't require you to create an account. This included some co-operative puzzle-type games like the LA Times Mini Crossword and the Daily Jumble (which has since updated and become much laggier and less performant than it used to be when it was purely browser based), but also included browser-based competitive games. One of our favorite was Slime Volleyball, which is thankfully still around.
There's something I love about these kinds of websites. Not to be the stereotypical nostalgic Millenial, but they really do take me back to the early days of the internet. Where you'd find a dumb time-waster online and share it with your friends in the school library. The ability to just load up the site and play, without having to login or set up an account, is incredibly refreshing. The worst feeling in the world is when a game that was previously free to play without an account suddenly requires you to sign up to play. One of the games we loved at Pivotal was GeoGuessr, which has become a bloated, over-designed abomination that makes you pay to play for more than 5 minutes at a time (an awful system that brings the worst of all the "freemium" models with none of the benefits). It used to be you went to the site, click new game, and got five locations to guess. That's it. Sure, their were ads, but they didn't limit your play time or force you to sign in.
I understand the modern internet is a capitalist hellscape where nothing good can survive indefinitely. I understand that the ad model doesn't work in a world full of ad blockers. But I still wish there were more of these small, fun games to play in your browser with your friends and colleagues for no cost, with no sign up. And it turns out I have a lot of free time, and a domain where I can host whatever I want, so instead of just moaning about how bad things are, I decided I'd make one for myself.
Largely out of laziness, I decided to just implement a game that already exists, rather than designing a new game from scratch. I also wanted to do something with a simple ruleset, so I wouldn't get bogged down in edge cases and implementation details. I recently re-watched Tom Scott's video on The Royal Game of Ur and that seemed like a perfect candidate. Also, because I'm a big, stupid masochist, I didn't want to install a framework and a bunch of node modules, so I chose to write the code for the game entirely in vanilla JavaScript. Was this a smart decision? Probably not! But I dove in anyway.
At first, I actually DID install npm with the idea I'd at least build some unit tests for this thing. I am big proponent of test-driven development, and it's my preferred method for building software, but it quickly became clear that the effort and bloat of getting an npm testing environment set up wasn't worth it for a project this small. So I abandoned npm and moved on to implementing my first prototype. Originally, I had this vision of building a high-level, customizable engine for buliding the board, pieces, etc. dynamically - but as I was writing the code I realized the odds of me coming back to this and using it to build more games was essentially zero, and so I scrapped that approach and just implemented a basic HTML page that had the board layout already built. Then, I implemented some small models for the overall game state, the pieces, and the players that were just to store the opening state of the game, and rendered the pieces, scores, and other game state info (current player's turn, each player's score, the last die roll, etc.) on top of the pre-built board. Once I had the rendering engine built and working with the unstyled board, the last piece was basic player interaction - rolling the dice, selecting a piece, and selecting a square on the board to move the piece to. Those were actually relatively simple, and since the renderer was already done all I had to do was update the game state model and call a re-render.
In short order, I ended up with this incredibly ugly but almost fully-functional game:
I had a few special movement rules to implement so I added a method that checked if a piece had any valid moves. In The Royal Game of Ur, a piece can move to either an empty space on the board, OR a space that contains an opponent's piece - as long as that space is not a rosette / star space which are "safe" spaces. If it's not a safe space, moving onto an opponent's piece sends it off the board and back to the start. You cannot, however, move onto a space that contains one of your own pieces. So, with those rules in mind I implemented the valid movement logic, and then used that to also check the scenario where a player has no pieces with valid moves, and automatically moved the game to the "pass turn" step when that was the case. At this point, basically all the game logic was done, so I moved on to "styling".
At this point, I actually wanted to put as little effort as possible into making this look "nice", and so I went with a pure CSS approach and leaned heavily on early internet nostalgia, and tried to make it look as much like an old Angelfire or Geocities page as possible. Pre-defined CSS colors, as few images as possible (I only used a few uri-encoded SVGs for the dice and the star spaces). I'm not 100% satisfied with the final result but it is definitely sending the exact vibe I wanted:
Then I just hid the debug info about the game state, and removed the "pass turn" button and added logic so that the turn passed automatically when a player made their move (or, with a short timeout and a message displayed below the "roll dice" button, when the turn is passed because a player has no valid moves). And with that, I was "done". It's far from perfect, but it's also free-to-play without an account, in your browser, for local multiplayer against a friend. And it's available HERE (and all the code is available here). Do I think many people will play this, or even see it? Doubtful. But I will say there's something extremely satisfying about playing one of the oldest known games humanity ever created as a crappy little JavaScript app. And it was fun to build. So I'll call that a success.