Cargo Distribution

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

User avatar
keoz
Transport Coordinator
Transport Coordinator
Posts: 321
Joined: 16 Jul 2009 10:04

Re: Cargo Distribution

Post by keoz »

fonso wrote:Of course it's a challenge to fulfill the transport demands especially if you connect two networks. However, making the demand function independent of the capacities was a design decision especially create that challenge. I'm very reluctant to give up this principle.
I completely agree about that. The main interest of cargodist is precisely that we have to adapt our transport offer (or our network layout) to the demand and not the opposite. And that forces to find new interesting solutions to problems we did not have before. A simple example: I did not used so much aeroports before, because i did not find them so funny. But actually, in a very large network, they could be very useful JUST to make passengers transport more rational, for instance, using aeroport to transport passengers between distant regions, which could allow to lighten passengers demand on train networks. *But*,
fonso wrote:Passenger Numbers
First there is no boost in passenger numbers. There is a boost to the initial capacity of a link. It is applied whenever a vehicle chooses an order and the capacity of the link to that order's destination is smaller than the vehicle's capacity. This doesn't influence the passenger numbers.
Yet, I also see your problem here, but I don't quite know if it should be solved. [...] What could be done is setting a certain cap on how many passengers are allowed to wait for a certain next stop at a station. Then, if more arrive, they get "to any station" instead. This would sort of implement the "mind change".
About connecting small towns: If you have symmetric demands a station will only attract as many passengers as it generates. So a town will only attract as many as it generates, too. Of course, if you have multiple stations in a small town you will reach that limit more easily than if you have few stations in a large town.
The problem is that concretely, cargodist changes so much (in an interesting way) the game, that I think there is a real problem with passenger numbers. In my case: something i like to do in my games (and was used to do), is to build large passengers train networks between great cities. And inside of those cities, i built bus networks to (1) provide a local passenger service, and (2) provide a feeder service to bring passengers to my main train stations (to this purpose, i used "transfer" orders, which are no more useful with cargodist). But, with cargodist, the charge in each station increases a lot, and it's becoming really difficult to manage that. In one of my "10-thousands people" cities, i could manage it by adding an extremely improved tram network to the bus network. So, i had no more so many bus stations with 1500 passengers waiting. But it's hard to really manage this huge passengers demand.

I think that something has to be taken in consideration just like it is: cargodist changes so much the rules of the game, that the original passenger number created doesnt fit with the new behaviour. Either the passenger creation is lightened, either the local services (bus, stations), should be improved.

And sorry for my english.
Patch - Let's timetable depot waiting time with the Wait in depot patch.
GameScript - Searching a new way to make your cities growing ? Try the Renewed City Growth GameScript.
My screenshots thread.
Creat
Traffic Manager
Traffic Manager
Posts: 141
Joined: 26 Oct 2009 16:33

Re: Cargo Distribution

Post by Creat »

First of all thanks for the reply fonso (and the quickly added warning in the first post, it's even red :D ).

About the warning: yea, it might be enough to display a message box or something if somebody starts a Cargodist game without having "non-stop" as the default oder type set.

Also very glad to hear that you like the idea of correlating link length and the averages, looking forward to something testable :)

I see your point about the design decision as well, and I agree (now :) ). Maybe the old playing style just won't work with that system, which is also OK. I like what keoz said, using air traffic to relieve trains with potentially multiple stops of some long-range loads. They are also still useful to get passengers to remote locations that are either expensive to reach or inefficiently reached via rails, so this isn't the only use left (which would be really bad obviously).
A maximum passenger amount waiting might not be a good idea if it's a fixed amount (it would be either to high in early games to take effect or limit possibilities later). Is a maximum waiting time an implementable solution? It would only require the recoding of an arrival time of object at nodes (if this isn't already tracked). How about instead of going to "any station" they are treated as if they had just been generated, picking a destination as usual but excluding any where they'd have to use the link they are currently waiting for? I realize that it wold probably have to be a bit more complex than that, since passengers would probably start oscillating if there are two weak links to a subnetwork (but even then many of them would pick other, reachable destinations and likely lessen the gravity of the hold up).

