Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Fri May 24, 2019 12:06 am

All times are UTC




Post new topic  Reply to topic  [ 3079 posts ]  Go to page Previous 1149 150 151 152 153 154 Next
Author Message
 Post subject: Re: Cargo Distribution
PostPosted: Wed Jul 09, 2014 9:25 pm 
Offline
Moderator
Moderator
User avatar

Joined: Mon Sep 28, 2009 5:15 pm
Posts: 6577
Location: Eastern KY
That "some reason" is because most people prefer to get from A->B directly without any stopovers, and thus is a premium that they will pay for. Airlines give a discount on A->B->C because it helps them fill capacity and operate more efficiently and it appeals to individuals who value money over time.

_________________
Do you like drones, quadcopters & flying toys? Check out Drone Strike Force!
Image

Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | RoadTypes?


Top
   
 Post subject: Re: Cargo Distribution
PostPosted: Thu Jul 10, 2014 4:11 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Jan 18, 2014 6:10 pm
Posts: 1161
Alberth wrote:
How would you detect such a cargo? Note that cargo itself has no "this is primary" property. You only know industries, and what it accepts and produces.
Bulk class can be such (roughly approximated) criterium, however even in case of primary cargo, cargodist itself sometimes is useful, sometimes not.

For example, consider following chain:
Code:
S1 ---> R1 <--- S2 ---> R2 <--- S3 

Cargodist will send some freight from S1 trough R1 and S2 to R2, and the same with S3 to R1.
It is not bad, because your vehicles have no empty runs. And load time at S2 is low.
OK, I want to enable cargodist even for bulk/primary cargos.

But consider same topology located not linear:
Code:
R1  <-- S2 
^         |
|         |
|        R2 <-- S3
S1

and now S1-R1 link is used for wastage S1-R2 cargo instead of profitable S1-R1 and S2-R2 ones.
It is a reason, why players on my server requested to switch freight cargodist off.

Rubidium wrote:
I fairly regularly see odd routes for airplane trips that are way longer than necessary.

But those discounts are intentionally provided by airlines operators - as Kamnet mentioned, it is to avoid empty links.
You cannot buy cheap A1-B-A2 ticket if A1-B link is already saturated.
In case of openttd, fares are fixed, and cargodist make totally opposite thing -
it assign unprofitable A1-B-A2 instead of profitable A1-B.
The real company would bankrupt within a days with such fares policy.

I understand, that cargodist authors are willing to force players to make optimal transport grid,
but such feature described above seems to be to much harassment, especially for on-line players -
there is no opportunity to pull-down, and analyse every cargo at each station.

My compromise proposition is as follows:
lets keep demands calculation as it was before, but give load priority for links which direct distance to hop distance ratio is higher.
(it can be soft priority - just decrease amount of "unwanted" cargo loaded proportional to distance ratio).
If you have spare place in your vehicles, those "unwanted" cargos would be transporter either.
If all loading space is filled up by cargo travelling straightforward, roundabout cargo would pile up at station.
I think it is clear information for player, that his network is suboptimal, without stealthy abusing his resources.

_________________
My experimental openTTD server: 149.156.194.203:3979 non-standard client, now testing: JGRPP http://tiny.pl/ggnch
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, preindustrial houses, wired, ECS industry extension, V4 CEE train set.
Addicted to freeciv longturn.


Top
   
 Post subject: Re: Cargo Distribution
PostPosted: Thu Jul 10, 2014 4:16 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Sun Sep 09, 2007 5:03 am
Posts: 4713
Location: home
McZapkie wrote:
But consider same topology located not linear:
Code:
R1  <-- S2 
^         |
|         |
|        R2 <-- S3
S1

and now S1-R1 link is used for wastage S1-R2 cargo instead of profitable S1-R1 and S2-R2 ones.
It is a reason, why players on my server requested to switch freight cargodist off.
Just set the order of S2->R1 to "no loading" at R1. Problem solved?


Top
   
 Post subject: Re: Cargo Distribution
