Cargo payments problem

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
User avatar
George
Tycoon
Tycoon
Posts: 4362
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Cargo payments problem

Post by George »

Strange. My train passes about 160 squares in about 100 days with 9 wagons with 30 tones of wood. 8 (160/2) * 9 (wagons) * 3 (30 tons=3*10 units of cargo) *104 pounds (100 days) is more than 22 thousands pounds. But I get less, than 5 thousands.Why?
fabca2
Transport Coordinator
Transport Coordinator
Posts: 312
Joined: 14 Apr 2004 15:18
Location: Fr

Post by fabca2 »

By the way, here is a question I have from long time :
for computing the distance, does it take real distance (flight distance)
or does it take the number of tiles on the way taken by train ?
User avatar
Dan
Route Supervisor
Route Supervisor
Posts: 472
Joined: 11 Oct 2003 19:26
Location: Georgia, U.S.A.

Post by Dan »

George:The game also considers the time taken to load the cargo aswell.

fabca2:It takes the direct distance between the source and destination or flight distance as you called it.
╔═════════════════╗
║░ГЯΔИ$PØЯГ Г¥¢ØØИ!░║
║▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║
║▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓║
║▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║
║░░░░░░░░░░░░░░░░░║
╚═════════════════╝
User avatar
George
Tycoon
Tycoon
Posts: 4362
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Post by George »

Dan wrote:George:The game also considers the time taken to load the cargo aswell.
I know. But even if we shall count the value of 78 (200 days, which is much more, than a trains way and waiting), I should get over 15 thousands, that is at least 3 times more, than I get.
User avatar
Dan
Route Supervisor
Route Supervisor
Posts: 472
Joined: 11 Oct 2003 19:26
Location: Georgia, U.S.A.

Post by Dan »

I looked over your problem more carefully and got 4450 pounds as your payment. the formula was: (distance/days)*(amount of cargo)*(price per ton) or in your case (160/100)*270*104=4449.6 or 4450 pounds. You were just useing the wrong formula to calculate your payment.
╔═════════════════╗
║░ГЯΔИ$PØЯГ Г¥¢ØØИ!░║
║▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║
║▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓║
║▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║
║░░░░░░░░░░░░░░░░░║
╚═════════════════╝
User avatar
George
Tycoon
Tycoon
Posts: 4362
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Post by George »

Dan wrote:I looked over your problem more carefully and got 4450 pounds as your payment. the formula was: (distance/days)*(amount of cargo)*(price per ton) or in your case (160/100)*270*104=4449.6 or 4450 pounds. You were just useing the wrong formula to calculate your payment.
Look the cargo payment graph. It says that the payment is for delivering 10 units of cargo at a distance of 20 squares. That means that when I deliver the cargo at a distance of 160 squares, I get 8 times more. When I deliver 270 tons, that means I’m paid 27 times more. So, it means not I calculate it wrong, but the oTTD does. Please fix it.
And you know, why is your calculation wrong? Because you are using the number of days in transit in your formula twice! first, as a number 100, second - in the payment value.
The formula has to be (distance/20)*(amount of cargo/10)*price_per_10_units(days), where price is a function.
User avatar
dominik81
OpenTTD Developer
OpenTTD Developer
Posts: 768
Joined: 16 Aug 2003 12:55
Location: Bonn, Germany

Post by dominik81 »

Do you have this bug only on long distances? I Because I just tested it on a shorter line (24 squares) and it was measured correctly. Please file a bug report at Sourceforge and add a savegame if possible.
User avatar
George
Tycoon
Tycoon
Posts: 4362
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Post by George »

dominik81 wrote:Do you have this bug only on long distances? I Because I just tested it on a shorter line (24 squares) and it was measured correctly. Please file a bug report at Sourceforge and add a savegame if possible.
Did I do it right?
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

George wrote:
dominik81 wrote:Do you have this bug only on long distances? I Because I just tested it on a shorter line (24 squares) and it was measured correctly. Please file a bug report at Sourceforge and add a savegame if possible.
Did I do it right?
yes, but you don't have to stuff the savegame since OTTD stuff them. The rar file is 93 bytes LARGER than the savegame. You don't have to redo it now
User avatar
Dan
Route Supervisor
Route Supervisor
Posts: 472
Joined: 11 Oct 2003 19:26
Location: Georgia, U.S.A.

Post by Dan »

George wrote:
Dan wrote:I looked over your problem more carefully and got 4450 pounds as your payment. the formula was: (distance/days)*(amount of cargo)*(price per ton) or in your case (160/100)*270*104=4449.6 or 4450 pounds. You were just useing the wrong formula to calculate your payment.
Look the cargo payment graph. It says that the payment is for delivering 10 units of cargo at a distance of 20 squares. That means that when I deliver the cargo at a distance of 160 squares, I get 8 times more. When I deliver 270 tons, that means I’m paid 27 times more. So, it means not I calculate it wrong, but the oTTD does. Please fix it.
And you know, why is your calculation wrong? Because you are using the number of days in transit in your formula twice! first, as a number 100, second - in the payment value.
The formula has to be (distance/20)*(amount of cargo/10)*price_per_10_units(days), where price is a function.
Ok i see now, it was not the formula just the game had a malfunction.
╔═════════════════╗
║░ГЯΔИ$PØЯГ Г¥¢ØØИ!░║
║▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║
║▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓║
║▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║
║░░░░░░░░░░░░░░░░░║
╚═════════════════╝
User avatar
dominik81
OpenTTD Developer
OpenTTD Developer
Posts: 768
Joined: 16 Aug 2003 12:55
Location: Bonn, Germany

Post by dominik81 »

The problem has been tracked down and is fixed (at least with patch 939162). Due to multiheaded engies the "days in transit" for cargo where counted twice for the second vehicle, three times for the third vehicle, and so on. Long trains therefore had a very high average amount of days in transit. Thanks for the bug report. :D
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 13 guests