DevBlog #03
Hi all,
I’ve been super stoked to keep working on the game. My tribulations from working through the netcode are finally coming to an end (I hope). I’ve been teasing talking about the netcode for a while. While it can be boring, I think it might be interesting to aspiring developers, so I wanted to talk about it.
Here’s some context for how we got here.
We were originally thinking of making a website like “https://awbw.amarriner.com/” where you log in to the website and it manages everything for you. We were using a JavaScript/TypeScript React frontend, and I was hosting some servers on a cheaper platform for us to use. As we got further and further down the game-building path, we started wanting things in a standalone client and a website. Facepalm.
So little old me rewrote the WORKING NETCODE to accommodate that as our idea morphed and pivoted. Hey, stay flexible, right? After a while, we realized what we really wanted was a standalone client that we could sell on Steam. So this led to the third (and final!) rewrite of the netcode so it could work through Steam and so we could fully move away from the old web-based setup.
I glossed over a ton of stuff and reasons why, but the big one was that we wanted to be able to sell our product on Steam. There were other reasons too, but that was probably the core one. We wanted to leverage the tools, marketing, and ecosystem that Steam offers.
So what did these rewrites look like?
Initially, the architecture was pretty straightforward: client/frontend talking to server/backend. We were using Postgres to handle the data side of things, along with some clever cookie manipulation to keep track of game state depending on how temporary or permanent we wanted parts of the experience to be.
As we got more serious and saw more potential, we wanted stronger capabilities for our game. So I pitched the idea of, “Hey, we could sell this on Steam.” What would that require? A standalone client, of course. We could still use the website aspect as a demo or have a simpler version of the game up for marketing purposes. We both liked that idea, and I was a bit naive about how much work it would take to maintain a dual architecture like that. Phill doesn’t quite have the same experience with that aspect of netplay, whereas I had quite a bit more. He trusted me to make that decision.
Looking back, I should have realized that it was untenable and redirected us earlier. At the time, though, I thought it would be fine and that we could move forward with it. So I eventually got it working and built a pipeline to deploy on our website, while also wrapping our game in a Tauri client. The problem is that it was a ton of work, and for two people it would basically require one of us to work on the website side of the game while the other worked on the “actual game.” We just don’t have the manpower, time, or bandwidth to execute that. Once I realized what it would cost us and what we would lose, I wanted to make the full switch to Steam. This would reduce our netplay costs significantly, and we could support more online players.
I was really worried about scalability, server costs, hosting, and all the overhead that comes with managing that yourself. Moving our netcode to Steam removed a lot of those concerns. It was a giant pain to do, but I think the game is more resilient because of it.
At some point I will probably slightly decouple it since I really want to have a ranked play system, if we ever figure that out for our game.
Anyway, that rewrite is finally coming to an end three weeks later, and I couldn’t be happier about it. I think it was the right decision. There are still some remnants and bugs from the previous architecture, but I believe it was well worth the pain.
There’s a ton more I could write about this, so if you want me to talk about it more, please let me know and I’ll respond as best I can.
Thanks,
-Nate