PostPosted: Thu Jul 10, 2014 6:16 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Jan 18, 2014 6:10 pm
Posts: 1161
Alberth wrote:
Just set the order of S2->R1 to "no loading" at R1. Problem solved?

If player is aware about such problem, it can help to solve.
But I am talking about general improvement of cargo distribution algorithm - which is faulty by now - if manual intervention is needed to avoid absurd routes.

_________________
My experimental openTTD server: 149.156.194.203:3979 non-standard client, now testing: JGRPP http://tiny.pl/ggnch
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, preindustrial houses, wired, ECS industry extension, V4 CEE train set.
Addicted to freeciv longturn.


Top
   
 Post subject: Re: Cargo Distribution
PostPosted: Thu Jul 10, 2014 6:37 pm 
Offline
President
President
User avatar

Joined: Sat Oct 13, 2007 8:28 am
Posts: 945
I don't really think this discussion is going anywhere like this. I'm not implementing any heuristic to "automatically" determine which routes should be considered "sane" or which cargoes should be considered "safe" for cargodist. If anyone wants to do that, go ahead, but make a new thread for that.

One thing I can imagine is more options to set distribution types for cargoes. I think we have successfully determined that having newGRFs set distribution types isn't going anywhere either, which significantly simplifies the debate. So, if you look at cargotype.h you'll find this:

Code:
enum CargoClass {
   CC_NOAVAILABLE  = 0,       ///< No cargo class has been specified
   CC_PASSENGERS   = 1 <<  0, ///< Passengers
   CC_MAIL         = 1 <<  1, ///< Mail
   CC_EXPRESS      = 1 <<  2, ///< Express cargo (Goods, Food, Candy, but also possible for passengers)
   CC_ARMOURED     = 1 <<  3, ///< Armoured cargo (Valuables, Gold, Diamonds)
   CC_BULK         = 1 <<  4, ///< Bulk cargo (Coal, Grain etc., Ores, Fruit)
   CC_PIECE_GOODS  = 1 <<  5, ///< Piece goods (Livestock, Wood, Steel, Paper)
   CC_LIQUID       = 1 <<  6, ///< Liquids (Oil, Water, Rubber)
   CC_REFRIGERATED = 1 <<  7, ///< Refrigerated cargo (Food, Fruit)
   CC_HAZARDOUS    = 1 <<  8, ///< Hazardous cargo (Nuclear Fuel, Explosives, etc.)
   CC_COVERED      = 1 <<  9, ///< Covered/Sheltered Freight (Transportation in Box Vans, Silo Wagons, etc.)
   CC_SPECIAL      = 1 << 15, ///< Special bit used for livery refit tricks instead of normal cargoes.
};


Right now we have special distribution types for CC_PASSENGERS, CC_MAIL and CC_ARMOURED. Everything else is handled by "default distribution type". Now, depending if we want to handle CC_NOAVAILABLE, those are 10 or 11 cargo classes with actual meaning. I can very well imagine having 11 instead of 4 options for defining distribution types and then just be done with it. However, I'll be gone for 4 weeks from saturday. Don't expect any code from me in the near future and feel free to implement that yourself. It should be pretty straight forward.

_________________
The guy on the picture is not me, it's Alonso.


Top
   
 Post subject: Re: Cargo Distribution
PostPosted: Thu Jul 10, 2014 10:53 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Thu Jul 16, 2009 10:04 am
Posts: 321
fonso wrote:
However, I'll be gone for 4 weeks from saturday.


I wish you nice travel/holidays. :D

And thank you, once more, for this great piece of code you added to OTTD.

_________________
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.


Top
   
 Post subject: Re: Cargo Distribution
PostPosted: Fri Jul 11, 2014 7:31 pm 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7350
there are a number of problems with using cargo classes.
  • first: a cargo class is no guarantee for a uniform group of cargos. like i probably need a different type of distribution (e.g. weight allocation, or handling of unconnected destinations) for fertilizer (more like goods or supplies) than for coal or ore, yet all of those are in "bulk"
  • second: a cargo can have more than one class, how is the behaviour defined if the settings for the classes differ? majority rule? on overrides off? off overrides on? the lower class takes precedence?
  • third: even though the values 10 to 14 are unused in the code, there is no guarantee that NewGRFs won't use them.