One more wish would be more detailed statistics. For example I can't see the amount of detail about passengers (source/destination would be nice, via is kinda obvious as it is the next stop, at least for non-stop orders) in a vehicle that I already got used to from stations (also would be quite useful). Equally (if not more) important would be to be able to see how many passengers (at which location, on which route etc.) currently have a specific station as their final destination. This would help greatly with analysis of traffic flow. Maybe adding another option for the station drop-down called "headed here"? Via could show current next-stop (or the location if not in a vehicle), while source would be the most interesting information.

But getting back to the passenger numbers once again: When I read keoz' post it dawned on me why it's almost impossible to cope with the passengers in larger cities.
Previously you had buses setup to collect the passengers in a city and transfer them to a hub, where they'd be taken via train, plane or ship to a station further away, delivering on arrival and thereby generation income (and disappearing). Now we have Cargodist to take care of that all, but there's one major change: Passengers aren't just flowing out of cities but also into them since they're no longer delivered at the station. If I interpreted your answer to my small-town-dilemma this pretty much flat out doubles passengers to be transported (not to mention that they now have concrete destinations, increasing transport demands even more). While I love the concept and execution the real problem is that neither bus nor tram were ever designed to carry these numbers of passengers in such an enclosed space and eventually can't cope with the load. Obviously something has to be done to compensate for this increase. The only thing I can think of at the moment would be to increase 'popularity' of stations for additional transport systems (like hubs usually have), hopefully sending many passengers to another city but ending their journey at the hub.
Maybe just as a temporary band aid until there's a better solution?
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

That's quite a lot of suggestions. Keep in mind that my time is limited and even if I'd appreciate a lot of those things I just cannot implement all of that at once. So, in detail:
  • maximum waiting time for cargo. Contrary to popular belief the arrival time is not currently recorded. Of course that could be done, but iterating over all cargo packets in all stations every so many ticks to find out if they have been waiting for too long might be a performance problem. Maybe it could be done, as AgeCargo also iterates over all packets in all vehicles, but as I said: I'm somewhat reluctant to weakening the principle of capacity-independent demands. So this is very low in my list of priorities.
  • more detailed statistics in vehicles. The problem is that we don't know in advance where the cargo is going, neither in a vehicle nor in a station. In a station it's easier to approximate as a meaningful next stop is already set. In a vehicle however, everything is going to the same next stop and it depends on the state of the cargo flows at the time of arrival where it will travel further. These may be vastly different to the cargo flows at the time of loading. So, concluding: I could implement a destination view in the vehicles, but it would be very inaccurate. It should be easy to create a more detailed source view, though. At the moment only the source of the first cargo packet in each vehicle is shown. I might implement that soon.
  • difficulties to handle passenger amounts in towns. There are grfs that reduce passenger production and there are or at least could be grfs with super large trams and busses. Using these, the problem can easily be avoided. In general the number of passengers does double, but the new passengers are going in the other direction (away from the transfer hub), where the bus or tram was mostly empty before. The bigger problem is that passengers will transfer a lot if you have needlessly complicated networks. So they'll clog up the transfer stations and that's what you see there. I can only advise you to avoid inner-town transfer points where possible, build the main stations outside the towns and connect them to a sufficiently capacious service. A set of concentric circle routes with a single high-capacity "axis" straight through the town and big transfer points at both ends of the axis is a good layout that can also be seen in real life. So, changing this is also very low in my list of priorities. Supply scaling is a different thing, though and I'll implement that next.
In general, I could use some help here. If you think you are up to the task of implementing some additional feature for cargodist, go ahead. I'd appreciate that. I will also accept features I don't like. They will get extra branches in my git repository and then, when you download a patch or pull something from the repository you can choose if you want those features or not.
The guy on the picture is not me, it's Alonso.
Creat
Traffic Manager
Traffic Manager
Posts: 141
Joined: 26 Oct 2009 16:33

Re: Cargo Distribution

Post by Creat »

