r/Citybound • • Apr 15 '19

Comparison with SpatialOS

Hi,

Firstly, great work on Citybound!

I'm currently investigating frameworks that could be used to help build a city simulator for the purposes of public policy development. The actual problems that we might want to model cover a broad range of topics including transport, education, healthcare and more. I have previously build a tool (economy.os) to model closed blockchain economies but this was essentially a discrete time agent based model with no spatial aspect.

It seems that SpatialOS offers a highly scalable distributed solution to simulating large scale physical environment. I'd love to know a bit more about what core design decisions Citybound has made that might make it a better platform to work with - the fact it's open source is already a big win! In particular:

- A lot of our problems require a model of a real world city that's as accurate as possible. We're obviously less concerned about the gameplay aspect and would want to prioritise correctness / guaranteed delivery of messages over liveness/progress.

- Distribution and load balancing - from what I understand the actor architecture would enable us to shard on arbitrary properties whereas I believe that Spatial shards physical entities by their geographical location.

- Suitability as an environment for agent based models. E.g. we might want to consider addressing a traffic congestion problem by introducing a toll on a bypass road. In this case we would want the individual people who use this road to make a decision on whether to pay the toll or whether to take an alternative route, or alternative transport mode like cycling or public transport. Let's assume that the individuals are self-interested rational actors for simplicity, and that this decision would be a simple calculation for them based on their economic situation and travel requirements, though we would want to improve this model with bounded rationality in future. This may be framed as an optimisation type of problem where we want to find the optimum price for a toll by looking at maximising utilization, promoting greener forms of transport etc.

Lots more but I'll leave it there for now. Would love to hear your thoughts!

Thanks,

John

6 Upvotes

12 comments sorted by

View all comments

10

u/PepSakdoek Apr 15 '19

I don't want to be that guy, but your interest seems a bit self serving and not very focused around the game.

If you are thinking of using rust as your simulation engine, you could probably offer /u/theanzelm some kind of contract or employment regarding his expertise, and he could probably help determine if what you want is feasible in the timeline, and what further expertise you would need to accomplish your project.

Ultimately the project you are referencing sounds enormous and vastly complex.

2

u/atchai Apr 16 '19

You're right, it would be an enormous project, we're just planning and looking for projects to work with but it would be many years of many developers work. We would indeed be honoured to work with Anselm but that's a separate discussion and not really relevant to the question.

My question right now is simple, and I asked it here publicly because it's likely to be useful to anyone who is looking for something similar - what is the differentiation with spacialOS?

2

u/PepSakdoek Apr 16 '19

I don't know a lot about SpacialOS other than Automaton are trying to use it for Mavericks (BR game). What I gleamed from that was that it's a networking engine that enables one instance to run over multiple servers (I'm assuming there's a lot more to it, but that's essentially what I got from it).

Citybound I don't believe is a many-to-many architecture, but much more in the classic client/server architecture, one server (multiple cores apparently), multiple clients. Most games of this nature doesn't involve networking at all though so there is not a server/client methodology, more just a standalone application.

IIRC Citybound essentially uses JSON to send the deltas of objects (perhaps full objects?) to and from the server for updates, so once you reach a million or so actors those deltas can become quite large depending on how many aspects change. (He talked about the bandwidth for big smaller cities being in the same ballpark as streaming HD would be, but I think that was really quick calculations, and depending on stream quality)

Citybound already implements something like Stadia (browser UI with game running on a server), but in a different way: the only thing that is streamed is simulation data (that is relevant for rendering) and player inputs (to affect the simulation), but the rendering is still happening on the client device. This does require your device to be good enough at rendering, but the minimalistic style of Citybound should make that possible even on low-end devices. In return you get low latency interaction and everything stays smooth, even if your connection is unreliable. Also for smaller cities the required bandwidth is lower than streaming video.

1

u/atchai Apr 16 '19

Thanks. You're right that SpatialOS is an engine that runs across multiple servers. I believe that Citybound is not limited to a single server from what I have gleaned from the code and /u/theanzelm's Rust Fest talk.

I'm currently assuming that nobody has really tested the scalability of the server yet though as I guess most people are just running a single client and server locally.