Cities: Skylines

Cities: Skylines

檢視統計資料:
Philip 2019 年 1 月 6 日 下午 3:49
Problems when cargo train demand exceeds capacity
I've found it difficult to use cargo train terminals effectively. Without the stations, trucks depart on highways and all is well. But if I add a cargo train station, there's huge demand for it. A large number of trucks (not sure if it's all) prefer the cargo station over the highway, regardless of traffic backing up at the station. And traffic backs up so much that it begins to despawn (https://steamcommunity.com/app/255710/discussions/0/1708438218856421018/).

So, to first approximation, either I can have zero cargo train stations, or I can have many (enough to handle the full demand), but anything in between doesn't work well.

Note that this is not a problem of traffic flow. Traffic is flowing well, and there's a constant stream of trucks going into the terminal, so that it is 100% utilized. But the rate that it can ingest trucks is slower than the rate trucks arrive.

Have others experienced this problem? How do you solve it? I see the "no despawn" mod in the thread linked above, but that seems more like it's treating the symptom rather than the disease.

My suspicion is this may be somewhat fundamental to the game's algorithm for selecting paths and destinations: it tries to find the destination it can reach fastest, under the (false) assumption of zero traffic. But maybe there's a work-around. And, how do the trucks decide whether to drive out of the city or go to a cargo train terminal? Are terminals always preferred, or is it whichever's "faster"?
< >
目前顯示第 1-15 則留言,共 41
FlameWar 2019 年 1 月 6 日 下午 4:16 
Well, to answer your questions in part and provide advice:

1) There is an algorithm for buildings deciding if they want to export via train, ship, plane or truck. But it's not really anything you can build for (except ofc stuff like traffic prefering the nearest cargo station if they want to export, and export options that are a lot farther away beeing less preferably). Gneraly you can work with the assumption that, if you keep cargo exits in somewhat proximity (so not on the other end of your city 5 tiles away) you'll get a somewhat equal split between cargo train and trucks, with ships and planes cutting mostly into the truck export section of your traffic.

2) When you build cago stations (no matter if train, ship or plane) ALWAYS make sure to build them on a 1-way street loop. If you have a street horizontaly on your screen, and the cargo station above that, traffic will always enter from the right and exit from the left. Or, simply said, if you have right side driving on (default option unless you changed it), the vehicles will always turn right into a building if at all possible.
So if you have a street horizontal across you street, force a 1-way loop where the vehicles come from the right side of the screen and exit towards the left. That will significantly increase your stations thoroughput.

3) Obviously, always make sure the exit lane from the building is clear. It technically won't girdlock if no vehicles can exit but they can still enter, but you will want to not have that situation if avoidable.

4) In a short and simpel answer for your beginning question: Yes, if one train sation get's overhwelmed by trucks when you follow advice 2 and 3, you simply need more cargo staions.
Which is totaly not a bad thing. It's just like when your city grows beyond a certain size and normal roads are overhwhelmed, you want highways for the main aterie(s) of the city.

5) Keep in mind, more train stations also mean traffic from various parts of your city can go to the nearest one, which means overall far less congestions on our traffic routes (provided you manage the direct approaches to the cargo stations congestion free ofc). And lower travel times on vehicles in your city, which will keep you away fro mthe max vehicle limit of a city for far, far longer when your city get's big. (beside shte obviosu benefits of service vehicles reaching their targets more easily ofc).

6) Yes, traffic planning mostly ignores traffic. Because traffic congestion and route time does change all the time in many situations, and your CPU will already go into heavy work mode for the game. Adding traffic congestion calculations into the mix would grealty increase CPU requirement sof pathing, and not even be that usefull. Oftentimes traffic would not go route A because A is congested, instead all going for rotue B which will then get congest and so on.
mbutton15 2019 年 1 月 6 日 下午 7:21 
Journeys are calculated on quickest route (ignoring traffic jams). So if they all want to use your cargo station then that's their quickest way to their destination. As mentioned above, having more cargo stations gives them more options out. But spread them around, don't have them side-by-side as you'll probably find only one gets used a lot and any others will hardly get any traffic.

