Cargo Destinations.

Got a problem with TTDPatch? Get help here.

Moderator: TTDPatch Moderators

copperpen
Engineer
Engineer
Posts: 35
Joined: 24 Apr 2006 21:14

Cargo Destinations.

Post by copperpen »

Been trying this out with switches set as per instructions. :cry: I am unable to progress past 31 January from game start. I set up a simple game with one train hauling coal and 3 buses in one nearby town. All works well until the 28th day when all cargo deliveries start to generate multiple cash graphics and sounds as each segment of the load in offloaded. For instance, a bus with 15 passengers generates cash each time a group of 3 passengers gets off. Crashlogs attached.
Attachments
CargoDestCrashlogs.zip
(2.87 KiB) Downloaded 178 times
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: Cargo Destinations.

Post by Rubidium »

ISA I think you haven't seen JGR's latest work, e.g. http://www.tt-forums.net/viewtopic.php?p=821398#p821398
User avatar
ISA
Tycoon
Tycoon
Posts: 3384
Joined: 17 Oct 2005 20:56
Location: Estonia

Re: Cargo Destinations.

Post by ISA »

actually i have as my post is next from this post what you pointed out!
i dint think its in nightly yet :| it is? i havent updated my nightly build some time now
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Cargo Destinations.

Post by DaleStan »

ISA wrote:i dint think its in nightly yet :| it is? i havent updated my nightly build some time now
Consider maybe possibly taking five seconds to actually check, instead of making guesses.

Guesses have this nasty habit of being wrong, especially when JGR is around.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
ISA
Tycoon
Tycoon
Posts: 3384
Joined: 17 Oct 2005 20:56
Location: Estonia

Re: Cargo Destinations.

Post by ISA »

DaleStan wrote:
ISA wrote:i dint think its in nightly yet :| it is? i havent updated my nightly build some time now
Consider maybe possibly taking five seconds to actually check, instead of making guesses.

Guesses have this nasty habit of being wrong, especially when JGR is around.
Yes yes. I were wrong. Ill admit it. :oops:
User avatar
JGR
Tycoon
Tycoon
Posts: 2565
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: Cargo Destinations.

Post by JGR »

