Let's Talk About ContrastUS Tech

What?
ContrastUS.Online was my entry for the Radial Menu game jam #1. The theme of the jam was “Light & Darkness”. You can find links to it at the bottom of the post.
The idea I came up with for the game was to simulate an office environment where you complete menial tasks. However, the players are being tracked and are being ranked. Players get to choose a faction and can idle or solve puzzles to earn points. These points are ultimately tracked for leaderboards, which the player can view from inside the game or from the web. Asynchronous multiplayer, I suppose.
The game was to have a web and desktop builds. We obviously only submitted a web build, due to time.
So, I needed a leaderboard backend to be able to achieve this.
I may have over scoped a bit.
I ended up building a little more than a game and I’d like to walk you through the technical maze that I constructed for this jam.
Tech
ContrastUS is made up of a few different tiers.
- Backend
- Game
- Web Frontend
Backend
First off, let’s talk about the backend, since that’s the single entry-point for solving asynchronous multiplayer.
The game’s backend is a c# net9 mvc/webapi, built from scratch (in a weekend).
The persistence layer is running sqlite. No, little Bobby Tables has no place here.
This was then deployed to an AWS EC2 instance running AWS Linux.
I purchased a domain (ContrastUS.online) and an SSL cert. The DNS is configured through AWS Route53.
Game
The game was built in Godot Engine 4.4 using GDScript.
We used the iRadialMenu Godot Plugin from iRad.
To communicate with the backend, I utilized the HTTPRequest node. I think this is the part I most regret.
Opinion —
HTTPRequest is not built for complex APIs. I don’t know what alternatives are out there, but if I had to write this again I would probably investigate popular HTTP libraries for godot (or write it in straight c# if I’m not doing a web build). The biggest drawback for me was the callback pattern that is used to make and receive requests. I’m much more used to making async requests and awaiting responses.
Web Frontend
I ended up adding in MVC/Razor for the frontend. However, I’m not really using anything models. So, we’re serving up a single CSHtml file that outputs static HTML/CSS/JS.
The leaderboard portion is written in plain old javascript. It makes a single fetch to the backend to retrieve the leaderboard data and there’s some operations to roll up the data for display in the two tables. It’s been a while since I’ve had to write js that wasn’t nodejs.
We are using a ttf font from Kenney Assets, so I did have to make a couple of changes to the backend to be able to serve the font.
Tech Review
So, there’s a few layers that make up ContrastUS.
Let’s review the languages and infra.
- Godot + GDScript
- 2298 lines of GDScript
- net9 MVC + C#
- 677 lines of C#
- 1 database with 7 columns
- 1 csv - don’t ask
- 1 t2.micro EC2 instance
- 1 domain - ContrastUS.online
- 1 SSL cert
- Route53 DNS
- 1 Elastic IP
- HTML/JS
- 91 lines of javascript
- 116 lines of HTML/CSS
Final Thoughts
I overscoped and thought I could make a fun game AND a reusable backend API in the same weekend. What actually happened is that I made a husk of a game and a base-feature set reusable leaderboard API.
I’m very pleased that I was able to complete the API - I plan on using this for future jams. In fact, I hope that it can be the central hub for synchronous network multiplayer games.
Thanks for making it to the end of my silly tech post and hopefully you’ll be able to find me making silly games, music, and art on the next jam. Cheers!
ContrastUS.Online
Status | In development |
Author | code5037 |
Tags | radialmenujam |
More posts
- ContrastUS Jam Results5 hours ago
Comments
Log in with itch.io to leave a comment.
Question: Can you get any cooler?
Follow up: If 3000 lines of code gets you this far, how many would make your original goal for this game achievable??
Bravo again. The only advice I might give is to add a hard mode: Neons.
~Ani
That is an interesting question. Honestly, no more than another 100 lines probably would have gotten me to my goal. There would have been a lot more work done with asset creation, though, and that’s where I would have spent additional time.
Cheers!