The standard way to deal with large queues is to use what's know as a 'sponge'. The best screenshot example I have is this: https://steamcommunity.com/sharedfiles/filedetails/?id=881345250 Normally it's a long winding road !! It's purpose is to soak up the truck traffic so getting it off the roads. In the screenshot there is a small sponge on the station to the left of the Cooper and Pleasent Districts in the bottom left of the screenshot.

Search the workshop to find more substantial examples. For instance this: https://steamcommunity.com/sharedfiles/filedetails/?id=502593656
最後修改者:mbutton15; 2019 年 1 月 6 日 下午 7:22
MonkehMaster 2019 年 1 月 6 日 下午 8:09 
i had 10 cargo stations and 2 cargo airports that had a train hub in them aswell, on the heavier side of my industry, all the trucks decided that the first airport was the only one needed and piled up in a line at that point, they would do this non-stop causing a never ending traiffic jam and making so many planes that when i finally decided to get rid of the airport it had what looked like a single plane that couldnt move and after deleting it there were about 40 more hidden underneath it and another 40+ that were stuck inside the airport that kept popping out after i deleted the one before it, i eventually got rid of the second airport as they were doing the same thing to it.

now that all the airports were gone, they decided the first cargo train station was the next to jam up, while the trains never piled up, the traffic was worse than during the airports and would litterally pile up in front of the cargo train station (in a ball) till they started despawning, i just started using one ways to move them along, but to me it seems they couldnt bother themselves with the 9 other cargo train stations in that same spot, 5 being on one street and the next street over had the other 5.

the traffic AI in this game seems to be stupid, like it had an aneurysm and was only working with 1/2 of its brain :steamfacepalm: .

you end up having to jump through so many hoops to get traffic to do things and stop jamming up its rediculous.
最後修改者:MonkehMaster; 2019 年 1 月 6 日 下午 8:12
Philip 2019 年 1 月 6 日 下午 9:49 
Thanks for the responses, FlameWar, mbutton15, and MonkehMaster, who it seems had the same problem as I did.

I have indeed built the station so the traffic flow is not the bottleneck. It's on a one-way street, the trucks all turn right into the station, and the traffic is fully clear to exit.

The traffic sponge confuses me. Of course, there is likely to be some congestion going into the station, and you want some roadway in advance so it doesn't affect unrelated traffic. If I understand correctly, the traffic sponge takes that "some roadway in advance" and makes it a really, *really* long roadway in advance so you can get a huge backlog. In my case, there are only about 40 trucks waiting at any given point in time, because of the despawning. Does your traffic sponge actually fill up without despawning?

Based on what FlameWar and mbutton15 wrote, it seems like the situation is as I expected: trucks goes to the nearest acceptable destination ignoring traffic. So, this almost forces you to have either zero terminals or many terminals (enough to handle all capacity). Or possibly, you can play tricks with distances to balance load, but this would take some experimentation.

Having many terminals is not a great solution since it constrains how you build the city. For example, in my case at least, terminals seem to cost more than their revenue.

Real-time route planning can indeed be tricky, and you can get into thrashing conditions like FlameWar noted, with traffic all going to point A and then all going to point B. There are ways to deal with this, though, and they wouldn't have to be computationally intensive. For example, agents could make decisions based on long-term averages.
MarkJohnson 2019 年 1 月 6 日 下午 10:28 
Freight is on a timer, Freight spawns and looks for quickest local delivery. If no local delivery available, then export. Looks for quickest transportation option. If no transportation nearby, export using quickest highway.

Simple solution for overloaded stations, is build with purpose. freight want to go somewhere, so provide a nearby destination.

For example, build generic industry nearby commerce, preferably on highways, or connect the two together with train tracks and train stations at both ends. Don't connect others to the track.

Don't overbuild, and create exports.

Provide multiple stations, preferable each with their own outside connection.

Remember, it is you who is creating the traffic. Each building has traffic and they need to be in balance with your other buildings, or you have exports.

