by

Surprisingly Networking

(
Sep
25
)

Hi everyone, sorry for being very silent the last couple weeks. I secretly applied as a speaker for RustFest some time ago, since I thought it would be cool to show off some parts of the Citybound engine to fellow Rust developers. After not hearing from them for a long time and deciding that I was not accepted, it turned out that I was accepted: I just never received the confirmation email! This was at the beginning of the month.

Actually getting accepted made me very happy, of course, but it also made me worry, since when I originally suggested my topic "Type-safe & high-perf distributed actor systems with Rust", I wanted to not only talk about the potential of the engine to be distributed (which means that simulation of one city can be distributed onto several networked computers in realtime), I also wanted to show a proof-of-concept that this was actually possible.

Now, because of the way I architected the engine, this always looked fairly doable in general - but at this point, I only had one month left to actually deliver on my promise. I worked on it every day since then, and today, 5 days before my self-inflicted deadline, I am happy to report the first visible success:

What you see is two instances of Citybound, running on two Laptops connected via WiFi, displaying and simulating one single city, together in realtime synchrony.

Not all aspects of the game are prepared for true multiplayer yet, but the basic feat of distributing the simulation is done! And there is probably a couple of new bugs due to of assumptions that I made that are no longer true when you escape the boundaries of a single computer (mostly causality and happens-before issues that get weird if you add network delays).

What's even cooler is that the requirements of networking forced me to clean up some long-time ignored ugliness in the code base, including some performance improvements that singleplayer will also benefit from.

I will take the remaining days to really polish my demo, make my code more welcoming to newcomers, and prepare my talk. The talk itself will apparently be recorded, I will of course share it with you as soon as possible!

Unfortunately, I won't have time for a Patron's calling until then, so let's do the next Patron's calling after my talk: please vote for timeslots here.

After my talk, I will also fully focus on economy again. Multiplayer and networking is something that I can slowly work on on the side now.

Discussion on /r/Citybound
Support Citybound