all in all, i think overloading cargo classes (which are meant for determining which vehicle can load something, nothing else) with cargodist stuff is questionable...

_________________
You might not exactly be interested in Ferion, but if you are, have fun :)


Top
   
 Post subject: Re: Cargo Distribution
PostPosted: Sat Jul 12, 2014 9:34 am 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Thu Jul 19, 2012 6:04 pm
Posts: 327
Location: The Elizabeth Arkham Asylum for the Criminally Insane
Two easy questions. Only recently started with cargodist.

1) I set up a road network servicing a few stops included is a stop that's linked to the airport, on theis line I've noticed that every now and then, that certain busses will get a "tranfer=R12000/cost=R5600" (an example) . Read a bit, but not sure whyme is paying for a delivery.

2) Playing without cargodist I get about 3-4 subsidy offers yearsly, yet with cargodist After 20 game years still hven't had one , any idea why?

_________________
Me
My Screenshots


Top
   
 Post subject: Re: Cargo Distribution
PostPosted: Sat Jul 12, 2014 9:44 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9266
Location: Sol d
ad 1) you get paid, but the final payment is more than what was 'given' to the other vehicles which helped get the cargo to its destination. Thus the income for the last vehicle is negative. See also https://wiki.openttd.org/Negative_incom ... er_service

ad 2) Subsidies don't work with cargodist. You won't get any.

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
   
 Post subject: Re: Cargo Distribution
PostPosted: Mon Jul 14, 2014 12:45 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Jan 18, 2014 6:10 pm
Posts: 1161
fonso wrote:
One thing I can imagine is more options to set distribution types for cargoes. I think we have successfully determined that having newGRFs set distribution types isn't going anywhere either, which significantly simplifies the debate.
I agree with Eddi, that using these cargo classes to determine cargodist action can be questionable,
for example FIRS petrol and refined products are bulk, as crude oil, but since there is usually no reasons to use cargodist for oil (and other "primary" resources), secondary (refined products) and especially final (petrol) needs to be distributed to many places.

Instead of cargo classes, is it possible to use life_type flag of cargo origin to choose cargodist distribution type?
Code:
enum IndustryLifeType {
   INDUSTRYLIFE_BLACK_HOLE =      0, ///< Like power plants and banks
   INDUSTRYLIFE_EXTRACTIVE = 1 << 0, ///< Like mines
   INDUSTRYLIFE_ORGANIC    = 1 << 1, ///< Like forests, farms
   INDUSTRYLIFE_PROCESSING = 1 << 2, ///< Like factories
};
 


fonso wrote:
I'm not implementing any heuristic to "automatically" determine which routes should be considered "sane" or which cargoes should be considered "safe" for cargodist.
There is no need for any AI, but currently there is demand_distance parameter, which define how amount of allocated cargo depend on distance between origin and recipient.
The bad feature, in my opinion, is to use direct distance,
instead of sum of all hops between origin and source.
Is it possible to fix, or huge workload for code rewriting is needed?

_________________
My experimental openTTD server: 149.156.194.203:3979 non-standard client, now testing: JGRPP http://tiny.pl/ggnch
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, preindustrial houses, wired, ECS industry extension, V4 CEE train set.
Addicted to freeciv longturn.


Top
   
 Post subject: Re: Cargo Distribution
PostPosted: Mon Jul 14, 2014 12:52 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9266
Location: Sol d
McZapkie wrote:
Instead of cargo classes, is it possible to use life_type flag of cargo origin to choose cargodist distribution type?
[code]enum IndustryLifeType {
INDUSTRYLIFE_BLACK_HOLE = 0, ///< Like power plants and banks
INDUSTRYLIFE_EXTRACTIVE = 1 << 0, ///< Like mines
INDUSTRYLIFE_ORGANIC = 1 << 1, ///< Like forests, farms
INDUSTRYLIFE_PROCESSING = 1 << 2, ///< Like factories
};


