How Traffic Works in Cities: Skylines | AI and Games #54

Поделиться
HTML-код
  • Опубликовано: 21 сен 2024

Комментарии • 325

  • @AIandGames
    @AIandGames  4 года назад +361

    It has since come to my attention - *after releasing the video* - some additional facts:
    - The game simulates up to one million citizens at once.
    - There are up to 65,000 moving objects in the traffic system at once.
    Sadly I missed this during my initial research. This all came up in a Twitch live stream.
    www.twitch.tv/videos/26539981
    Grrrr.
    Sorry folks, I like to catch all this stuff in advance. Can't win them all though.

    • @RexGalilae
      @RexGalilae 4 года назад +4

      Wonder how they optimize for Memory usage

    • @aikatheshibainu3994
      @aikatheshibainu3994 4 года назад +1

      @@RexGalilae something like ECS?

    • @sanketvaria9734
      @sanketvaria9734 4 года назад +2

      make a video on how traffic like vehicles work in open world games like GTA 5.

    • @ITBEurgava
      @ITBEurgava 4 года назад +8

      Any further info about how the citizens pathfind to their parking spots? I noticed that sometimes vehicles bruteforce their way through buildings or off-roads to get there. Funny, but it breaks the immersion.

    • @seraphina985
      @seraphina985 4 года назад +2

      Interesting that the game tracks relationships between citizens that does make me wonder whether this information is exposed to mods. Could be an interesting opportunity to mod the citizen simulation as if I am not mistaken by default sims only go to residential zones when returning to their own home. Could add an interesting element of realism if sims looking for a leisure destination considered related sims homes as an option, real people have dinner guests and movie nights etc after all. No idea if this is something that is actually possible or not but just was an idea that came to mind when you mentioned that the citizen simulation tracks relationships so the information is potentially there assuming there isn't some hard barrier that prevents sims visiting other residential buildings rather than this being possible but not implemented by default. Granted this may be more computationally taxing but then this is probably a luxury mods can afford as mods tend to attract players that spend an above-average amount of their time on gaming that they can afford to sift through the workshop looking for new mods, I suspect most have above-average hardware also as people willing to spend a lot of their free time on a hobby tend to be equally willing to spend a good chunk of their disposable income on the same.

  • @MikeMiller-cq7tu
    @MikeMiller-cq7tu 4 года назад +763

    If only CS was real life,
    "I won't be coming in to work today"
    "Why the hell not?"
    "The simulation cap on citizens traveling has been reached, so I have to stay home"
    "Ohhhh"

    • @Mexalen81
      @Mexalen81 4 года назад +30

      This might be the answer why I am working from Home since March...😉

    • @ItsDesm
      @ItsDesm 4 года назад +7

      There's something almost close to this in some places, where they prevent certain cars from driving on certains days for either traffic or pollutions concerns. However I assume people's jobs would still expect them to find a way to get to work even if they can't drive their car that day.

    • @DomiAngel
      @DomiAngel 4 года назад +2

      @@ItsDesm Indeed people are expected to go to work like any other day.

    • @anteshell
      @anteshell 4 года назад +6

      @@Mexalen81 There's also been this sudden death wave because not enough hospitals. Wonder if those two has any connections...

    • @GabbieTheFox
      @GabbieTheFox 4 года назад +1

      @@anteshell If Virus > Healthcare then reduceHealth.Daily(1) else DoNothing
      (I know it's probably not even close to being formatted correctly or something.)

  • @clau-se
    @clau-se 4 года назад +577

    I am one of contributors to the Traffic Manager mod, and one of future challenges we want to take (and i want to have my take on it too), is to replace the default Dijkstra implementation and re-implementation in TM:PE with a more smart and lane-aware A⭐. I am just slowly realizing the depth of this worm hole, even before i started trying 😁😅

    • @falcovg2
      @falcovg2 4 года назад +58

      Thank you for your service!

    • @luca_fiorini
      @luca_fiorini 4 года назад +42

      Ooh sounds intresting.... Good luck! The community is infinitely grateful for TM:PE, Tnx for your service sir. o7

    • @DanRichardson
      @DanRichardson 4 года назад +31

      That mod is awesome, thanks for contributing towards it

    • @RandyFortier
      @RandyFortier 4 года назад +15

      TM is definitely one of the best mods available for this game, if not the best.

    • @anteshell
      @anteshell 4 года назад +22

      @@RandyFortier Maybe the best is not a correct term but it is by far the single most mandatory and useful mod ever made for CS. Be it vanilla or heavily modded mars conversion, TM:PE is a must have to whip those idiots on the right lanes and having them moving.

  • @deeznoots6241
    @deeznoots6241 4 года назад +228

    The limit on vehicles to 60k at a time means after a certain point your city becomes so large that traffic starts becoming less and less of an issue. You can literally just outbuild traffic,

    • @tonyzed6831
      @tonyzed6831 4 года назад +1

      Also means that CSL is a crappy citybuilder.

    • @unimaginablefaliure799
      @unimaginablefaliure799 4 года назад +104

      TonyZed68 Nope, it’s for the sake of your processor.

    • @reddragon3132
      @reddragon3132 4 года назад +57

      @@tonyzed6831 I wouldn't be surprised if there's a mod to remove the limit. Good luck running it though

    • @unimaginablefaliure799
      @unimaginablefaliure799 4 года назад +11

      RedDragon There is one for props as well :p

    • @Sp3ctre18Gaming
      @Sp3ctre18Gaming 4 года назад +9

      Except that means emergency and service vehicles also stop spawning, so you're gonna have a bad time unless you use mods to disable most of the *game* aspects for your city to keep running.

  • @BiffaPlaysCitiesSkylines
    @BiffaPlaysCitiesSkylines 4 года назад +507

    Interesting video 👍😁

    • @jamesc4999
      @jamesc4999 4 года назад +33

      I was wondering if I would see you here

    • @kirmy1
      @kirmy1 4 года назад +12

      Expected to see your name, was not disappointed!

    • @LuckyWitjaksono
      @LuckyWitjaksono 4 года назад +9

      Did you spot the zoned roundabouts?

    • @fajaradi1223
      @fajaradi1223 4 года назад +8

      @@LuckyWitjaksono You go there, you go there, and you go ...there

    • @deantduk
      @deantduk 4 года назад +6

      sip of tea..

  • @CardboardArm
    @CardboardArm 4 года назад +62

    The differences in AI between Sim City and Cities:Skylines are very interesting to explore.
    Pathfinding for SC wasn't as bad as many people made it out (after patching). The biggest difference is how CS cars prefer faster roads while SC cars prefer shorter paths. As a result, CS cars react more according to what players are expecting them to do (drive highway for longer commutes) because they are more likely to follow the plan of the city planner. Also, SC vehicles DO plan their route on the go, so they might take a short cut in order to circumvent a traffic jam.
    The first big difference is how public transport in CS is structured and designed by the player. You can set bus routes etc. In SC, busses just drive whereever they want to go and sims getting on can only hope to be transported to the bus stop they want to get to. I image inside SC busses there is a lot of screaming and discussion about which stop to go next all the time.
    The real differences between SC en CS is what the simulation does with the results of the traffic. SC's simulator was much MUCH harsher on players if the commute time was bad. Every morning (or evening) shift, workers where requested by buildings. If not enough workers got to the building in time (approx 2 in game hours) the building would NOT function. Not only does that mean it doesn't pay taxes, it also doesn't generate goods or get an opportunity to pay it's workers. If workers don't get paid, residential houses don't generate income and thus cannot send out shoppers to purchase 'happiness' which in turn is required to grow in density. Traffic jams can crash your city's economy completely. CS by contrast only gives players a minor slap on the wrist for impossible commute times. Even if a cim child doesn't reach it's school, it can still be educated because it tried. A sim can be stuck for it's entire young-adulthood in traffic and neither his income or the business he wants to work will get penalised. As a result, any traffic AI failures get magnified in SC and minimized in CS. (As a result, CS can get away with not spawning cims when the city get's too big and thus get away with larger city sizes while SC would completely fall apart and has a stupidly small area to build in by comparison.)
    If you have the Industries DLC for CS, those industries work more similar to SC due to goods being transported (and not functioning without raw materials), though they don't require workers to make it in time to their job every morning.
    Both games DO however require good traffic management though. Both games use agents for service vehicles (fire trucks, garbage etc.) and getting stuck in traffic impacts their ability to function. This is the major incentive for CS players to make good traffic cities or residents become unlivible due to garbage/dead cims etc. SC is, again, more harsh here, as fires are more likely to spread if firefighters are not in time and crime and health also have more complex (and disasterous) consequences than in CS.

    • @CynicalDriver
      @CynicalDriver 4 года назад +16

      As a person who was very early to the deep analysis of the pitfalls of SimCity Postage Stamp Edition's traffic and service systems, I agree and disagree with you. Sim City was deeply flawed because they used a relatively effective utility "agent," "faucet," and "sink" system for the ENTIRE simulation. No amount of patching was (or is) ever going to fix that fundamental disruption of any meaningful simulation attempt. While it is true that the sims would change their pathing while en-route, they usually only did it because their target "sink" was already full and they were now traveling to a new target.
      Here's how the system operates: Houses (faucets) 1 through 895 send their "workers" out at 7am every day to find work (not go to work, *find* work.) Each "worker" proceeds directly to the closest open job (a sink.) Houses in the rich neighborhoods sent their workers to take care of the parks, while houses in the poor neighborhoods sent their workers to the gas stations or shops or industry. This flood of worker agents, which did not have ANY income requirements associated with their work search, ensured that no sim was ever truly important. A worker can be generated in the morning in a poor neighborhood, look for work until they find an open sink in an office building, then find a home in the rich area that evening. Now, this is a bit of a simplification, because education level does matter during the job search phase, but the problem is real.
      When you examine this across the entire Glassbox engine, it becomes clear that it was really meant for The Sims, and not Sim City. It simply didn't have the capability of offering a city level simulation with any depth. This was despite the developers pushing the ability to "watch your sims' lives." What is the point of watching their life if their life changes every single day? They come out in the morning to find the nearest open job for their education level, and then go find a home that matches their new income with an entirely new family. When you examine the early behavior of emergency services, it became almost comical. You would see trains of firetrucks if you had more than one fire in the city, moving from one fire to the next as they put them out, while buildings burn down because they weren't smart enough to send two fire trucks to two different fires. The same can be seen with police and ambulance services.
      All this haphazard traffic routing led to massive traffic jams, which further disrupted services, which would eventually grind the entire simulation to an utter and disastrous halt. Yes, the pathing was what everyone saw early on, but I noticed the core issue ran deeper than that. It was down to the entire methodology being oversimplified to the point of just not mattering. It was worse before some early patches, when agents would deliberately take the absolute shortest path even if a quicker one existed, but the engine is just not suited for that kind of game in the first place. Using such a simple method for sending power, water, and sewage worked just fine because they don't get jammed up (though you would still see that random sink in the middle of a city that never got reliable delivery of these essential agents because of the constantly changing "nearest open" algorithm.)
      Check this out: answers.ea.com/t5/SimCity-2013/Traffic-quot-AI-quot-This-is-why-services-and-traffic-are-broken/td-p/737060 - That, is my post. I have never spent another dime with EA since.

    • @CardboardArm
      @CardboardArm 2 года назад +1

      @@CynicalDriver Interesting read. I did notice SC vehicles change pathing when a bypass lane was full (waiting for a traffic light) it would take the normal slightly longer route. So they can recalculate within their faucet-sink system.
      For me the Simcity plot size was the reason to dump it for CS immidiately and never look back. However my expectations of the fidality of the system were much more tempered than other fans. I had a lot of fun with Simcity 4 and learning it's system because no simcity before was anywere as deep. But it was a deeply flawed system as well. It's car-centric rules made it impossible to design european style cities which turned me off the game before SC2013 even came out. And in SC4 everybody in a building all worked next door too, so I wasn't surprised by this in SC2013.
      I hope CS2 will come up with ways to make the cims actually come to life beyond their presence in traffic.

  • @Jayanky
    @Jayanky 4 года назад +44

    How the hell did they manage to do all of this and keep the frame rate at 60? Props

    • @reddragon3132
      @reddragon3132 4 года назад +13

      This kind of simulation is a mainly CPU intensive task so has little effect on framerate. As a city gets bigger you'll find that the simulation runs slower (3x speed is not as big of a jump as it used to be) as it the CPU takes longer to run things but the GPU is still facing the same workload so can render things at 60. Although for really big cities it certainly doesn't run at 60fps.

    • @ville_1235
      @ville_1235 4 года назад +12

      it sertainly isnt 60fps. Mine runs at 16fps most of the time, but that doesnt matter to be honest.

    • @marceelino
      @marceelino 4 года назад +1

      You need a lot of VRAM to run bigger cities.

    • @ThisCanBePronounced
      @ThisCanBePronounced 4 года назад +1

      vanilla and small.

    • @Rudy-ec1er
      @Rudy-ec1er 4 года назад +10

      Laughs (and cries) in over 2000 mods and assets with 46gb of used ram

  • @petergunn7039
    @petergunn7039 4 года назад +26

    I started turning off all speed limits, stop lights and signs, expecting chaos but things flowed better, and lots of bonus drag racing.
    Also it appears that the cars, scooters and trucks have different top speeds on open limit road.
    Death toll didn't rise, so free will to the people I say.
    (No rigour was applied to my study)

    • @Thetarget1
      @Thetarget1 4 года назад +5

      By default traffic stops at every intersection, so you should actually remove traffic lights and even yield signs most places in the game to optimise traffic (even in places where you would have them IRL, like in roundabouts). This isn't a problem since traffic accidents can't happen, and cims will happily merge a high speeds.

    • @drjonritz
      @drjonritz 4 года назад +8

      You can also use speed limits to encourage traffic in one direction or another...

    • @redbanlovesasians2236
      @redbanlovesasians2236 3 года назад +2

      Very interesting. Countries like Thailand, Cambodia or Vietnam actually work like this, absolute "freedom" for everyone, no street lights whatsoever and very small rate of accidents, even less fatal accidents percentage. Freedom pays off. Chaos forces you to be aware of your surroundings.

  • @MrNuubstar
    @MrNuubstar 4 года назад +129

    Just needs LANE MATHMATHICS.

  • @easymac79
    @easymac79 4 года назад +4

    I have about a 90% confidence that this theory is accurate: Most people that play a city builder game have both a fascination with traffic, as well as a deep frustration with traffic. All the other facets of the game aside, we are ALL here because we want to micromanage traffic to prove why our local planners have FAILED! Not that we can change a single thing. But watching traffic flow in a perfectly designed city sort of counteracts the day to day hell of reality.

  • @Sp3ctre18Gaming
    @Sp3ctre18Gaming 4 года назад +8

    I'm a futuristic detailer in CSL so it's cool to see this video. I wanted to add that I find collision detection to be interesting because it seems to be very "real" collision detection, detecting *any* vehicle. Maybe this is normal but I would have assumed that the game would only check paths and positions on the same network types, but as I showed in my latest video, I did a test where (using mods) I made an unnatural crossing of a monorail with a road. If the monorail was brought down to ground level, the road vehicles recognized it and would wait for it to pass by! Again, this is a *monorail,* something that in the base game is always elevated and meant to go over roads, so I found this surprising but neat.
    I never had much issue with traffic - I admit using Traffic Manager to finetune it, but as was pointed out, it also adds its own challenges by disabling despawning. I built my first city to 160k pop and practically no public transport to really see how the city works with only cars. That taught me enough, lol.

    • @redbanlovesasians2236
      @redbanlovesasians2236 3 года назад

      I would tradeoff no collision detection at all for having the ability of enabling the No Despawning mod without making my CPU melt and the game become a slideshow.

    • @Sp3ctre18Gaming
      @Sp3ctre18Gaming 3 года назад

      @@redbanlovesasians2236 but then everyone's going to bunch up inside one car at red lights XD

  • @TheAmazingCowpig
    @TheAmazingCowpig 4 года назад +40

    Oh no, Tommy, I bought the complete C:S a few months ago for a huge discount but never started playing it since I suddenly didn't feel like it, and I've been so productive in the meantime. Now that you've framed the game through its AI systems, I might start playing it and stop being productive!
    Really cool case study, it's really impressive to think about how to get AI systems working on such a city-scale. And the way some players have talked about the traffic sim at times, you'd think the answer to "how it works" was "it doesn't", haha.

    • @AIandGames
      @AIandGames  4 года назад +16

      I'll apologise now for what's about to happen.
      I have had to abandon the game for now, but only for reasons that I can't get into just yet (i.e. new videos coming in September/October).

    • @agafaba
      @agafaba 4 года назад +5

      @@AIandGames Abandoning city builders is part of the experience, otherwise you would never get anything else done

  • @Tuppoo94
    @Tuppoo94 4 года назад +7

    It's cool to build an experimental intersection, like a Continuous Flow Intersection or a Diverging Diamond and see the improvement in traffic flow. I think in the end the traffic works really well.

  • @redbanlovesasians2236
    @redbanlovesasians2236 3 года назад

    Just a friendly reminder that these "innovations" that Cities Skylines had when compared to Simcity were already implemented in a game released early 2014 called Banished. If I'm not mistaken, Banished was the first-ever game that fully rendered and simulated every citizen on the map at all times, instead of relying on math statistical simulation like Simcity series did. And what is even cooler is that it was fully developed by a single guy, including the entire 3D engine, from the ground up. A truly tech marvel of its time that deserves a bit more spotlight in historical memory =D

  • @soberhippie
    @soberhippie 4 года назад +2

    11:45 - Hi, sorry, I can't come to the office today? - Are you alright? - Well, it's due to compute limitations.

  • @LonelyAwesomeWolf
    @LonelyAwesomeWolf 4 года назад +16

    Loved the existential crisis joke. Also, I wonder if you could make an episode on any of the "The Sims" at one point.

  • @nicolasblume1046
    @nicolasblume1046 4 года назад

    Where Cites Skylines really shines is its public transportation systems! I absolutely love to realistically design a whole system of Inter city trains, commuter trains, metros, trams, buses etc.

  • @Chandasouk
    @Chandasouk 4 года назад +33

    This channel always has interesting topics I've never though about

  • @drjonritz
    @drjonritz 4 года назад +9

    You could do a whole series on CS A.I. features and edge cases and I'd watch them all and share them and save them and thumbs up!! Thank you! Also, thank you for all the commenters ahead of me!

  • @Drakkart
    @Drakkart 4 года назад +26

    Sadly you did not dip deeper into the pathfinding or other related topics but never the less an awesome video on one of my favorite games. Really enjoyed the roolup of history with sim city and all these side facts like CO being 14 people to start with. Thanks a lot that was a good one.

    • @luska5522
      @luska5522 4 года назад +1

      Yo star made guy

  • @justinhutchinson9507
    @justinhutchinson9507 4 года назад +4

    When they changed a main road near my house by putting a traffic light in. They told everyone to avoid using the road after it was set up. Problem was that thousands if not tens of thousands of cars go through that road to connect into the city or go north, south and eastern suburbs. This resulted in a 45 minute extra traffic delay which also backed up to the school which is along the main road.
    It took them 3 months to put the traffic light in. Took another month or two to fix the problem that was created. Although they made it slightly safer to get in and out of the side street where the traffic light was installed. They also stop cars from that side street to turn right on to the main road to get to the city or eastern suburbs. This resulted in traffic jam that travelled down to the train station (about 2km)which gets very busy as soon as peek hour begins. Since it was a side street the traffic lights green light timing was minimal (about 5 seconds) and when you try to turn left from the side street you can't because there is always that one extra car that wants to squeeze in before the light turns red.
    Eventually it was fixed because the chaos of too many cars going to and from work has now ceased. Or everyone got fired.
    If you read this far tell me to stop smoking a fruit

  • @speedy_von_gofast
    @speedy_von_gofast 3 года назад +2

    Back in SimCity 4 and previous games, citizens and traffic just fade in and out randomly. This is very impressive.

  • @harktischris
    @harktischris 4 года назад +1

    You say that the game doesn't penalize you for hitting the cap, but it does, indirectly, if that cap excludes important vehicles, such as ones that help ship or deliver goods or are emergency services tending to something.
    In practice the cap should not be that much of an issue in default settings since you can't unlock that many grid squares to build on. There are mods that let you unlock more and the risk you hit the cap becomes more significant.
    That being said, as someone who has been diehard for SimCity since the original, Cities: Skylines is an absolute gem and blows away the SimCity franchise. With a couple mods (to take care of the lifecycle simulation issues and to add in some traffic improvements, such as on-the-fly re-evaluation like you mention is missing by default), C:S is the best sim game I've ever played.

    • @harktischris
      @harktischris 4 года назад

      Also even though C:S is a much newer game than SC4 (the last competent traffic simulation in the main SimCity franchise) and uses multithreading (SC4 was single-threaded), pathfinding is a really complex problem. I believe the time complexity of A* or Dijkstra's is at least polynomial, and doing that over even a capped number of actors causes an explosion of calculations. Even on my reasonably high-tier gaming PC large cities in C:S start slowing their simulations to a crawl trying to cope (most noticeable when the fastest speed is no longer faster than the second-fast speed).

  • @ruthlessadmin
    @ruthlessadmin 4 года назад +7

    Using TMPE+Real Time+Realistic Population Revisited+Rebalanced industries, I have no major complaints. Everything works extremely well, and traffic is very realistic. If traffic is jamming with these mods, it's a planning problem, not an AI issue. I also don't use a lot of the -kinda cheating- often criticized methods a lot of RUclipsrs such as Biffa employ (like blocking lane switching on a node with no intersection). For example, right now I have a nice city with around 12k population, 85% traffic flow, without a single roundabout, traffic light or lane restriction (except for helping on-ramps, b/c the AI is still a bit dumb about that, even with mods, sadly). Simply building an extremely well thought out road & public transportation network is all it takes, and I frankly wouldn't be surprised if that's true for the vanilla game as well.

    • @agafaba
      @agafaba 4 года назад +1

      I have seen a few Biffa videos and I didnt see any cheats to make it easier there (admittedly I only watched his fixing traffic videos so maybe different for his own cities)
      As someone who played vanilla 99% of the time I can confirm that its possible. I have a lot of messy cities that even god has forsaken but I eventually learned the tricks to keep traffic in a good spot.

    • @ruthlessadmin
      @ruthlessadmin 4 года назад

      @@agafaba I didn't mean to imply I thought he was a cheat...I guess those words didn't come out very well and are corrected. I really enjoy Biffa's videos and I've learned a lot from him. I corrected my comment.

    • @redbanlovesasians2236
      @redbanlovesasians2236 3 года назад

      Did they ever fix the lack of Commercial demand after some point in the game? Commercial seems to be pointless after population 10 thousand or so.

    • @ruthlessadmin
      @ruthlessadmin 3 года назад +1

      @@redbanlovesasians2236 I haven't noticed any issues. They re-balanced a lot of that stuff w/ the Industries update. Now you can set up an industry district and dedicated commercial district to consume the products. Pretty cool, I think, and much more realistic model.

    • @redbanlovesasians2236
      @redbanlovesasians2236 3 года назад +1

      @@ruthlessadmin The problem with Cities Skylines is that the late game remains mostly superficial, shallow. I wish they would make possible to use the supply chain into some kind of tactical element, instead of a mere aesthetic distraction like it happens now. Why am I saying this? Because I have the suspicion they simply removed portions of the code in regards to "Goods" output from industries, rather then fixing the bug, see what I mean? They don't really fix the issues, they remove a feature when they can't figure it out in the code.
      There's still room for improvement, if they really want it. Or if Colossal Order doesn't want to spend more time with this game, at least stop breaking mods at every update.
      Let the game be taken and supported by the modders then, and don't get in their way. That would be enough to breath new life into this game. Don't get in our fucking way, stupid devs.
      Just look at what happens with the modding community in Banished (things like Colonial Charter and many others that affect gameplay, and not only aesthetics) and even OpenTTD (total redesigns of supply chain mechanics that affect gameplay, different kinds of AI opponents, etc etc)
      There are ways to keep building on top of Cities Skylines if they really want it. I fucking love this game, and I don't want to settle for mediocrity. The starting game is really fun and addicting, but the late game is lacking.

  • @RomanKardashov
    @RomanKardashov 4 года назад

    16:38 probably the most frequent type of road accident: colliding with incoming traffic when turning left (for right-hand traffic). Thanks for the great research and video!

  • @happilyham6769
    @happilyham6769 3 года назад

    Traffic in Cities Skylines is probably the biggest challenge I have ever faced in a video game. And once you reach 50-100k pop is your main objective. Just managing traffic flow. I was over 700k and for some reason my whole city just started dying. I eventually was able to get things back under control, but even after many hours of playing have not been able to recover my losses.

  • @Beastinvader
    @Beastinvader 4 года назад +1

    CS is smart because it centers on the citizens, with everything build around them. Traffic and all.
    Citizens are not just an extra.

  • @ThePrimeMinisterOfTheBlock
    @ThePrimeMinisterOfTheBlock 2 года назад

    Hey mate. Appreciate the deep dive into traffic mechanics, this'll help me understand how to play the game better

  • @smidge-J
    @smidge-J 4 года назад +8

    Part of managing traffic also comes down to the player, and the systems and networks they provide. If you have a terrible road network, no AI can fix that.

  • @MrPianoMan
    @MrPianoMan 4 года назад

    I'm glad RUclips recommended this channel 😊

  • @rebelmachine88
    @rebelmachine88 4 года назад +1

    I've got almost 400 hours in this game, so this video was fascinating! Nice work

  • @alexhannah8889
    @alexhannah8889 4 года назад

    I think once lane switching is figured out City Skylines will have extraordinarily well done ai. The only traffic jams one encounters with well designed cities are that cars only utilize 1 or 2 lanes of a 4-6 lane road, creating huge backups on a single lane while 3-5 other lanes are entirely empty.
    (Some of the mods have given players some options to avoid this sometimes by manipulating how nodes can interact and restricting travel paths)

  • @cmonster67
    @cmonster67 4 года назад

    One of the most entertaining and definitely informative videos about Cities Skylines that I have ever watched.

  • @itsthesoup11
    @itsthesoup11 4 года назад +1

    Fantastic video, literally sat here taking some notes to carry back to my city. I've got nearly 1,100 hours in the game!

  • @tehgjunki
    @tehgjunki 4 года назад +1

    You sound like Zoltan from The Witcher series, and I love every second of it.
    Great video too!

  • @phuturephunk
    @phuturephunk 4 года назад +8

    The funny thing is, they did all this work to flesh out the sims, all these interconnected variables. Went to the extent of setting up an entire policy area and even individual industries. And not one bit of it matters as far as the simulation engine enforcing any sort of give and take with the player as far as the direction your city goes. I've been playing this game for years now and I don't think I've accessed any aspect of the policy framework in the game at all. Like, ever...and it hasn't affected the growth rate or the zone quality upgrade pattern one bit. In the end you can still plop everything and it doesn't matter one bit on whether your city grows well or not. I love Skylines but it should really be considered a City ...I guess you could say 'painter' for your imagination rather than a quality city 'simulator' in a Sim City 4 sense. Better part of 20 years later and no one has yet to match that game.

    • @alimahil1881
      @alimahil1881 4 года назад

      LI

    • @HallowedError
      @HallowedError 4 года назад

      Yeah I've put a lot of hours into skylines because it's relaxing but at some point I realized that every city turned out essentially the same. I was hoping the industries DLC would help but it just felt like micro. The only half-assed idea I could think of to fix it would be some sort of 'Country/region' option that would affect what sort of random events are likely to happen which ideally would change how you build it. Or maybe some sort of timeline randomizer so you're city has to actually care about what's invented or something. Right now it's just too static

  • @chengong388
    @chengong388 4 года назад +45

    The most impressive thing aobut Cities Skylines, is they're doing all this on the slowest game engine of all time, Unity.

    • @Sp3ctre18Gaming
      @Sp3ctre18Gaming 4 года назад +8

      Yet the simulation is on a single thread. Could have been even more impressive!

    • @1234macro
      @1234macro 4 года назад +7

      This is not really correct

    • @TheXev
      @TheXev 4 года назад +2

      @@1234macro Agreed. Cities: Skylines has moved to newer versions of Unity as they have progressed. There is some multi-threaded capability in the current version (being single threaded might be true for older versions though).

    • @agafaba
      @agafaba 4 года назад +2

      @@Sp3ctre18Gaming Just means when they make cities 2 they can multithread from the start and we can calculate significantly more traffic at once haha

  • @mishillism8362
    @mishillism8362 4 года назад

    if i build a city, i never use traffic light, only using stop sign. If u understand the citizen behavior, u can make the road network nicely. Citizen will always finding the fast path to reach their destination, they will find the shortest and fastest road available. Sometimes u need make a policy to force the citizen doing what u desire. I hope this will be a nice little information for u.

  • @dongyongkim
    @dongyongkim 4 года назад +1

    it is crazy to think about the monumental about of data/objects and relations between then this game has to keep track of and that doesn't even include things like the physics or economy. its these things that preserve the "magic" for me in video games

  • @LetsCrashThisParade
    @LetsCrashThisParade 4 года назад +3

    Ahhh so Covid is just how the simulation is explaining our AI-cap in the simulation we all live in. Its context for us as NPC's as to why we can't leave our destinations right now

  • @slyaspie4934
    @slyaspie4934 3 года назад

    Fascinating and insightful as usual thank you

  • @simonstrba7686
    @simonstrba7686 2 года назад +1

    This is so interesting. It's a shame that the only way to discover the black box of game mechanisms is through hours of playing. It would be great if the developers provide players with exact information about what the citizen's spatial choices are based on (where they go shopping, workplace, school, etc.) and why they make those choices. City Skylines has great educational potential for disciplines such as human geography, economy, sociology, urbanism, or city planning. First, however, you need to have an understanding of these black-box mechanisms to be able to examine developers' assumptions about the real world to compare them to actual scientific concepts.

  • @emanuelemaione9813
    @emanuelemaione9813 4 года назад

    It would be epic if Transport Fever had this kind of traffic AI

  • @FirestormMk3
    @FirestormMk3 4 года назад

    Oh, I bet Transport Fever and the sequel use similar route planning for citizens. What a cool video, nice to see an examination of AI that isn't an antagonist to the player which most people focus on.
    Side note, I'd still enjoy that Forza video you threatened.

    • @LO20011024
      @LO20011024 4 года назад

      TF2 cars stop in front the road segments that I modified recently, sucks.😥 However it was an train focused game, that you may only use trains and forget about the road systems.

  • @gabriel_phx051
    @gabriel_phx051 3 года назад

    Amazing video man , keep it up!

  • @saladcollective3380
    @saladcollective3380 4 года назад +11

    Have a look at the Rain World AI next, it seems pretty intricate from the outside looking in!

    • @HallowedError
      @HallowedError 4 года назад

      The wiki has a page about AI 'directors' and it sounded super cool

  • @AricGardnerMontreal
    @AricGardnerMontreal 3 года назад

    A Cities skylines AI competition would be dope

  • @rickcolan2116
    @rickcolan2116 4 года назад

    I think next time anyone who develop a city building game has to consider more factors and situation to avoid traffic jams in my opinion but anyway new problems and new solutions will appear. Was great to know how the system works

  • @SHADOW_F_A_X
    @SHADOW_F_A_X 4 года назад +1

    Honestly for me, the game that has the smartest AI has to be Shadow of Mordor and Shadow of War, They’re amazing games with amazing stories and gameplay features.

    • @hadifelani
      @hadifelani 4 года назад

      But that's a whole different types of game smh

  • @jaybenton7716
    @jaybenton7716 4 года назад +5

    It's amazing they got something like this running in Unity BEFORE the release of the Unity Job System. If they stick with Unity for CS-3 then hopefully the UJS will help them get even more out of the game.

    • @kvjbreaker7054
      @kvjbreaker7054 4 года назад

      Woah woah woah, this game was made in unity? Well, hot damn it doesn’t look bad for that, but I guess that’s why there are limits to the variety of car models and pedestrian models.

  • @AceTaxiaGaming
    @AceTaxiaGaming 4 года назад

    Cool to see you on camera. Great video all in all as well

  • @TheXev
    @TheXev 4 года назад

    I think one other thing to note between SimCity 2012 and Cities: Skylines is the use of 32-bit vs 64-bit. It was very much complained about that SimCity 2012 didn't use a 64-bit executable, allowing for larger cities to be created by being able to use more RAM. Cities: Skylines I believe has always used a 64-bit executable, which is one of the reasons why cities can be absolutely huge... (and also why 16GB is laughable for a serious machine built to play Cities: Skylines! hahaha!). Perhaps this limitation added to the problems SimCity 2012 faced. I am sure the use of 64-bit helped in enabling Cities: Skylines developers to have a more complex and nuanced system.

  • @oeliku3033
    @oeliku3033 4 года назад +1

    I always thought they have a very basic AI just wandering random paths (maybe based on a precalculated heat map) and when you click a citizen it makes up a name and stuff on the spot. How they did it is really impressive

    • @gabrielandy9272
      @gabrielandy9272 2 года назад

      i would not even play the game if the simulation was fake =P, simcity 4 was the last simulation game i allowed my self to play that don't use a agent system, now i only accept city games if they simulate the agents properly.

  • @choo_choo_
    @choo_choo_ 4 года назад +1

    Building roads in CS is by far my favorite aspect of the game. There's something very cathartic about laying down roads and then tweaking them and completely revamping them as traffic gets higher, and watching the traffic flow by as you see your hard work come to fruition. It's got that same "one more turn" feel that Civ has in the sense that even when you're satisfied with the roads, you still want to optimize and get the roads to be as efficient and un-congested as possible. It's hands down the best part of the game.

    • @marcus1997leung
      @marcus1997leung 4 года назад +1

      Choo choo i once found myself spending 4 hours fine tuning my public transport system so that it could handle the workers coming from my specialised industry.
      Nothing beats the satisfaction you feel when you finally got the right amount of trains buses and metro to get them out before they start driving

    • @choo_choo_
      @choo_choo_ 4 года назад

      @@marcus1997leung No kidding, I absolutely loved making bus hubs from scratch. Like a big ass train station but for busses, lanes for the different lines, elevated walkways, metro lines that lead to it, the whole 9-yards. The ones that are placeable buildings are nice, but nothing beats the fun of setting that stuff up yourself.

  • @MrFirebeaver
    @MrFirebeaver 4 года назад

    One of the greatest games of our time. (700+ hours played)

  • @DiseasedRobot
    @DiseasedRobot 4 года назад +2

    Great case study
    please do tropico next

  • @aithemed
    @aithemed 4 года назад

    I always imagine that the IA of the cars on CS are liked the first iterations of the self driving cars on the real world , that’s why they have strict rules. I never have been frustrated by the traffic jams and I learn how to network my cities, 1200 hrs later of vanilla game and I never used any mods my traffic looks and feel realistic on my cities .

  • @FireController1847
    @FireController1847 4 года назад +1

    I *really* wish you mentioned TM:PE and how most players consider it a must-have. Possibly a separate video? Because I think it'd be interesting to see your take on it and how it modified the AI / outright overrides it

  • @prekatori
    @prekatori 4 года назад

    I think its really crazy that mods allow you to place crossings whereever you want. Allow you to change how the lanes connect at intersections and change the timing of traffic lights.

  • @YunyunUnion
    @YunyunUnion 4 года назад

    Colossal Order: Programs the lives of nearly every citizen
    RUclipsrs: Haha just build a road on top of road & send boat through it

  • @smartroadbiker
    @smartroadbiker 4 года назад

    My biggest frustration is that you have a highway with 3 lanes. At a junction the right lane is turn off the highway and also carry on the highway, yet the vast majority of the cars will choose that lane even if they are carrying on the highway. As Biffa says, lane mathematics can be used to mitigate it, but it is just such an odd and jarring behaviour.

  • @Xenro66
    @Xenro66 4 года назад +1

    I will consider myself a "hardcore" traffic micromanager. I've always used TM:PE and a bunch of other mods to not only make the behaviour of sims a lot more realistic, but also give me much greater flexibility in how these paths can be calculated. While I knew vehicle despawning/teleporting existed (and hate it with a burning passion), I didn't know there was a cap of sims on a path. The more ya know

  • @need8394
    @need8394 4 года назад +1

    Hehehe, me over here on Xbox with my 110k city population with 83% traffic flow... Although, more then half my time is spent on fixing traffic and making actually work. It's like a big puzzle that will never be done. Fix one problem and another one will appear

    • @ThaJay
      @ThaJay 4 года назад

      That is what makes the game so fun for me

  • @geofff.3343
    @geofff.3343 4 года назад

    I'm ready for Cities Skylines 2. One RUclipsr wished that they would focus less on deathcare (which is more of a commercial thing) and focus more on providing parking facilities. Which I think would make an interesting dynamic.

    • @TekuSPZ
      @TekuSPZ 4 года назад

      Cities Skylines has very advanced parking features, in reality, many buildings have "Parking slots" where citizens will park if walk is better than driving for some part. Some streets support it, mainly small ones, parking on sides. And there are many user assets with parking houses etc, because system is ready for it. Only missing part are assets.

  • @justanotheryoutubechannel
    @justanotheryoutubechannel 2 года назад +1

    I absolutely love Cities Skylines but I do think the traffic is far from ideal, it’s definitely competent enough and better than SimCity but several of the flaws I feel could be improved with low CPU cost, and mods have already found ways to replace the AI with a smarter system although it is very CPU heavy. I think I would best analogise the situation like this, SimCity 2013 is a beautiful looking chocolate cake with buttermilk icing, it seems delicious and it’s amazing from the outside, but then you cut it in half and see it’s been made atrociously and there’s something wrong with every element of the cake; on the other hand there’s Cities Skylines, an amazingly well made Victoria sponge that lacks some of the looks, flavour and charm of SimCity but is so well made that it’s a masterpiece, but then you take a bite and you realise it’s been made with ketchup instead of jam (representing the traffic system), however overall it’s still much less bad than SimCity, since when making that cake they screwed up even harder; instead of using chocolate they accidentally used crap.
    I think it definitely works well enough, but the single lane issue is very shoddy and the intersections act weirdly, unlike SimCity cars often disobey traffic lights and block intersections, it feels so strange to see cars going out of sync and driving through each other since they were both allowed to move when they would’ve conflicted, something SimCity had noticeably less trouble with. There’s a mod which adds timed traffic lights that work more like SimCity but it’s no real fix because there’s so much delay between each light going green and most cars are left waiting for no reason.
    The system also has the same flaw as SimCity, where cars ignore congestion completely and will use the wrong roads, the only difference is instead of just using the shortest route they will now use the fastest route, which means they won’t use tiny dirt roads all the time, but they still ignore traffic entirely so instead of queuing up on a non-ideal road because it’s shorter (while filling all the lanes) they instead jam up one lane down a highway or avenue even when it’s not the right lane for their turning, I really wish they’d just had any kind of congestion system, even if it was just adding a weight to any road with more than a certain percent of congestion, something which SimCity actually featured for a while after patch 7, but was removed shortly after most likely for performance reasons.
    Luckily though, the struggling traffic system can be worked around, since unlike SimCity driving is not the priorities for most Sims, your people will choose to use public transit or walk if possible and only drive when they need too, whereas SimCity has opposite priorities.

  • @raceguy-wy3ps
    @raceguy-wy3ps 4 года назад

    This has helped me fix my game thank you

  • @BonBonB
    @BonBonB 4 года назад

    Excellent presentation. Well done!

  • @Free_Krazy
    @Free_Krazy 4 года назад +5

    "How does traffic work in CS?"
    Spoilers: it doesn't.

  • @kylek29
    @kylek29 4 года назад +3

    Great video as always.
    I really hope you plan to do the new WatchDogs Legion at some point after it releases. Be curious to see what tricks they're using on that one, given its "be anyone" selling point.

    • @AIandGames
      @AIandGames  4 года назад +1

      It certainly looks interesting. As always, it might take a while for me to find out how it works.

  • @mattaaron6142
    @mattaaron6142 Год назад

    Thanks for the asmr❤

  • @DuelScreen
    @DuelScreen 4 года назад

    Consider making a follow up video on the popular traffic mod given that the developers explicitly removed some features that it enables. I imagine there's more than enough content to make another video. The AI of this game is rich and the developers have made some smart decisions.

  • @martindominikus8825
    @martindominikus8825 3 года назад

    Thank you for the amazing video! By the way, you sound like Jordan Peterson in lower note.

  • @PaconskY
    @PaconskY 4 года назад

    I personally did not like that CS does not seem to have a time of day system. Citizens just go whenever they feel like. Its something that I really liked in SC, seeing everyone leave their home in the morning. I think that CS would not need a despawning algorithm if they had rush hours.

  • @Marquis-Sade
    @Marquis-Sade 4 года назад

    I have no idea how to code, but I still find this very interessting!

  • @TickTock725
    @TickTock725 4 года назад

    Never thought about the ai of traffic lol thanks for the vid!

    • @bassdrumflextime1253
      @bassdrumflextime1253 4 года назад +1

      This is one of the things I was wondering about forever lol

  • @joeykeilholz925
    @joeykeilholz925 4 года назад

    I haven't thought about this enough to realize fully how awesome it is. Future entries less limited by modern CPUs will be great to compare 😉 pls
    Even then, I love this game conceptually as a benchmark tool for CPUs.

  • @apotheosis27
    @apotheosis27 4 года назад

    Great video

  • @TheGreatSeraphim
    @TheGreatSeraphim 4 года назад

    The problem with the game is that they take the absolute best route with zero regard whatsoever for its actual efficiency. The game has multi lanes, but in reality if the cit has any planes of turning anywhere down the line it will hard hug that lane. And without TM mod to set multiple turn lanes it really boils down to the game might as well only have 2/3/4/5 lane roads only as they only care about turning left or right. They don't think, "Hey, Im not turning for a while on this 6 lane road. I'll stay in this middle lane so I'm not caught behind all these people turning." The game also lacks sliplane intersection options that would drastically deal with this problem in the suburban urban divide areas you often see. Yeah you can kinda force simulate them, but they aren't real sliplanes and CS fights back by making the road segments wider rather than the boulevard smaller. So you end up with this ugly lump at intersections.

  • @playgamejad1590
    @playgamejad1590 4 года назад

    Remember there is policies option in the game while building city that allows to put more effort in traffic options

  • @hudbudmudsud
    @hudbudmudsud 4 года назад

    It would be interesting if road crashes would be possible but I think it would open a new can of worms

  • @oleksaw8087
    @oleksaw8087 4 года назад +1

    I'd say that SimCity's traffic AI is much much better then one in Cities Skylines, based on 2 main reasons. In SimCity traffic uses all lines if posible, where in Cities Skylines cars often pile up on one lane for no reason. Also traffic in Cities Skylines seems to be too heavy, you face giant traffic jams whith normal street layout even in 10-20k cities. Whitch is absurd. Game forces you to make very unrealistic road system to have some traffic flow.

    • @milokojjones
      @milokojjones 4 года назад

      I would disagree, I personaly didn't play SimCity, but I would say that CS AI is more realistic -
      1) The reason why cars pile up in one lane for semingly no reason is ussually because there is a junction or road that is separating from the main road and the main road doesn't have dedicated turning lanes, so the cars that want to turn off and go strait are all in one lane. You can fix this with trafic manager mod, which should be in the base game IMO.
      2) This is only case with the industry, because if you don't have the industries dlc, the industrial buildings are quite small and there is a lot of them, each has its own truck, which at the end makes very heavy traffic and if cities are planed bad, traffic jams ocure.
      I would say though that it forces you to create more realistic roads, but it also depends on other things like the cargo train transportation, etc.

  • @orphanchopshop6537
    @orphanchopshop6537 4 года назад

    I would love to see how you describe the AI in the metro games(2033, Last Light, and Exodus), I think it would be cool to see such a good game's AI described in full detail

  • @alexalekos
    @alexalekos 4 года назад +1

    11:49 bottom of the screen on the end of the zebra crossing: *and here you can see a guy putting his scooter in his pocked to continue on foot, another typical problem of the simulation*

  • @Poppa_Capinyoaz
    @Poppa_Capinyoaz 4 года назад

    Traffic jams wouldn’t happen if trucks pulled off the road to deliver, like real life.

  • @TheFunkSyndicate
    @TheFunkSyndicate 4 года назад

    13:00 WRONG WAY. DOWN A ONE-WAY STREET.

  • @iRedEarth
    @iRedEarth 2 года назад

    I was hoping to hear how the cims choose their destination when they leave.

  • @Croz89
    @Croz89 4 года назад

    I was told there's an "induced demand" mechanic where if you build more roads more citizens will own (and use) cars, creating a positive feedback loop. I don't know if this is affected by the quality of public transportation.

    • @phuturephunk
      @phuturephunk 4 года назад

      Believe it or not, sims in Skylines absolutely LOVE footpaths. I started playing around with elevated footpath networks just as a joke and then something really interesting revealed itself to me: Sims in Skylines will walk excessive amounts of distance if they can. Like end to end across a metro area type distance. It acts as this otherworldly effective guard against excessive personal car traffic. It will actually capture more of your sims than a well designed metro. Doesn't fix freight buildup but for residents, it's like a magic eraser for traffic.

  • @mog7501
    @mog7501 4 года назад

    16:01, 16:43, lmao imagine traffic using all 6 lanes of your 6-lane road. Couldn't be me.

  • @magolbrr
    @magolbrr 4 года назад

    Thanks for the video!
    Can you please make a video about any of the grand strategy games (for example - Hearts of Iron 4)?
    That will be amazing

  • @SpaceMissile
    @SpaceMissile 4 года назад

    Good stuff, thanks.

  • @stevensutanto968
    @stevensutanto968 4 года назад

    Will you explain Little Nightmares game AI in the next video, please? I want explanation about why bugs sometimes happen when one of the villains catches Six. Thank you.

  • @RFGfotografie
    @RFGfotografie 4 года назад

    Amazing game, very interesting video :P

  • @sadgiraffe6669
    @sadgiraffe6669 4 года назад

    They pick a random lane on a motorway and every single car tries to fit on it.

  • @dlwilliams10
    @dlwilliams10 4 года назад

    You should do racing games! I've always wondered how they make them

  • @Jesus_Paid
    @Jesus_Paid 2 года назад

    Do you know if cars in this game take left turns into buildings, crossing on-coming traffic?

  • @nathanbossoh
    @nathanbossoh 4 года назад +1

    Dang, I'm never this early! Pretty cool, great vid of course

  • @REXanadu
    @REXanadu 4 года назад +3

    I may have missed hearing it in this video, but can cars crash in City: Skylines? Most of the cars I saw in the footage come very close to crashing, and I could only think of some people intentionally making a system where cars could occasionally crash.

    • @RandyFortier
      @RandyFortier 4 года назад +2

      No, there are no crashes in this game. The intersections are marked as potential collision joints, and then the vehicle movements are all orchestrated by determining their order (by expected travel time to the intersection). That is why every vehicle seems to come so close to each other at busy intersections.
      There are some bugs in the transport system, though, that do sometimes allow vehicles to travel through one another, but that is a strictly graphical effect (the vehicle separation is less than the length of the 3D model, for example).

  • @mochamadarifseptianputera9823
    @mochamadarifseptianputera9823 4 года назад

    we need 4 in 1 road policy like in real life, 1 small car must filled with 4 people at least, or car could not pass or enter the road

  • @shunyaku7759
    @shunyaku7759 4 года назад

    13:11 Now those are some reticulated splines.

  • @TheStevedie
    @TheStevedie 4 года назад

    I built a new gaming pc for Simcity 2013 and Diablo 3 specifically. Diablo 3 was a huge let down when it was released, better now though. When Simcity came out it was a train wreck. I checked back this year to see if anyone modded the hell out of it, nope not really because its such a wreck lol. Cities Skylines I put a couple hundred hours into..its great.