My apologies for this bug: stations' cargo routing tables don't appear to be initialised when starting a new game (only when loading an existing game with cargodest off).
Hence attempting to do the monthly route recalculation failed as the cargo routing tables didn't exist.
(Considering that, it is odd that the crash didn't happen before that).
(EDIT: I'm not sure about this actually, can you give details as to exactly how the new game was created (random, scenario, etc,))

You can (EDIT: maybe) temporarily circumvent it by loading an old game, or starting a new game with cargodest off and then loading it with cargodest on.

As for multiple profit texts/sounds. This is unfortunately (at this moment in time) a known issue/design decision. Trying to guess the profit at the start of the unloading process would lead to a lot of problems/be occasionally wrong, or require vehicles to exist in inconsistent states during the unload process. (Mostly because the user can send the vehicle away mid-way through load/unload process, or routing tables can change.)
The profit for each cargo packet is calculated separately, and the total profit for each load/unload step displayed as text.

This problem only exists when gradual loading is on though.


EDIT 2:
Can you post your ttdpatch.cfg
Do you remember if there were any oil rigs or any pre-existing stations when you started the game?
Ex TTDPatch Coder
Patch Pack, Github
copperpen
Engineer
Engineer
Posts: 35
Joined: 24 Apr 2006 21:14

Re: Cargo Destinations.

Post by copperpen »

The game was a random new start. It is how I always start because I like the unexpected rather than a preplanned scenario. The multiple unload with cash for each segment I can understand now it explained, although why it is not so at the atart of a game is still a mystery because gradual loading is on from the start, yet it takes some 20 days for the oddity to start showing.

Still, this addition to the patch is welcome here at least, and I hope it eventually works.

EDIT No rigs or stations in game when started, this was a new start in 1921
Attachments
ttdpatch.cfg
(7.44 KiB) Downloaded 161 times
User avatar
JGR
Tycoon
Tycoon
Posts: 2565
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: Cargo Destinations.

Post by JGR »

I think I've worked out what the bug is now...

It's an off-by-one/jbe-instead-of-jb error in the monthly route recalculation loop.
Runs from station ids 0-250 instead of 0-249. (ecx=0xFA in the crashlog)

250 is probably off the end of the array... :(

I'll probably add the station routing table initialisation on new game as well.

I'll boot up colinux and compile/test it a bit later (I need some breakfast now), and it'll be committed before the next nightly cut off...

Thanks for testing this copperpen.


As for the multiple cash messages only appearing after 20 days, that occurs only with routed cargo. Routed cargo is only produced after a route is "created". A route is created at the source when a vehicle which has left the source, arrives at the destination.
So it typically takes at least two trips after the source station is created (often 3) for routed cargo to start being unloaded at the other end.
Ex TTDPatch Coder
Patch Pack, Github
User avatar
JGR
Tycoon
Tycoon
Posts: 2565
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: Cargo Destinations.

Post by JGR »

Fixes for this and 5 other cargodest bugs plus some minor changes including one to the route dump view of the GUI will probably be available in the next nightly.
Ex TTDPatch Coder
Patch Pack, Github
copperpen
Engineer
Engineer
Posts: 35
Joined: 24 Apr 2006 21:14

Re: Cargo Destinations.

Post by copperpen »

Thanks for digging into this JGR, I will try it out after the next nightly appears. I suppose I can live with the multi Kerchings for a while. :D
User avatar
JGR
Tycoon
Tycoon
Posts: 2565
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: Cargo Destinations.

Post by JGR »

copperpen wrote:Thanks for digging into this JGR, I will try it out after the next nightly appears. I suppose I can live with the multi Kerchings for a while. :D
^^;
Maybe I need to be more clear, I've fixed the crash and some other bugs, but not the multiple kerchings (yet)
Ex TTDPatch Coder
Patch Pack, Github
copperpen
Engineer
Engineer
Posts: 35
Joined: 24 Apr 2006 21:14

Re: Cargo Destinations.

Post by copperpen »

Thanks for the fix JGR. I understand very well about the reason for the multi kerchings, not an urgent problem to fix. If I get fed up with them, I can always revert to an earlier nightly.

Now, what are the other switches supposed to do?
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1684
Joined: 04 Mar 2005 01:07

Re: Cargo Destinations.

Post by OzTrans »

I gave that cargo destination (passengers only) a bit of a go with an already fully established save game and TTDPatch r2236 [cdstcargoclassgentype is set to 2 for all cargo types, except passengers which is set to 0]. In that game passengers can travel from any station to any other station with all services providing transfer capabilities in one way or another. It does work quite nicely, but I hit a bit of a snag with forced unload orders. If a vehicle has a forced unload order (at a transfer terminal or a normal station that ordinarily would accept the cargo type), the vehicle will sit there in its unloading mode and do nothing, it remains stuck at that station. This happens for cargo types that are excluded from cargo destinations too.

And a few questions …

What are the 'Full' and 'Tree' tabs for ?
On the 'Destination' tab, could the transfer point, if applicable, be added; i.e. via Calgary Central.
The 'Destination' tab could list :
67 to Calgary Central
4 to Calgary Princes Park (via Calgary Central)

The sample below shows -4326 passengers unrouted; or there are only 930 waiting, but 5256 are routed. Any clues ?

Also, now that we are going to be paid by packets. The noise of the cash register is really deafening, especially with many services calling at stations at almost the same time. Would it be possible to only sound the till with the first payment or amalgamate all payments into one ?

FYI, attached below is the network map of 1938, although by 1964 (current year) a lot of local services have been added since ...
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1684
Joined: 04 Mar 2005 01:07

Re: Cargo Destinations.

Post by OzTrans »

... and the map ...
User avatar
JGR
Tycoon
Tycoon
Posts: 2565
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: Cargo Destinations.

Post by JGR »

Firstly thank you for testing...

As for forced unloading, I will have to look into that, (I haven't tested that area much, as I generally never use forced unload).

The full and tree tabs have not yet been implemented.
The full tab shows the amounts of cargo from from the original source to the final destination.
The tree tab effective shows the (possible) forward routing path(s) of cargo to the destination and is more or less your suggestion (but not only showing the first step).
(Shameless but nevertheless: http://wiki.openttd.org/Passenger_and_c ... #Full_View)

Negative unrouted cargo quantities is a sign of a bug. It's happened to me a fair few times, and I'd hoped I had eliminated all the bugs that caused it.
(Essentially if cargo is ever removed without moving the corresponding packets, the sum total of packets exceeds the amount of "cargo" in the station, this causes the unrouted cargo to be calculated as negative (it's a simple subtraction), the logic expects unsigned integers, and so it effectively means that cargo can subsequently be taken without regard for routing, as there is [2^32-cargo discrepancy] of unrouted cargo "available" out of the total cargo quantity, making the problem worse)...

(BTW is that station one with unload orders?)

As for multiple sound effects/text displays, I need to think of some better solution. In the meantime I can only suggest turning gradual loading off, or turning sound effects off.

(I still need to fix cargodest with fifo too, full load of routed cargos is largely broken still).

I hope to fix things soon, but lectures and everything start Monday, so I can't promise a quick turnaround time sadly...

Regards,
JGR
Ex TTDPatch Coder
Patch Pack, Github
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1684
Joined: 04 Mar 2005 01:07

Re: Cargo Destinations.

Post by OzTrans »

JGR wrote: … forced unloading, …
I believe, tactics and strategies, how to play a game with or without cargo destinations is different. I do use a lot of services using forced unloading. Firstly, there are those bulk cargo types (coal) that are collected from the various mine sites, then transported to a transfer terminal (cargo not ordinarily accepted here) for further distribution by more suitable services. With cargo destinations (CD), that may not be really necessary as CD should take care of that automatically.

Both the screenshots above have forced unload orders. The oil (ship) is transferred from sea to rail. CD would not be necessary here, as there is only one refinery. The trams, use forced unloading, because the passengers are collected in the suburbs, transported to the main station, where they are supposed to join inter-capital services. Now, those passengers would do that with CD anyway. I will remove those unload orders and also adjust those orders in general. They were geared to cater the way passengers are transported without CD.
… Negative unrouted cargo quantities is a sign of a bug. ...
Of course, my game is an established one and it may take a few years until things do run smoothly. I also had problems with full load orders; a train may sit there waiting for passengers for quite a while, as now passengers are loaded, not FIFO onto the first one, but depending on their destination onto multiple trains at the same time and there aren't enough passengers waiting to fill trains quickly enough.

Nevertheless, CD is another and excellent way to play the game; thanks for all your hard work and take your time. I should actually work on my projects, rather than playing ...
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1684
Joined: 04 Mar 2005 01:07

Re: Cargo Destinations.

Post by OzTrans »

JGR wrote: ... forced unloading and r2239 ...
Just and update ... whatever you did, it works now. Even finding routes via transfer stations that do not accept any cargo (something that didn't work with r2236). Great job.

Next, I'm going to change all those forced unload orders to see how well my network can cope. Let CD do the job ...
User avatar
JGR
Tycoon
Tycoon
Posts: 2565
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: Cargo Destinations.

Post by JGR »

Forced unload orders should have been fixed since r2238, so you may not need to change them, but you certainly can do...
Ex TTDPatch Coder
Patch Pack, Github
User avatar
AndersI
Tycoon
Tycoon
Posts: 1732
Joined: 19 Apr 2004 20:09
Location: Sweden
Contact:

Re: Cargo Destinations.

Post by AndersI »

@JGR: I'm testing TTDPC [1] on nightly r2241, in the switches.xml you have generated the following line:

Code: Select all

...
<range name="cdstcargoclassgentype" min="0" max="4194303" default="4194303" cmdline="" defstate="off"
 manpage="" desc="`%s' (%s) controls cargo generation for the cargodest switch for each cargo class.
 One digit per cargo class: 0 for the rightmost up to 10 for the leftmost. Digit value: 0: all cargo
 is by preferance routed, 1: all cargo is routed (or dropped at source), 2: all cargo is unrouted
 (old behaviour), 3: mix of routed and unrouted cargo generated. See:
 http://wiki.ttdpatch.net/tiki-index.php?page=Action0Cargos#Cargo_classes_16_ for list of cargo
 classes. Where a cargo is in multiple classes the bitwise OR of specified values is used.
 Range 0..33333333333. Default 33333333333."/>
...
and I have this line in ttdpatch.cfg:

Code: Select all

cdstcargoclassgentype 4194303
but get the following error message from TTDPATCHW:

Code: Select all

TTDPatch V2.6 alpha 0 r2241 (Windows) starting.
Warning: Unknown on/off state 4194303, set to off.
Press Escape to abort, or any other key to continue.
4194303 (decimal) is 3FFFFF (hex) which seems to match your '33333333333' assuming a quaternary number system, and if I enter

Code: Select all

cdstcargoclassgentype 33333333333
I get no error message.

It seems we are missing a data type in the XML specification? How can TTDPC know that this switch should be entered in quaternary?

---
[1] TTDPC is my TTDP Configuration program which reads switches.xml to find out what settings are available for any (reasonably new) version of TTDPatch, and what the allowed values are.
Post Reply

Return to “Problems with TTDPatch”

Who is online

Users browsing this forum: No registered users and 0 guests