fonso wrote:That's quite a lot of suggestions. Keep in mind that my time is limited and even if I'd appreciate a lot of those things I just cannot implement all of that at once.
I'm sorry if I gave the impression that I now magically expect all this to appear, that's really far from what I intended. I was just thinking about this stuff anyways - or noticed it while playing - so I thought I might as well write it down. After all something useful might come out of it (like the moving average <-> link length correlation apparently :) ). I'm truly grateful for the work you've put into this already and I'm just trying to help with these suggestions/wishes, no more no less :D
fonso wrote:In general, I could use some help here. If you think you are up to the task of implementing some additional feature for Cargodist, go ahead. I'd appreciate that. I will also accept features I don't like. They will get extra branches in my git repository and then, when you download a patch or pull something from the repository you can choose if you want those features or not.
Good to know :) I've been looking at the code (both yours and OpenTTD in general) recently out of curiosity anyway, but it'll take some time until I reach the point where I can actually contribute something useful. But if I think I have something usable you'll be the first to know :D
Auge
Chief Executive
Chief Executive
Posts: 661
Joined: 23 Oct 2006 02:07
Location: Berlin

Re: Cargo Distribution

Post by Auge »

Hello
fonso wrote:
  • more detailed statistics in vehicles. [...] So, concluding: I could implement a destination view in the vehicles, but it would be very inaccurate. It should be easy to create a more detailed source view, though. At the moment only the source of the first cargo packet in each vehicle is shown. I might implement that soon.
CargoDest has such a view of destinations in the vehicle window. Maybe that code is usefull.

Tschö, Auge
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Cargo Distribution

Post by petert »

fonso wrote:maximum waiting time for cargo. Contrary to popular belief the arrival time is not currently recorded. Of course that could be done, but iterating over all cargo packets in all stations every so many ticks to find out if they have been waiting for too long might be a performance problem.
Doesn't all the extra code that the patch adds cause tons of extra strains on the system anyway?
User avatar
NekoMaster
Tycoon
Tycoon
Posts: 4001
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: Cargo Distribution

Post by NekoMaster »

petert wrote:
fonso wrote:maximum waiting time for cargo. Contrary to popular belief the arrival time is not currently recorded. Of course that could be done, but iterating over all cargo packets in all stations every so many ticks to find out if they have been waiting for too long might be a performance problem.
Doesn't all the extra code that the patch adds cause tons of extra strains on the system anyway?
If i can load a bunch of grfs, use OpenGFX and Run the Game on Fast Forward , doing 1 year in under a minute on my machine, a alright computer, I think it can handle more :p
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

petert wrote:Doesn't all the extra code that the patch adds cause tons of extra strains on the system anyway?
I'm trying to minimize this effect. If you experience noticable slowdowns please post a report, including a save game, here. A known problem is the smallmap's link stats view. When it's open the game slows down considerably. I don't quite know yet how to prevent that.
The guy on the picture is not me, it's Alonso.
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Cargo Distribution

Post by petert »

I haven't really played with CargoDist for a bit, I was hoping for an update. Also, small-map zoom in and small-map zoom out, do they have an all-in-one patch?
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

petert: http://fickzoo.com/fonsinchen/patches/current

