JSim Beginnings

A few years ago a community of Jeopardy enthusiasts I’m tangentially associated with lost the site they use to practice, and I had the idea of building a replacement site. I was still in school at the time and other things got in the way, but for the past few weeks I’ve taken the old prototype, revamped it, and gotten it to a ‘playable’ state. There’s still a lot of work to do, but at least it’s now on my GitHub so if I’m unable to continue it’s there for someone else to pick up.

Current Playability

At the moment, the site could be used to play an almost real version of Jeopardy with mild difficulty. A user can create a new room of the type jeopardy, and set up the board by adding questions with the command /q cat#, q#, question and setting the categories with /cat cat#, category. This takes a fair amount of work, since every question needs to be set individually whenever a new game is started. In the future, the ability to set the board by reading a local file would be very useful. When other users join the room, they can be designated as players with /player userid (the userid is the number in the user’s name). This will cause their button for buzzing in to be visible, and for their name and score to be shown to all users.

When the host is ready to start the game, a question is chosen by one of the players and the host asks it with /ask cat#, q#. The question will instantly appear for all users and the players will be able to buzz in. Once one player buzzes in, the others will not be able to. If the player answers correctly, the host awards them points with /correct cat#, q#, userid. If they answer incorrectly, the host can allow the other players to buzz in once more with /buzzon, and the cycle repeats for the next user that buzzes in. This is repeated until all the questions on the board are asked.

Once a question is shown to the players, that space on the board will always be visible. This prevents a second round from being played while maintaining the players’ scores. Additionally there is no Final Jeopardy. These are the two missing aspects required to truly be able to play a full game of Jeopardy on the website, though some of the QOL features may take precedence.

Technical Specifics

JSim is written in TypeScript, and the back-end runs on Node.js. Once I started making the code modular I realized that the front-end and back-end needed to be compiled differently due to Node using CommonJS import syntax while web browsers use ES2015 by default. The communication is done over websockets, and follows a protocol similar to Pokemon Showdown’s. Each room is its own object, and incoming messages are directed to the room designated at the start of the message.

I chose to not use any large JavaScript libraries for this project. This is partly because I was not already familiar with them, but mostly because I do not think they are necessary for something of this scale and would only bloat the project rather than simplify it. This may change over the course of the project, but for now I’m keeping it light and simple.

Further Work Needed

There are still a number of features needed to bring it from a Jeopardy-like game to a Jeopardy simulator:

Additionally there are many QOL features that are just as important:

That’s not to mention all the work to be done on the visuals. It’s very much programmer art, as I’m not very experienced with the front-end of development on top of not having the best sense of aesthetics. The visuals aren’t a priority, but I’ll be trying to not leave them too far behind.

The way the client and server are structured allows for more than just Jeopardy. A new type of game can be added by extending the BaseRoom class on the client and the server, and adding the new files to the roomtypes/ directory. I don’t have any plans for more games at the moment, but it’s nice knowing that I (or anyone else) could easily add another. It also does a good job of completely separating the logic of Jeopardy from that of the site.

For now, JSim lives here, on a subdomain of this site. I only run the backend when I’m doing testing or getting feedback from others. When it gets to a more complete state it will be run 24/7 and I may acquire a different domain for it.