It is very tricky to balance these out, especially with transportation options balancing long distance.
mbutton15 2019 年 1 月 7 日 上午 3:34 
引用自 MonkehMaster
...all the trucks decided that the first airport was the only one needed...
... to me it seems they couldnt bother themselves with the 9 other cargo train stations in that same spot, 5 being on one street and the next street over had the other 5.
That's because vehicles take the quickest route. Therefore, the first along a road will always be the quickest.
mbutton15 2019 年 1 月 7 日 上午 3:43 
引用自 Philip
Based on what FlameWar and mbutton15 wrote, it seems like the situation is as I expected: trucks goes to the nearest acceptable destination ignoring traffic. So, this almost forces you to have either zero terminals or many terminals (enough to handle all capacity). Or possibly, you can play tricks with distances to balance load, but this would take some experimentation.

Having many terminals is not a great solution since it constrains how you build the city. For example, in my case at least, terminals seem to cost more than their revenue.
I'll quite happily have more than one cargo terminal. Terminals need to be near your industry. If industry is spread around your city then it makes sense to have a terminal for each industrial area. I never expect to make money from my cargo terminals, they just help keep traffic unnecessarily driving through the city.

I don't really bother with sponges anymore. That's because I now only produce as much industrial goods as my commercial needs. So I don't have masses of industry being exported.
FlameWar 2019 年 1 月 7 日 上午 6:09 
@MonkehMaster: Never build cargo stations or airports right next to each other. One of them will be the 'fastest route' for 90%+ of incomming traffic, no matter if that's more than the station can take or not. The few remaining % will go to the other nearby stations.
Spread your cargo stations/airports around the city, or at least on different sides of your industrial/commerce area.
If you have 2 cargo statiosn enxt to each other on the same road, traffic will mostly just go for the one that comes up first for trucks. If you build them on both sides of your industry/commerce area traffic will be split about 50/50 (not entirely, sinc eother factors are usualy often at play, but you can get at least 30-40% to the second station that way easily). Proceed to add more cargo stations as needed.

@Philip:
Yes, terminals cost more than they bring in revenue. In fact, cargo rail brings 0 direct revenue.
But it will make your businesses happy, as it will alleviate most 'not enought goods/resources/buyers' problems of commerce and industry when it comes to resoruces and goods. It will also greatly reduce long-distance traffic in your city, and, if you use the industries DLC (which I can strongly recommend btw :) ) you might actually want to build an export economy in which you will be able to massively cut down on the number of storage buildings you have to build and pay for sicne you save an insane amoutn of truck traffic.
Oh, and ofc your entire city will be happier, because with less overall traffic and traffic problems, service vehicles go aorund more efficiently solving any needs far quicker.

On the issue of the revenue itself, remeber one simple thing: Commerce/industry pay you taxes (which you can jank up all the way to 11% if you need moeny and can keep them somewhat happy). Those taxes are there to cover stuff like buildings and maintaining roads, rails, airports, harbours etc.
And if your rails get in the way fo city building, remeber there is elevated tracks or tunnels. i usualy keep my cargo rail traffic in fairly deep tunnels under the city to get it out of the way.