Choose the "trunk-*" patches to apply on plain trunk (or the others to apply on top of each other which you probably don't want). Refer to http://fickzoo.com/fonsinchen/patches/c ... ERSION.txt to find out which trunk version they apply to. Check http://fickzoo.com/fonsinchen/patches/against_trunk if you need a different version. The smallmap zoom-in and zoom-out features are both present in http://fickzoo.com/fonsinchen/patches/c ... om-in.diff as smallmap-zoom-in pulls from smallmap-zoom-out (and from zoomlevels).

Of course you can also use my git repository at http://fickzoo.com/fonsinchen/openttd.git . All the patches are generated from this repository.
The guy on the picture is not me, it's Alonso.
zedd
Engineer
Engineer
Posts: 74
Joined: 13 Mar 2007 02:38

Re: Cargo Distribution

Post by zedd »

I am trying to apply this patch but TortosieMerge gives me nothing

I have checked out r17899 to a folder yeah. I right click the folder and select apply patch from the tortosie menu.
I select the diff file cargodist_r17899.diff and i just get a window with 3 blank boxes and can't save.

Please help.
User avatar
bigos
Traffic Manager
Traffic Manager
Posts: 181
Joined: 13 Sep 2009 21:15
Location: Poland
Contact:

Re: Cargo Distribution

Post by bigos »

zedd wrote:I am trying to apply this patch but TortosieMerge gives me nothing

I have checked out r17899 to a folder yeah. I right click the folder and select apply patch from the tortosie menu.
I select the diff file cargodist_r17899.diff and i just get a window with 3 blank boxes and can't save.

Please help.
Fonso is not using svn. So you need git or mercurial to apply his diffs. Maybe is other way to patch svn with it but not using TortoiseSVN.
jub
Engineer
Engineer
Posts: 67
Joined: 17 Jul 2003 13:46
Location: Sudice, Czech Republic
Contact:

Re: Cargo Distribution

Post by jub »

Download this http://gnuwin32.sourceforge.net/packages/patch.htm and follow instructions from sticky topic >howto apply a diff file<.
zedd
Engineer
Engineer
Posts: 74
Joined: 13 Mar 2007 02:38

Re: Cargo Distribution

Post by zedd »

I don't understand how to do that but I will take it to the how to apply patch tread instead.
zedd
Engineer
Engineer
Posts: 74
Joined: 13 Mar 2007 02:38

Re: Cargo Distribution

Post by zedd »

I really don't get that command line tool, and it returns nothing. Can someone help me make a binary for this maybe?
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Cargo Distribution

Post by petert »

fonso wrote:petert: http://fickzoo.com/fonsinchen/patches/current

Choose the "trunk-*" patches to apply on plain trunk (or the others to apply on top of each other which you probably don't want). Refer to http://fickzoo.com/fonsinchen/patches/c ... ERSION.txt to find out which trunk version they apply to. Check http://fickzoo.com/fonsinchen/patches/against_trunk if you need a different version. The smallmap zoom-in and zoom-out features are both present in http://fickzoo.com/fonsinchen/patches/c ... om-in.diff as smallmap-zoom-in pulls from smallmap-zoom-out (and from zoomlevels).

Of course you can also use my git repository at http://fickzoo.com/fonsinchen/openttd.git . All the patches are generated from this repository.
Yes, I know ALL that, but you hadn't updated them for a while.
Creat
Traffic Manager
Traffic Manager
Posts: 141
Joined: 26 Oct 2009 16:33

Re: Cargo Distribution

Post by Creat »

By the way, compiling for x64 in VS2008 gives the following warnings:

Code: Select all

warning C4267: '+=' : conversion from 'size_t' to 'uint16', possible loss of data	src\saveload\station_sl.cpp	218
warning C4267: '=' : conversion from 'size_t' to 'uint32', possible loss of data	src\saveload\station_sl.cpp	419
warning C4267: '=' : conversion from 'size_t' to 'uint16', possible loss of data	src\saveload\station_sl.cpp	421
warning C4267: 'return' : conversion from 'size_t' to 'uint', possible loss of data	src\linkgraph\linkgraph.h	139
warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data	src\saveload\linkgraph_sl.cpp	36
warning C4267: 'return' : conversion from 'size_t' to 'uint', possible loss of data	src\linkgraph\linkgraph.h	139
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Cargo Distribution

Post by petert »

Those warnings come for me too, just ignore them.
YoGz
Engineer
Engineer
Posts: 2
Joined: 27 Sep 2009 17:41

Re: Cargo Distribution

Post by YoGz »

Hi,

I was trying to apply the extra zoom levels patch, but when trying to patch I get a bunch of errors... I tried to change the diff file so it will be compatible with the cargodist code, but it was too technical for me... could it be included in the cargodist patch...

Thanks for the great work...

YoG.
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Cargo Distribution

Post by petert »

Sorry, but Extra Zoom Levels has nothing remotely to do with CargoDist, so I doubt it would be included. Possibly someone with some extra time on their hands can merge it for you.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 10 guests