No. For one, the type of industry a cargo originates from is not stored with cargo, thus not available. But worse, and that kills the suggestion: same cargo can be produced by different industries, e.g. from black hole, extractive, organic and processing industries (e.g. think of 'waste' cargo). What type would you attach to it? This is an at least equally bad abuse of an existing game concept than abusing cargo classes for that purpose.

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
   
 Post subject: Re: Cargo Distribution
PostPosted: Fri Sep 05, 2014 2:50 am 
Offline
Engineer
Engineer

Joined: Tue Jul 05, 2011 12:57 am
Posts: 31
Location: Sakai, Japan
Forgive me if I missed this - I've been away from OpenTTD for a year or so, and I couldn't find the right information when searching - but has CargoDist been included in the standard OpenTTD now? And if so, how do you activate it? I downloaded the latest version of OpenTTD, but after starting a test game with a train line and a few buses, the passengers don't seem to be distributed to certain destinations. I remember there used to be a feature in the station window that shows you exactly where passengers are going, and even passengers that don't have a specific destination.


Top
   
 Post subject: Re: Cargo Distribution
PostPosted: Fri Sep 05, 2014 3:00 am 
Offline
Traffic Manager
Traffic Manager

Joined: Thu Apr 15, 2010 9:01 pm
Posts: 211
Location: Midwest, US
You need to enable it in Advanced Settings -> Cargo Distribution menu. Switch the Passengers and/or Mail to either symmetric or asymmetric, and you will get CargoDist to work. If all cargo groups are set to manual, CargoDist is off.


Top
   
 Post subject: Re: Cargo Distribution
PostPosted: Fri Sep 05, 2014 5:25 am 
Offline
Engineer
Engineer

Joined: Tue Jul 05, 2011 12:57 am
Posts: 31
Location: Sakai, Japan
@aantono - Excellent. Thank you very much!


Top
   
 Post subject: Re: Cargo Distribution
PostPosted: Tue Sep 09, 2014 3:25 am 
Offline
Engineer
Engineer

Joined: Wed Aug 18, 2004 3:02 pm
Posts: 41
@aantono thanks a lot to you too, I am also away from OpenTTD for 2-3yrs because of lacking of cargodist and instead go for Simutrans.

Now actually its patched into the game...I can now go back to OpenTTD

THANKS :)


Top
   
 Post subject: Re: Cargo Distribution
PostPosted: Tue Sep 09, 2014 3:27 am 
Offline
Traffic Manager
Traffic Manager

Joined: Thu Apr 15, 2010 9:01 pm
Posts: 211
Location: Midwest, US
You are most welcome, though the real THANKS should go to @fonso, who dedicated a lot of time to get it polished to the point of perfection and being accepted into the trunk!


Top
   
 Post subject: Re: Cargo Distribution
PostPosted: Tue Sep 09, 2014 5:54 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Mar 31, 2007 2:23 pm
Posts: 4853
Location: Lost in Music
McZapkie wrote:
for example FIRS petrol and refined products are bulk, as crude oil

Eh? Are you smoking crack and forgot to invite me? I feel left out :(

http://dev.openttdcoop.org/projects/fir ... /petrol.py

(Those cargos are liquid, nowhere near bulk class) ;)

_________________
FIRS Industry Replacement Set (Released) | HEQS Heavy Equipment Set (trucks, industrial trams and more) (Finished)
Squid Ate FISH (ships) (Released) | CHIPS Has Improved Players' Stations (Finished)
Iron Horse (trains, released) | Termite (tracks for Iron Horse, released) | Busy Bee (game script, released)

Road Hog (road vehicles, released)


Top
   
 Post subject: Re: Cargo Distribution
PostPosted: Tue Sep 09, 2014 8:50 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Jan 18, 2014 6:10 pm
Posts: 1161
andythenorth wrote:
(Those cargos are liquid, nowhere near bulk class) ;)

Indeed. Note to myself: don't drink and write.


Top
   
 Post subject: Re: Cargo Distribution