Yes, the pathfinding in cities could be improved. But don't under-estimate the effect stuff liek that can happen. Just adding the average traffic usage of roads into the calculation will likely bump CPU time needed by more than 50%, since you go from a currently solely 'fastest' one variable equation to a two variable equation. Which will not do much in some cases, but in others it will need multiple recalculations to determine the best way. ANd that in a game where your CPu is bound to reach full load anyways once your city get's bigger, so any CPU savings are important.
Plus, the current system for determining if a street is overused can be somewhat flawed in many cases (the one they'd likely use for this pourpose would be the traffic overlay values), not really making a difference between a jammed up road, a road that has little traffic but said traffic having a lot of stop-n-go making it very slow and jam-prone if traffic increases, and a raod that is simply at high capacity but flowing completely fine.

And last but not least the game is supposed to be a semi-realisti city and traffic simulation. I did some work in traffic planning during my time at university, and trust me, it#s insane through what hoops you have to jump to get people to drive even remotely sensible. Just look at all the idiots who drive in the cores of major cities in real life, which are always congested and jammed up to an insane degree. ANd then look at the C:S simulation again and think about if it's so far off reality it wants to simulate.
Stealthy 2019 年 1 月 7 日 上午 6:25 
引用自 MonkehMaster
i

the traffic AI in this game seems to be stupid, like it had an aneurysm and was only working with 1/2 of its brain :steamfacepalm: .

you end up having to jump through so many hoops to get traffic to do things and stop jamming up its rediculous.

No. You just need to stop overcomplicating things. That's all it takes.
scpool1986 2019 年 1 月 7 日 上午 6:50 
You need to remember the concept of “multi in, multi out”, especially with freight and industrial areas. When it comes to buildings that create a lot of traffic (eg: oil pumps/wells, cargo terminals, any kind of storage, etc) it is never a good idea to bunch them all on one road and try to solve the jam by upgrading the 2 lane roads into one way or you could potentially end up with a situation like this where you have oil pumping stations trying to deliver to crude oil storage who are simultaneously trying to deliver to their customers. The same basic concept can be applied for freight by rail too. (pic is an example, not asking for help. No need to chew me a new one).

https://steamcommunity.com/sharedfiles/filedetails/?id=1613303783

It’s best to try and spread facilities that generate a lot of traffic out in your industrial areas so when one jams up it doesn’t feed into the others jamming. If it’s possible and you have the available outside connections to do this I highly recommend the “4 corner” approach where you imagine your industrial area as a square and have a cargo terminal in each corner of the square and put them on a 6 lane large road that acts as a ring road so traffic can get around the trucks waiting at the cargo terminal. If you use this approach be sure to have bypass tracks any time you have more than one terminal on a line. It balances out the demand for freight as well as the demand on the roads.

Hope this helps you some.
最後修改者:scpool1986; 2019 年 1 月 7 日 上午 6:54
Philip 2019 年 1 月 7 日 上午 10:13 
@scpool1986: Thanks. Just to be clear though, this is not a traffic problem. The problem is the capacity of the cargo train terminals, and the fact that trucks will elect to use stations where there isn't enough capacity even when obviously better options exist.

引用自 mbutton15
I'll quite happily have more than one cargo terminal.

Makes sense. But it still seems that the trucks' simplistic destination selection constrains how you have to build the city (in a very unrealistic way). Many here are talking about the benefits of traffic reduction, but a particular city might not have any traffic problems to begin with.

引用自 FlameWar
Never build cargo stations or airports right next to each other. One of them will be the 'fastest route' for 90%+ of incomming traffic, no matter if that's more than the station can take or not.

That seems like a good summary of the situation.

引用自 FlameWar
Yes, the pathfinding in cities could be improved. But don't under-estimate the effect stuff liek that can happen. Just adding the average traffic usage of roads into the calculation will likely bump CPU time needed by more than 50%, since you go from a currently solely 'fastest' one variable equation to a two variable equation.

Hmmm, I kind of doubt that. It would depend a lot on what algorithm you use to implement it and I bet it can be done efficiently. If you took the approach of long-term averages, then those averages could be calculated separately, and the route-planning calculation on the part of each individual agent would typically be the same.

But it might be more complex for users, especially novice users, who would wonder why the selected paths change occasionally.

Another idea would be to improve the destination selection without looking at real time traffic. Suppose there are 2 possible destinations, like two cargo terminals. And suppose they are similarly distant, say within 5% (ignoring traffic). Then you could have the the truck flip a coin to pick one. This should balance load better than the current approach.

引用自 FlameWar
And last but not least the game is supposed to be a semi-realisti city and traffic simulation. I did some work in traffic planning during my time at university, and trust me, it#s insane through what hoops you have to jump to get people to drive even remotely sensible. Just look at all the idiots who drive in the cores of major cities in real life, which are always congested and jammed up to an insane degree. ANd then look at the C:S simulation again and think about if it's so far off reality it wants to simulate.

Ha! Well, that might be the best way to look at this whole situation. I think the C:S simulation has different pathologies than those that appear in real life, but they might not be worse .
FlameWar 2019 年 1 月 7 日 上午 10:28 
Well, i agree that traffic-oriented pathing can be done efficiently. but no matter what you do, it alway sneeds a bit more processing. and since we already end up at 100% CPu usage with the game, you have to consider if it's worth it.
The most reasonable approach would probably be what you suggested, put a certain range in there, like 5-105 of distance difference, and then either randomly determine which it goes to, or (for plannign purposes even better) simply switch for each truck that building generates.

As for the city building constraints that come with the traffic AI, yes, there are some. But then again there are plenty of direct or indirect constraints for the city building, which does make sense and the game does need to have some imo. It is a bit annoying when you run into such a problem for the first time, but once you knwo the limtis you can plan for it/with it.
Also, don't be afraid to walz down parts of your industrial area to create another train station at the other end of it to split your traffic. With tunnels and bridges available for rials as well you can put them almsot anywhere you want with not to much space needed, and you're gonna need mroe than oen i nthe long run anways.
MarkJohnson 2019 年 1 月 7 日 上午 10:47 
I think they chose the perfect AI for traffic control. Not a better one available in my opinion.

I mean you could have all lanes backing up for miles like SC2013, when things got bad.

Or you could have a sinle lane backup for miles as a warning something is wrong?

Which would you prefer?

SC2013 had a real rush hour mechanic for a warning system though, to make up for the single file backup. If you ignored rush hour traffic and didn't fix it, then you'd get traffic filling up all lanes to several other cities. lol

Rush hour would be better I think, but it would take up too many resources that this game just doesn't have. So single file backup is just about perfect.

I mean what other mechanic would tell you that you are doing something wrong?
MonkehMaster 2019 年 1 月 7 日 下午 12:48 
引用自 Stealthy
引用自 MonkehMaster
i

the traffic AI in this game seems to be stupid, like it had an aneurysm and was only working with 1/2 of its brain :steamfacepalm: .

you end up having to jump through so many hoops to get traffic to do things and stop jamming up its rediculous.

No. You just need to stop overcomplicating things. That's all it takes.

wrong, thinking that the game should logically spread out to the available choices is not "overcomplicating" its called common sense.

the AI is garbage so stop trying to hide the facts.

"overcomplicating" is doing what someone else suggested and spreading your cargo train stations out across your city, when common sense would suggest that " hey... we have cargo train station yards in real life, so why not build one for our industry to use to send out cargo that is relavtively close and easy to use".

fyi a cargo train station yard has many stations in it, so they can push out cargo quicker and easier by using more than one, because over burdening one/or having only one, stunts progress and shipping, thus it stunts their income.
最後修改者:MonkehMaster; 2019 年 1 月 7 日 下午 12:54
MonkehMaster 2019 年 1 月 7 日 下午 1:01 
引用自 FlameWar
@MonkehMaster: Never build cargo stations or airports right next to each other. One of them will be the 'fastest route' for 90%+ of incomming traffic, no matter if that's more than the station can take or not. The few remaining % will go to the other nearby stations.
Spread your cargo stations/airports around the city, or at least on different sides of your industrial/commerce area.
If you have 2 cargo statiosn enxt to each other on the same road, traffic will mostly just go for the one that comes up first for trucks. If you build them on both sides of your industry/commerce area traffic will be split about 50/50 (not entirely, sinc eother factors are usualy often at play, but you can get at least 30-40% to the second station that way easily). Proceed to add more cargo stations as needed.

may have to seeing as the AI cant use common sense, tho having to build them spread out defeats the porpuse of setting up my streets and industry in a way that having all those at the spot i had them was quick and efficient because everything basically on the same road and was in chain of sorts and ended with a bunch of cargo train station for them to use.

but while im thinking about it, the one they were using was only the "fastest/quickest" one for a certain block of industry, they all had one that was closer and more efficient to use and other traffic would drive past perfectly good stations to use the one that was already being flooded with traffic.


最後修改者:MonkehMaster; 2019 年 1 月 7 日 下午 1:02
< >
目前顯示第 1-15 則留言,共 41
每頁顯示: 1530 50

張貼日期: 2019 年 1 月 6 日 下午 3:49
回覆: 41