This looks awesome! My question, coming from a self-identified "C/C++ person" who works in realtime control systems and who's been feeling increasingly uncomfortable with C++'s inherent footguns, is how has your choice of language helped or hindered this project?
I had a nice comparison because I first tried to do a native implementation in C++ and - wanting to do some custom low-level "stuff" for my simulation actor system (related to allocation and networking) - I ran into so many footguns that it slowed me tremendously. As soon as I tried to do the same with Rust, it was a breeze and I was able to write a lot of unsafe code that does very particular things that I need, while exposing a completely safe API for the rest of the engine and game. Being then able to also use Rust in the browser quite seamlessly with WASM allowed me to have a super straightforward and high-perf communication channel between the simulation backend and browser UI. The only real Rust disadvantage that hurts a lot is compile times. Sometimes I do fight types/the borrow checker, but only when I try to do weird things, in general I perceive it as a huge help in scaffolding things.
I see there is a bit in there about the city economy. Are you interested in expanding that to supporting a full monetary economy with employment, commuting and the like?
That certainly interests me - particularly how the pathologies of an economy like that emerge from individual actions - and I’ve been looking at Elixir to generate the necessary actor simulation engine. Looks to me like you have that here in Rust.
How could I get involved in helping to add a more detailed economy to this sim?
> ...and I’ve been looking at Elixir to generate the necessary actor simulation engine. Looks to me like you have that here in Rust.
I will caution that Elixir's runtime performance, particularly with simulation type code, is abysmal. Also, last time I was using Elixir, the available profiling infrastructure was really terrible; I had to buy a new workstation with 64GiB of RAM just to be able to fit the profiling artifacts from one iteration of our small model in memory, which was required in order for it to complete in less than infinite time.
There is already a monetary economy with employment, commuting and purchases. One of the things I hope to do soon is to factor out some of the variables of the economy simulation to make it easier to mod without having to understand the full codebase. Then would be a great time for you to experiment with it.
Do you have a writeup of the traffic simulation rules that you're using? I peeked in the code and saw the intelligent driver model is being used for acceleration. I suppose you also have a lane-changing model and such, too.
Your architecture could be very useful in teaching.
Your statement says that you have actor-based simulation model that's inspired by erlang - is there a reason why you picked rust instead of a BEAM language for developing the backend? My guess would be performance, maybe?
I didn't play it enough (yet) to feel comfortable putting it there, compared to the other things I listed as inspiration. I feel like it deserves a more in-depth comment/comparison. I've only watched let's plays of it so far.
Can you talk about the road building engine? Are you using splines to generate the smooth curves? This is a really amazing project, I can tell you have put a ton of work into it.
There's a lot of interesting stuff going on in there. First, for the curves itself, it does a kind of naive approximation optimisation and builds a curve out of line and arc segments that tries to follow the control points as closely as possible. Then it does an intersection step between all roads and procedurally generates correct connections between all incoming and outgoing lanes of each intersection, including (somewhat) reasonable traffic light timings for each "turn group"
Always thought it would be really cool to do a city based on no roads at all, but bike paths and public transport. Ever think this will get to the point where I can play around with that?
Thanks.
I assume you talk in terms of what constitutes an actor in the actor system: because cars on one strip of road interact highly locally, so processing them in one batch makes a lot of sense performance wise, vs. every car sending messages to every other car and having to maintain references to close-by cars.
Feel free to ask me any questions about the project!
I hope to learn to code. I just got my rejection letter from a coding school ("overwhelming demand -- we had to turn down many qualified candidates"). My backup plan is some free online coursework and probably finding a city-building game to mod or tinker with.
When you say open source, does that mean it would be okay for me to futz with it for myself like that?
I’m really hoping to get the project to a point soon where it is easily hack able even for people who are just starting out to code, or even for whom this will be the first contact to code. But I’m far from being there, right now it is a pretty large, pretty unusual and almost entirely undocumented codebase.
So by all means start teaching yourself to code by playful experimentation, but start with something much simpler first :)
Having a license that says you can go play with it doesn’t mean it will be straightforward as a newcomer to understand the code you find or to accomplish any particular goal with your fiddling.
I haven’t looked closely at this project, but I would recommend at least considering starting out fiddling with a simpler system, if you want to learn to code.
I'm not affiliated with the author, but that is generally part of the definition of open source. Once you've downloaded the code, check the top of any source code file for more details about the specific license the author is using.
Interesting that you take factorio as inspiration. May I know what part of factorio that you want to add into, that seems lacking in other games of same genre like sim city?
On the other hand, how do you plan for in-game scale / limit? (Millions of population, etc) and whether you have any idea about multiplayer/server (I'm talking similar with clustertorio)
The thing that impresses me with factorio is how smoothly the game challenges scale with you learning and mastering one game aspect after the other. Basically, you learn something that solves all your current problems, but that directly creates new problems, which you then have to deal with using your newfound powers.
The actor architecture makes it very easy to scale the simulation across several machines and indeed run a simulation cluster that you connect to from a simple client. In fact it already almost works like that. And the only thing that's missing for multiplayer is some UI-level coordination for collaborative planning (basically preventing editing conflicts). Everything else is already "multiplayer ready".
Please think hard about the design decisions of your game. I grew up with SimCity and later SimCity 2000. It informed many of my young opinions about government policy. But I later came to find out that SimCity wasn't nearly as objective as it looks. There are a lot of conservative politics baked into the design of the game that I'd argue were potentially damaging to the kids who played it back in the 90s.
This article from 1992's LA Times quotes Maxis president Jeff Braun saying how they're pushing a political agenda. Specifically pro-mass transit and anti-nuclear power.
What really opened my eyes, though, was this excellent article from LOGIC magazine about how Will Wright based the entire simulation on the work of Jay Wright Forrester. I don't know if it was a conscious choice to adopt Forrester's extremely conservative social policies, or if Will Wright just happened upon a bunch of ready-made algorithms he could use. But the result is the same. SimCity teaches us many fallacies about urban planning and finance that Republicans have historically used to justify certain policy choices.
My point is just to be very conscious of the biases you're encoding into the logic of your game. What may just be a game to you may be someone's first lessons in politics.
If you try really hard, you can find little pieces of evidence of any agenda in any material. It seems like Jeff Braun tried really really hard if he says SimCity is bad because it pushes the opponents agenda. The evidence quickly disappears once you step back and try to see the big picture. It's just a game. And mass transit actually makes sense.
I don't believe Jeff Braun was saying SimCity is bad. As he was the CEO of the company that made it at the time, that would be a very foolish move.
I think he was trying to deflect criticism directed towards the game. Keep in mind that the media was presenting SimCity not as just a game, but as a clever teaching tool for children to understand finance and local government. Okay, great. Whatever sells the game, right?
Then actual economists and city planners start to comment about how the game isn't realistic at all and fudges the numbers in such a way to incentivize certain play styles without showing the trade-offs that are involved in real life. At that point, Braun has to admit to the biases in the game, but he can't say anything so extreme to lose the free advertising his product is getting from schools and teachers and parenting magazines that are telling parents to buy the game for their children.
And although I'm a proponent of mass transit, it's not perfect. I believe SimCity only represents the upfront cost of mass transit and discounts the recurring maintenance costs, while road maintenance costs are inflated. But now were debating specific mechanics of a game other than the one this thread is about.
I mentioned Magnasanti in another part of the thread. In Magnasanti, there is only mass transit. No roads at all. I don't think I'd like living in a place like that where government-owned transportation decides where and when I can travel.
But that's exactly my point. There are two sides to every coin and I think it's important to represent the pros and cons of the choices the player is presented. There's no such thing as a purely positive or negative decision when it comes to city planning.
I appreciate the sentiment and always suspected as much about SimCity. My goal for Citybound is really a meta one: to be flexible enough to try out any number of government and planning styles and for the simulation to be tweakable enough to set up any real-life or imagined political context for a city.
That's good to hear. I think making it open source is already a step in the right direction. City planners who were critical of SimCity at the time often pointed to the game being a black box, so you couldn't examine, much less tweak, the assumptions built into the simulation.
If that is truly your goal, it is a noble one, but in that case baking the pathfinding into the roads seems like a bad design choice. People get lost driving in a convoluted city a lot even with GPS, but much less so in a regular blocked city.
According to your article (other comment) on Magnasanti, "There are no roads — all transit is mass transit."
That is hardly "a lot of conservative politics baked into the design of the game", nor would any such politics be "potentially damaging to the kids who played it".
If somebody gets a harmful lesson from the game, it is that you can have a viable modern city without any place to drive a truck.
I regret calling out any particular political ideology by name. It's true that not all of the biases baked into the game are conservative with the bias toward mass transit being a great example of liberal bias. I meant those as two separate thoughts, but I failed to properly express that.
Although I think many American cities could benefit from more mass transit choices, I agree that I certainly wouldn't want to live in a city where mass transit was the only option. It would mean a government-controlled entity would be dictating when and where I could travel. I don't like the sound of that.
This seems more like a failure in parenting, it was always made clear to me that games and television do not reflect reality and should not be emulated. At what age did you realize Simcity was just a game and that you should not treat it as an actual predication or model of reality?
" it was always made clear to me that games and television do not reflect reality"
And to me it was allways clear that this is just a legal disclaimer.
Of course games and videos reflect reality. Not 100% accurate, no, and some allmost 0% but btw. no scientific model does 100%, even though they are obviously more accurate and I would like more games to be based on scientific models.
But for example angry birds, very succesful, obviously fiction, but the core game mechanic is a physic simulation(Box2D) which works as realistic as a 2d computer can work in a game, so you can learn about kinetics with it.
While this is certainly clear for media like cartoons, action movies, Mortal Kombat, and Doom, SimCity was touted as an educational tool for children and an accurate model of reality throughout the early to mid 1990s. I was in elementary school at the time. Parenting magazines and journals as well as the broader media claimed as much. A friend of mine growing up who absolutely loved SimCity is a real life city planner now. I have fond memories of playing SimCity 2000 with my father.
If you really want to know when I realized that the real world doesn't work like SimCity, it was when I was in college and I started actually paying attention to the news and what was going on in the cities and towns I lived in.
Yes, it's especially important when these games are used to educate students. Recently came across this [0] very informative talk that discusses some of the same things.
On another note, I'm really excited to see that A Pattern Language was an inspiration for this sim. That seems like a great start!
I didn't mean to imply I thought mass transit was a conservative policy. I was trying to highlight another example of bias in the mechanics of the game. I failed to do so.
Maxis wasn't without its subversives, though. In SimCopter, Jacques Servin hid an easter-egg to display "bikin-clad, kissing men... to balance the 'bimbos' ordered by his 'aggressively heterosexual' boss"[0]
Any city building sim is gonna be inherently political, so much of city planning is the policies or agenda of one side or the other. What you appear to be arguing is that the republicans are always wrong and you want the dev to make a liberal-policy based game.
It's OSS so you can do that yourself if you think such a thing should exist.
A city building game will be political as it's at least partially simulating politics. However, I regret mentioning Republicans by name. I was trying to warn more broadly about adding the biases of the developers into a seemingly objective simulation. See this later comment I wrote:
You're welcome. I can't really recommend any specific books. I don't want my personal views on politics to be the focus, though. I'm just wary of biases hidden in supposedly unbiased algorithms.
If that topic interests you, I can recommend Weapons of Math Destruction by Cathy O'Neil, and Algorithms of Oppression by Safiya Noble.
I'm a programmer myself, so I understand if people are initially defensive about these topics. But it's important to me that I never write software that's harmful to people, so I try to check my biases as I create software to avoid these more insidious issues. It's easier to spot issues that may arise due to programming machinery that could crush a person, for example. Or software designed to estimate fuel usage for an airplane. It's much more difficult to spot inequity of minorities in software.
There's plenty of examples out there of biased AI in response to biased training sets.
If you're more interested in the dystopia that must be created in order to "win" SimCity, here's a couple of interesting articles. (I think they've been shared here before.) By taking the game to its absolute extremes, it becomes clearer what the simulation considers most important and valuable, thereby laying bare some of the biases inherent in the game's design.
Every opinion on complex reality makes assumptions that are not 100% certain to be correct. I assume you would have considered SimCity more objective if it didn't give low taxes the effect of increasing economic growth, but a centrist opinion is no more certain to be congruent with the truth than a left-wing or right-wing opinion, and is based on just as much speculation/conjecture as the other two.
I personally see the evidence overwhelmingly support the "right wing" view that low taxes and an absence of restrictions on contract freedom bolster economic growth, and I think that is what most analyses by economists conclude, which is why leftists have had such a problem with the Economics field for such a long time, and why Economics has had held out so long among the social sciences in becoming dominated by those who hold left-wing views (though that's been changing in recent decades).
The complexity and existing implementations of traffic AI in these kinds of games makes me wonder whether it's possible to get Google to make a generalizable Google maps engine for any 2D map, with a well-defined addressing system and multiple transit options with stops and routes.
- networked simultaneous agent navigation for real-time traffic reporting etc
- rerouting after mistakes
- comparing multiple transit options from flexible (walking/driving) to fixed-line (public transit, flights, waterways)
- handling updates to the routes, addresses, and the map in general
It would be especially cool if it could handle any kinds of transit determined by general traits (ground/air/water, speed, flex/fixed-stop, fuel type, passenger count) so you could even use it for a fantasy town with a dragon-drawn carriage and a catbus.
Unrelated, I find it depressingly amusing that the simulation was built with automotive traffic being the default and only way people can live their lives, and public transit and pedestrianism is a "TODO", much like many major cities in the world (esp. outside EU/east Asia). Once those are implemented, I'd love a fork of this project that straight up doesn't have cars. I would like to see the emergent effects (or failures) of a city that is forced to grow around pedestrians and trains.
Believe me, it is just as depressingly amusing for me, coming from Europe. Cars were simply the most important to have first, since they offer both short and long distance travel for simulated citizens. I very much want it to be possible to have pedestrian/transit only cities and everything in between.
Probably something far down on your potential TODO list, but in the Netherlands, one interesting factor is the canals. This allows e.g. many parts of a city centre to be mostly car-free, without preventing shops from getting restocked - which can happen via water.
Relatively niche, but could be a fun gameplay element. Of course, speaking of the Netherlands, bicycle transportation is enormously interesting already.
Honestly as a game developer I would use it even if it was closed source and full of tracking as long as it was performant and flexible and easy to use, things which google is good at.
Unless I was making a game focused on protecting the privacy of my virtual citizens...
I'm surprised that Cities: Skylines isn't listed as an inspiration because it's also based on individual agents moving around your city. Despite the name, Skylines is really a traffic management game more than anything else. Part of the fun of Skylines is just how cool your city looks. For all the emphasis on realism, I hope CityBound doesn't neglect appearances.
This looks really exciting! I just signed on as a Patron.
Appearances will be increasingly important to Citybound, I’m going for a flat shaded but super detailed look. Thanks for becoming a patron, much appreciated!
It's beautiful. Totally agree on the flat-shaded aesthetic. A nice stylized low-fi without giving into pixel-art.
I'm always suspicious about simulation-driven games because they can get lost in the wonkery of it in ways that don't actually provide gameplay to players - my understanding was that Master of Orion 3 was ruined by this kind of design. But it looks like your "simulation driven" thing is about the citizens, which is wonderful.
Your current vids are very rural. Are you planning on getting into transit and bike-lanes and the like, or is this primarily going to be about roadways?
> Despite the name, Skylines is really a traffic management game more than anything else
The developer, Colossal Order, is also responsible for "Cities In Motion" and "Cities in Motion 2", both of which task the player with improving public transit systems. I haven't played either of those, but having played Skylines, I can only assume that the developer's prior games heavily influenced the game mechanics of this one.
There's an insane amount of mods available for Skylines too, and the ones that expand the traffic management mechanics are very enjoyable.
I mean, after spending more than a thousand hours fixing traffic problems, I even briefly thought about changing my career to become a transport planner. If some other mod/game gives me even more precision and options, I'd probably be spending all my free time in it.
Skylines is a mediocre city simulation game but a great traffic management/simulation game.
> Despite the name, Skylines is really a traffic management game more than anything else. Part of the fun of Skylines is just how cool your city looks.
Unfortunately, traffic management is the only part of the game that really holds up as a simulator.
Public services and pollution, in particular, are basically skeletons without any real depth to them, and they have considerably less depth than SC4. Cities: Skylines is mostly good as a) a traffic and transit simulator, and b) a sandbox game for using mods to create beautiful urban artwork. If you go to /r/CitiesSkylines or look at a number of YouTubers (I strongly recommend Infrastructurist), you'll see lots of gorgeous cities that were created by using mods like RICO, Move It!, and various forms of Anarchy (among several others) to plop down assets in ways that resemble real cities. An infinite money mod is, of course, a given. There's no real simulation going on here: you have a bunch of very talented, creative individuals using the game as a specialized canvas.
But let's talk a bit about just how public services and pollution are skeletons.
Public services are very simple: citizens want a service, and you plop down buildings that provide that service. What little depth they have comes from the traffic management sim: the service needs to be accessible, so either citizens need to be able to get to the buildings in a timely fashion, or the buildings need to be able to send their vehicles out to various parts of town in a timely fashion. If traffic flow gets bad enough that this fails to happen, citizens get upset. All you need to have effective public services is enough capacity + traffic flow for your citizens to make use of them.
There is no concept of range. If you put a school down in a city, children from all over the city will go there to get educated. If you have multiple schools, there is no correlation between where your kids live and where they go to school. Of course, there are mods that can help a little: you can easily find a mod that limits use of public services to the district they're planted in. But that's it.
Compare SimCity 4, on the other hand, where every building has a range, and each service has two funding sliders: one that controls effectiveness, and one that controls range (and you can override these sliders on a per-building basis, too). With range, you have to be careful to not let your buildings overlap too much, because then you're throwing away money. And you can overfund your services, but that's a hard choice: overfunding has diminishing returns and, more interestingly, can cause negative externalities. For example, overfunding your police can create a situation where police officers harass the community and thus make your citizens unhappy. No such complexity exists in Cities: Skylines. Nothing has externalities in Cities: Skylines. There's no disadvantage to throwing in more of everything. Well, except for water. I'll get to that later. And if you underfund your services in SC4, you have a chance to wind up with an actual, honest-to-goodness strike on your hands. And money often gets tight enough that you will periodically have to underfund something just to stay in the black, so you have to choose which service you can most afford a strike at. No strikes are in Cities: Skylines.
Education, too, is way too easy. In SimCity 4, developing an educated workforce that can support high-tech industry takes several generations of cultivating your citizenry. No such problem in Cities: Skylines, just throw down enough elementary schools, high schools, and universities, and you've got an educated workforce in no time! And you really want your workforce to be educated, too, because having an uneducated population means you're stuck with dirty industry, which sucks. The pollution is awful, and the jobs don't pay well, so your sims stay poor and live in slums.
Oh yeah, and there's basically no class stratification in Cities: Skylines. SC4 divides properties into low-wealth, medium-wealth, and high-wealth, which is determined by property values, with visually-distinct buildings at each position. This is a completely separate axis from building level, which mostly has to do with the size of your buildings, bounded by the density of your zoning (low density is levels 1-3, medium is 4-6, high is 7+). So slums look like slums, nice parts of town look nice, etc. Cities: Skylines just has building level. So in CS, your buildings will become bigger and nicer as you grow, but there's no such thing as "a poor neighborhood", "a middle-class neighborhood", or "a rich neighborhood", unlike in SC4.
Before I get to pollution, let's talk garbage. There are a number of garbage facilities in Cities: Skylines, including a recycling center introduced with the Green Cities expansion. The recycling center is just a strictly-better landfill. It does everything a landfill does, only more so. There is no reason to build landfills if you own Green Cities. In SimCity 4, on the other hand, they serve different purposes. In SC4, landfill zoning provides a place for your sims' trash to go, and a recycling center reduces the amount of trash your sims produce in the first place. Thus, you can't deal with garbage on just recycling centers alone. You still need landfills, but a recycling center will let you get away with zoning less landfill than you'd normally need. So you really want both recycling centers and landfills, just like in real life. But Colossal Order wanted people to buy Green Cities, so they made everything in that expansion completely overpowered and strictly better than what's in vanilla.
Pollution is easily-avoidable in Cities: Skylines to the point where it might as well not exist unless you screw up dramatically. Air pollution isn't even a thing at all. You can have all the dirty, smoggy factories you want, and your citizens won't care. Let's just say that, in SimCity 4, air pollution is a huge thing, and you'll be spending a good chunk of your game trying to mitigate it. What you do have in Cities: Skylines, though, is ground pollution. Dirty buildings pollute the ground, and if people live on polluted ground, they get sick and die. But ground pollution has a teeny-tiny radius, so it might as well not exist. Just don't build right next door to dirty industry or coal plants, and certainly don't bulldoze your dirty industry and coal plants and build residential where they used to be, and you're fine. I wish pollution was that simple in real life.
Water pollution is even more avoidable. You only have water pollution at all if you have a water pump downstream from a sewage outlet. This is trivially avoidable. It's one of the first things the tutorial hammers into you. Unless you're going out of your way to screw up, you won't have water pollution. But what if you do screw up? Well, if even the slightest bit of sewage gets in your water supply, your whole city undergoes a massive die-off. That's right, if you ever have nonzero water pollution, you might as well start a new city. Is there a way to mitigate it? Sure, build a water treatment plant! But the water treatment plant just lowers your water pollution, it doesn't take it all the way down to zero. And any nonzero amount of water pollution will kill your city, so you might as well just save your money. Oh, and this is literally the only thing a water treatment plant does, so unless you've screwed the pooch and killed your city, you will never have any reason to build one.
This image shows the range that the medical facilities have in the city. The purple buildings are hospitals/clinics, and the green shading on the roads indicates the reach that those buildings have. Not sure where you got the above fact, unless I am misunderstanding something.
City Skylines does have one form of pollution you didn't mention: Noise pollution. People next to busy streets get sick and die from the noise.
Water pollution generally only happens when a player starts sucking out too much water from a river and reverses its flow.
I do agree that the mass dieoffs from a single drop of polluted water are probably too much. A significant production drop as people are under a boil water advisory at first might be better, and only becoming a major die off if you neglect to fix the problem. The water treatment plant could be more interesting if people were always dying at a low/modest rate from even "clean" river water until you built it.
Education in C:SL is actually more realistic then sc4. In sc4 the difference between different levels of schools is just that they boost the education level of sims of different ages. So a elementary school increases the education level of 20 and 30 year olds, but not sims in their 60s [1]. While in c:sl people need to actually go through the schooling system, and you can see the education level of each of them...
Also, is air pollution a huge problem in sc4? My experience is that you just put dirty industry in a faraway place, like you would do in c:sl. You can say that the air pollution generated by traffic in sc4 is simulated in c:sl as noise as well.
To be fair, Cities Skylines is very much a sandbox game. Outside of maybe 2 or 3 scenarios, nothing in it is very hard, or meant to challenge you a whole lot.
I don't build Water Treatment plants because I'm worried about losing, I build them because I don't like looking at the gunk in the water.
Same with a landfill vs recycling center. I build a dump when I feel that it suits the city (young city, or new rural area) Later as that place builds up I will relocate the dump outside of city limits, plop a recycling center in the dense part of town, and build an incinerator somewhere else.
I saw there are PRs open from 2 years ago, like "added truck". Why hasn't it been merged, there are no comments, only thumbs up, and what's your general take on PRs? Are they welcome or not?
It’s kind of tricky with a project that’s still that much in flux, I’m still prioritizing features over stability. That being said, I actually plan to merge that particular PR soon. I’ve accepted many superficial PRs that did things like update dependencies or make the project compatible with newer Rust nightlies.
Please consider not autoplaying videos on the main website http://cityboundsim.com/. Esp. when the video is below the fold!
It sucks up bandwidth if you're on mobile, and is generally not user-friendly. Why not have a play button for it when the user decides to watch instead?
Citybound v0.1.2-762-g7852f0a
This is the simulation server.
To connect and start playing, please open
this address in Chrome/Firefox/Safari:
╭───────────────────────────────────────────╮
│ http://localhost:1234 │
╰───────────────────────────────────────────╯
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 98, kind: AddrInUse, message: "Address already in use" }', src/libcore/result.rs:1009:5
Change the hostname to be more explicit: 127.0.0.1 or 0.0.0.0 I've ran into issues where a host name is not resolved on one OS but it is resolved in other OS'.
Also, check out the main homepage at https://aeplay.org/citybound for a more player-centric intro
https://www.reddit.com/r/rust/comments/78bowa/hey_this_is_ky...
https://www.rust-lang.org/static/pdfs/Rust-Chucklefish-White...
That certainly interests me - particularly how the pathologies of an economy like that emerge from individual actions - and I’ve been looking at Elixir to generate the necessary actor simulation engine. Looks to me like you have that here in Rust.
How could I get involved in helping to add a more detailed economy to this sim?
I will caution that Elixir's runtime performance, particularly with simulation type code, is abysmal. Also, last time I was using Elixir, the available profiling infrastructure was really terrible; I had to buy a new workstation with 64GiB of RAM just to be able to fit the profiling artifacts from one iteration of our small model in memory, which was required in order for it to complete in less than infinite time.
https://www.youtube.com/watch?v=LiIoE8ArACs
It was great, if so!
Your architecture could be very useful in teaching.
What exactly would you like to see in a writeup? And which teaching setting do you have in mind?
Your statement says that you have actor-based simulation model that's inspired by erlang - is there a reason why you picked rust instead of a BEAM language for developing the backend? My guess would be performance, maybe?
Deleted Comment
The fire department will have an opinion on this.
So many things will be difficult: construction, trash hauling, tree removal, relocation, business deliveries, etc.
I hope to learn to code. I just got my rejection letter from a coding school ("overwhelming demand -- we had to turn down many qualified candidates"). My backup plan is some free online coursework and probably finding a city-building game to mod or tinker with.
When you say open source, does that mean it would be okay for me to futz with it for myself like that?
Thanks.
So by all means start teaching yourself to code by playful experimentation, but start with something much simpler first :)
Having a license that says you can go play with it doesn’t mean it will be straightforward as a newcomer to understand the code you find or to accomplish any particular goal with your fiddling.
I haven’t looked closely at this project, but I would recommend at least considering starting out fiddling with a simpler system, if you want to learn to code.
On the other hand, how do you plan for in-game scale / limit? (Millions of population, etc) and whether you have any idea about multiplayer/server (I'm talking similar with clustertorio)
The actor architecture makes it very easy to scale the simulation across several machines and indeed run a simulation cluster that you connect to from a simple client. In fact it already almost works like that. And the only thing that's missing for multiplayer is some UI-level coordination for collaborative planning (basically preventing editing conflicts). Everything else is already "multiplayer ready".
Deleted Comment
Cool containers.
Dead Comment
This article from 1992's LA Times quotes Maxis president Jeff Braun saying how they're pushing a political agenda. Specifically pro-mass transit and anti-nuclear power.
https://www.latimes.com/archives/la-xpm-1992-10-02-vw-391-st...
What really opened my eyes, though, was this excellent article from LOGIC magazine about how Will Wright based the entire simulation on the work of Jay Wright Forrester. I don't know if it was a conscious choice to adopt Forrester's extremely conservative social policies, or if Will Wright just happened upon a bunch of ready-made algorithms he could use. But the result is the same. SimCity teaches us many fallacies about urban planning and finance that Republicans have historically used to justify certain policy choices.
https://logicmag.io/06-model-metropolis/
My point is just to be very conscious of the biases you're encoding into the logic of your game. What may just be a game to you may be someone's first lessons in politics.
I think he was trying to deflect criticism directed towards the game. Keep in mind that the media was presenting SimCity not as just a game, but as a clever teaching tool for children to understand finance and local government. Okay, great. Whatever sells the game, right?
Then actual economists and city planners start to comment about how the game isn't realistic at all and fudges the numbers in such a way to incentivize certain play styles without showing the trade-offs that are involved in real life. At that point, Braun has to admit to the biases in the game, but he can't say anything so extreme to lose the free advertising his product is getting from schools and teachers and parenting magazines that are telling parents to buy the game for their children.
And although I'm a proponent of mass transit, it's not perfect. I believe SimCity only represents the upfront cost of mass transit and discounts the recurring maintenance costs, while road maintenance costs are inflated. But now were debating specific mechanics of a game other than the one this thread is about.
I mentioned Magnasanti in another part of the thread. In Magnasanti, there is only mass transit. No roads at all. I don't think I'd like living in a place like that where government-owned transportation decides where and when I can travel.
But that's exactly my point. There are two sides to every coin and I think it's important to represent the pros and cons of the choices the player is presented. There's no such thing as a purely positive or negative decision when it comes to city planning.
That is hardly "a lot of conservative politics baked into the design of the game", nor would any such politics be "potentially damaging to the kids who played it".
If somebody gets a harmful lesson from the game, it is that you can have a viable modern city without any place to drive a truck.
Although I think many American cities could benefit from more mass transit choices, I agree that I certainly wouldn't want to live in a city where mass transit was the only option. It would mean a government-controlled entity would be dictating when and where I could travel. I don't like the sound of that.
And to me it was allways clear that this is just a legal disclaimer.
Of course games and videos reflect reality. Not 100% accurate, no, and some allmost 0% but btw. no scientific model does 100%, even though they are obviously more accurate and I would like more games to be based on scientific models.
But for example angry birds, very succesful, obviously fiction, but the core game mechanic is a physic simulation(Box2D) which works as realistic as a 2d computer can work in a game, so you can learn about kinetics with it.
If you really want to know when I realized that the real world doesn't work like SimCity, it was when I was in college and I started actually paying attention to the news and what was going on in the cities and towns I lived in.
On another note, I'm really excited to see that A Pattern Language was an inspiration for this sim. That seems like a great start!
[0] http://molleindustria.org/GamesForCities/
[0] https://www.nydailynews.com/pixel-gaiety-costs-job-article-1...
It's OSS so you can do that yourself if you think such a thing should exist.
https://news.ycombinator.com/item?id=19588287
Deleted Comment
If that topic interests you, I can recommend Weapons of Math Destruction by Cathy O'Neil, and Algorithms of Oppression by Safiya Noble.
I'm a programmer myself, so I understand if people are initially defensive about these topics. But it's important to me that I never write software that's harmful to people, so I try to check my biases as I create software to avoid these more insidious issues. It's easier to spot issues that may arise due to programming machinery that could crush a person, for example. Or software designed to estimate fuel usage for an airplane. It's much more difficult to spot inequity of minorities in software.
There's plenty of examples out there of biased AI in response to biased training sets.
If you're more interested in the dystopia that must be created in order to "win" SimCity, here's a couple of interesting articles. (I think they've been shared here before.) By taking the game to its absolute extremes, it becomes clearer what the simulation considers most important and valuable, thereby laying bare some of the biases inherent in the game's design.
https://rumorsontheinternets.org/2010/10/14/magnasanti-the-l...
https://www.vice.com/en_us/article/4w4kg3/the-totalitarian-b...
I personally see the evidence overwhelmingly support the "right wing" view that low taxes and an absence of restrictions on contract freedom bolster economic growth, and I think that is what most analyses by economists conclude, which is why leftists have had such a problem with the Economics field for such a long time, and why Economics has had held out so long among the social sciences in becoming dominated by those who hold left-wing views (though that's been changing in recent decades).
- networked simultaneous agent navigation for real-time traffic reporting etc
- rerouting after mistakes
- comparing multiple transit options from flexible (walking/driving) to fixed-line (public transit, flights, waterways)
- handling updates to the routes, addresses, and the map in general
It would be especially cool if it could handle any kinds of transit determined by general traits (ground/air/water, speed, flex/fixed-stop, fuel type, passenger count) so you could even use it for a fantasy town with a dragon-drawn carriage and a catbus.
Unrelated, I find it depressingly amusing that the simulation was built with automotive traffic being the default and only way people can live their lives, and public transit and pedestrianism is a "TODO", much like many major cities in the world (esp. outside EU/east Asia). Once those are implemented, I'd love a fork of this project that straight up doesn't have cars. I would like to see the emergent effects (or failures) of a city that is forced to grow around pedestrians and trains.
Relatively niche, but could be a fun gameplay element. Of course, speaking of the Netherlands, bicycle transportation is enormously interesting already.
It would be cool for Google to do that, if they open sourced it and didn't put any tracking software in...
Unless I was making a game focused on protecting the privacy of my virtual citizens...
I'm surprised that Cities: Skylines isn't listed as an inspiration because it's also based on individual agents moving around your city. Despite the name, Skylines is really a traffic management game more than anything else. Part of the fun of Skylines is just how cool your city looks. For all the emphasis on realism, I hope CityBound doesn't neglect appearances.
This looks really exciting! I just signed on as a Patron.
https://aeplay.org/citybound
It's beautiful. Totally agree on the flat-shaded aesthetic. A nice stylized low-fi without giving into pixel-art.
I'm always suspicious about simulation-driven games because they can get lost in the wonkery of it in ways that don't actually provide gameplay to players - my understanding was that Master of Orion 3 was ruined by this kind of design. But it looks like your "simulation driven" thing is about the citizens, which is wonderful.
Your current vids are very rural. Are you planning on getting into transit and bike-lanes and the like, or is this primarily going to be about roadways?
The developer, Colossal Order, is also responsible for "Cities In Motion" and "Cities in Motion 2", both of which task the player with improving public transit systems. I haven't played either of those, but having played Skylines, I can only assume that the developer's prior games heavily influenced the game mechanics of this one.
There's an insane amount of mods available for Skylines too, and the ones that expand the traffic management mechanics are very enjoyable.
I mean, after spending more than a thousand hours fixing traffic problems, I even briefly thought about changing my career to become a transport planner. If some other mod/game gives me even more precision and options, I'd probably be spending all my free time in it.
Skylines is a mediocre city simulation game but a great traffic management/simulation game.
They reduce the tactile feel, depth perception, and ability to judge scale.
Low-poly, flat aesthetics are more interesting to play.
Unfortunately, traffic management is the only part of the game that really holds up as a simulator.
Public services and pollution, in particular, are basically skeletons without any real depth to them, and they have considerably less depth than SC4. Cities: Skylines is mostly good as a) a traffic and transit simulator, and b) a sandbox game for using mods to create beautiful urban artwork. If you go to /r/CitiesSkylines or look at a number of YouTubers (I strongly recommend Infrastructurist), you'll see lots of gorgeous cities that were created by using mods like RICO, Move It!, and various forms of Anarchy (among several others) to plop down assets in ways that resemble real cities. An infinite money mod is, of course, a given. There's no real simulation going on here: you have a bunch of very talented, creative individuals using the game as a specialized canvas.
But let's talk a bit about just how public services and pollution are skeletons.
Public services are very simple: citizens want a service, and you plop down buildings that provide that service. What little depth they have comes from the traffic management sim: the service needs to be accessible, so either citizens need to be able to get to the buildings in a timely fashion, or the buildings need to be able to send their vehicles out to various parts of town in a timely fashion. If traffic flow gets bad enough that this fails to happen, citizens get upset. All you need to have effective public services is enough capacity + traffic flow for your citizens to make use of them.
There is no concept of range. If you put a school down in a city, children from all over the city will go there to get educated. If you have multiple schools, there is no correlation between where your kids live and where they go to school. Of course, there are mods that can help a little: you can easily find a mod that limits use of public services to the district they're planted in. But that's it.
Compare SimCity 4, on the other hand, where every building has a range, and each service has two funding sliders: one that controls effectiveness, and one that controls range (and you can override these sliders on a per-building basis, too). With range, you have to be careful to not let your buildings overlap too much, because then you're throwing away money. And you can overfund your services, but that's a hard choice: overfunding has diminishing returns and, more interestingly, can cause negative externalities. For example, overfunding your police can create a situation where police officers harass the community and thus make your citizens unhappy. No such complexity exists in Cities: Skylines. Nothing has externalities in Cities: Skylines. There's no disadvantage to throwing in more of everything. Well, except for water. I'll get to that later. And if you underfund your services in SC4, you have a chance to wind up with an actual, honest-to-goodness strike on your hands. And money often gets tight enough that you will periodically have to underfund something just to stay in the black, so you have to choose which service you can most afford a strike at. No strikes are in Cities: Skylines.
Education, too, is way too easy. In SimCity 4, developing an educated workforce that can support high-tech industry takes several generations of cultivating your citizenry. No such problem in Cities: Skylines, just throw down enough elementary schools, high schools, and universities, and you've got an educated workforce in no time! And you really want your workforce to be educated, too, because having an uneducated population means you're stuck with dirty industry, which sucks. The pollution is awful, and the jobs don't pay well, so your sims stay poor and live in slums.
Oh yeah, and there's basically no class stratification in Cities: Skylines. SC4 divides properties into low-wealth, medium-wealth, and high-wealth, which is determined by property values, with visually-distinct buildings at each position. This is a completely separate axis from building level, which mostly has to do with the size of your buildings, bounded by the density of your zoning (low density is levels 1-3, medium is 4-6, high is 7+). So slums look like slums, nice parts of town look nice, etc. Cities: Skylines just has building level. So in CS, your buildings will become bigger and nicer as you grow, but there's no such thing as "a poor neighborhood", "a middle-class neighborhood", or "a rich neighborhood", unlike in SC4.
Before I get to pollution, let's talk garbage. There are a number of garbage facilities in Cities: Skylines, including a recycling center introduced with the Green Cities expansion. The recycling center is just a strictly-better landfill. It does everything a landfill does, only more so. There is no reason to build landfills if you own Green Cities. In SimCity 4, on the other hand, they serve different purposes. In SC4, landfill zoning provides a place for your sims' trash to go, and a recycling center reduces the amount of trash your sims produce in the first place. Thus, you can't deal with garbage on just recycling centers alone. You still need landfills, but a recycling center will let you get away with zoning less landfill than you'd normally need. So you really want both recycling centers and landfills, just like in real life. But Colossal Order wanted people to buy Green Cities, so they made everything in that expansion completely overpowered and strictly better than what's in vanilla.
Pollution is easily-avoidable in Cities: Skylines to the point where it might as well not exist unless you screw up dramatically. Air pollution isn't even a thing at all. You can have all the dirty, smoggy factories you want, and your citizens won't care. Let's just say that, in SimCity 4, air pollution is a huge thing, and you'll be spending a good chunk of your game trying to mitigate it. What you do have in Cities: Skylines, though, is ground pollution. Dirty buildings pollute the ground, and if people live on polluted ground, they get sick and die. But ground pollution has a teeny-tiny radius, so it might as well not exist. Just don't build right next door to dirty industry or coal plants, and certainly don't bulldoze your dirty industry and coal plants and build residential where they used to be, and you're fine. I wish pollution was that simple in real life.
Water pollution is even more avoidable. You only have water pollution at all if you have a water pump downstream from a sewage outlet. This is trivially avoidable. It's one of the first things the tutorial hammers into you. Unless you're going out of your way to screw up, you won't have water pollution. But what if you do screw up? Well, if even the slightest bit of sewage gets in your water supply, your whole city undergoes a massive die-off. That's right, if you ever have nonzero water pollution, you might as well start a new city. Is there a way to mitigate it? Sure, build a water treatment plant! But the water treatment plant just lowers your water pollution, it doesn't take it all the way down to zero. And any nonzero amount of water pollution will kill your city, so you might as well just save your money. Oh, and this is literally the only thing a water treatment plant does, so unless you've screwed the pooch and killed your city, you will never have any reason to build one.
AFAIR, public services in Skylines do indeed have range. It is indicated by green shading on the city roads. For example:
https://www.gameplayinside.com/wp-content/uploads/2015/03/ci...
This image shows the range that the medical facilities have in the city. The purple buildings are hospitals/clinics, and the green shading on the roads indicates the reach that those buildings have. Not sure where you got the above fact, unless I am misunderstanding something.
Water pollution generally only happens when a player starts sucking out too much water from a river and reverses its flow.
I do agree that the mass dieoffs from a single drop of polluted water are probably too much. A significant production drop as people are under a boil water advisory at first might be better, and only becoming a major die off if you neglect to fix the problem. The water treatment plant could be more interesting if people were always dying at a low/modest rate from even "clean" river water until you built it.
Also, is air pollution a huge problem in sc4? My experience is that you just put dirty industry in a faraway place, like you would do in c:sl. You can say that the air pollution generated by traffic in sc4 is simulated in c:sl as noise as well.
[1] https://www.wiki.sc4devotion.com/index.php?title=Elementary_...
I don't build Water Treatment plants because I'm worried about losing, I build them because I don't like looking at the gunk in the water.
Same with a landfill vs recycling center. I build a dump when I feel that it suits the city (young city, or new rural area) Later as that place builds up I will relocate the dump outside of city limits, plop a recycling center in the dense part of town, and build an incinerator somewhere else.
Change:
To:Setting "letter-spacing: -0.02em !important" fixes it (which is what the strong tags have, hence them not being affected).
Deleted Comment
It sucks up bandwidth if you're on mobile, and is generally not user-friendly. Why not have a play button for it when the user decides to watch instead?