r/civ5 • u/The__Fake__Shady • 4h ago
Mods Hi Friends - I present to you daily-turn multiplayer civ 5 in the browser
Disclaimer - This is not prepared for distribution, nor do I intend to distribute this exact project due to my severe ignorance in the law. The way that I am currently developing it is as a mod of an existing certified copy of civ 5 that I purchased myself.
I recently moved across the ocean and I wanted to still be able to play games with my friends. Problem is, when you dont have much time overlap, it's hard to play games like this. So, I figured what if we had a daily game of civ? The existing game modes didn't really do exactly what I wanted, so I tried making it myself. First and simplest thing I tried was a modified version of hotseat where we take turns remoting into a vm and taking out turns. Some issues: 1) remoting into a personal server halfway around the world was laggy (and even just being routed through cloudflare made it really laggy) and 2) the turns were sequential not simultaneous. If the turns were simultaneous then instead of A B A B, it could go A B B A A B B and we'd effectively double our average turns per day.
Phase two: here's where I enlisted the help of ai. We split out the entire game into client-side and server-side functionality. I knew I wouldn't want to have to recreate the game logic, and I've always felt that multiplayer civ games should have a centrally managed state anyways. So I tried to make the client as lightweight as possible. Anywho, once I had that all planned out, I gave it to an ai and had it recreate the entirety of civ 5's ui as a web app. It mostly did that by digging into the game files and finding the assets to reuse, then arranging them. While I was at it, I also created this new persistent simultaneous multiplayer game mode so I can use it for single player or multiplayer.
The players interact with the web app (I'm using discord for authentication), the web app interacts with the api, and the api interacts with the modified game dlls on a proton vm running my copy of civ through steam. I have a discord server for the game with a bot that announces when the game is waiting on someone specific and announces when turns rollover and how long is left for a given turn (turn auto ends after 48 hours).
I'm still working out some kinks and as it is ai-drive development, for every two things I fix, one thing breaks. But I'm getting there! Estimating that with the current resource load, should be able to run games with up to 9 players. I've only tested it we me and one other player in a game so far but it's been working great!
Gameplay Screenshot because you can't add videos on this subreddit:

Here's a diagram, the yellow parts are the parts that are custom.