PostPosted: Tue Sep 09, 2014 1:54 pm 
Offline
President
President
User avatar

Joined: Sat Oct 13, 2007 8:28 am
Posts: 945
And if you drink, don't drink bulk but rather liquid.

_________________
The guy on the picture is not me, it's Alonso.


Top
   
PostPosted: Sat Sep 27, 2014 5:42 am 
Offline
Engineer
Engineer

Joined: Sat Sep 27, 2014 5:16 am
Posts: 61
Location: Calgary, Canada
JGR wrote:
I recently ran into an interesting problem (for reference using Chill's Patchpack (hca7f5804)).
Rather than using direct point to point links for all freight, I decided to try using a bus type topology, using a single train line, onto which feeder services shuttle cargo in either direction from various nodes along the line. In particular, some cargoes fed onto the train line are not directly accepted at any rail stations. As I'm currently near the start of an ECS game, the number of cargoes and the distances between (some) industries is relatively high, but the quantity of cargo to transport is relatively small. So I'm using (at present) a single freight train (with wagons of the various cargoes) to service the line (the line is also used for passengers).
This works quite well with routed cargo, the snag arises when any unrouted freight is generated.
Whilst it is easy to move such cargo onto the rail line (using transfer & leave empty orders), getting it off the line at the correct station is more difficult, as there is not a mechanism for cargo-specific transfer orders. The cargo then just sits on the train indefinitely and effective blocks the line.
I realise that I could just use one train per cargo or one train per exit node, but this is not really ideal, and soon becomes overly expensive (given how many cargoes ECS has). That however would not work well either in the event that a cargo becomes transferable via more than one node along the line.

I've not been able to come up with a genuinely elegant solution, with the possible exception of just disabling unrouted cargo entirely, however this would have other fairly nasty implications.

Any bright ideas? Have others had any luck with this sort of layout?

Code:
       Λ                         Λ                         Λ
       |                         |                         |
       V                         V                         V
<=================================================================================>
                 Λ                         Λ                         Λ
                 |                         |                         |
                 V                         V                         V

(As an additional disclaimer, I've not previously used ECS before, or really attempted to implement the associated type of distributed freight network using cargodist/cargodest/etc.)


Apologies if I am resurrecting an old thread but I am having the same issue as this poster and I didn't see any reply so I am curious as to how to solve this problem. I have two factories a distance apart. Trucks collect goods produced and drop them off at exchange sidings for each factory. A train will collect the goods from exchange sidings A transport them to exchange sidings B, unload and then load the goods destined back to exchange sidings A. The trucks mentioned above also make run back to a city with goods on board before returning to the factory.

It is a similar system as mentioned in the quote and it worked great until the cargo stopped having a destination all of a sudden and was available to any station. The trains then load but are not unloading cargo, as suggested above, effectively blocking the rail line and cargodist can't recalculate the route because the train is full. I did read on another thread that this also happens because the service is too infrequent. I believe this was the answer... viewtopic.php?f=33&t=41992&start=2840 (about halfway down)

fonso wrote:
I don't think this has anything to do with the dates. It's probably just the normal effect of creating and dropping links. If a link between two stations is visited too infrequently it's dropped, sending all people waiting for it "to any station". Those people are then picked up by other vehicles and slowly get transported away. I have another patch that prevents dropping of links for which there still are orders, even if the vehicles are visiting those links very infrequently. I haven't gotten around to committing it, yet.


This also sounds like my issue but its a bit of a catch 22 as the 'any station' goods don't go anywhere so there is no recalculation. You mention a patch that stops the links from ever being dropped. Has any progress been made on this?

I don't use any patches, and use the latest stable release of 1.4.3. I have a handful of newgrfs that I use too and can provide a list if needs be.

I just wanted to say that cargodist is an outstanding development and truly takes the game to a whole new level. It's the best thing since path based signals. Thank you for the effort of bringing forward such a professional and complex implementation :bow:


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3079 posts ]  Go to page Previous 1149 150 151 152 153 154 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2019 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2019.
Hosted by Zernebok Hosting.