Sudden negative cargo payment rates
Moderator: OpenTTD Developers
-
- Engineer
- Posts: 7
- Joined: 07 Jan 2010 16:33
Sudden negative cargo payment rates
I am having a strange problem with my current OpenTTD game. My economy is set to stable but over the past few years of gameplay, my cargo payment rates have begun to fluctuate wildly. They have now reached the point where several key cargoes have become worthless to transport.
I have never encountered this problem before - I have played further on from the stage shown on the screenshot and it reaches a point where the payment rate for passengers becomes negative although the rate for coal becomes positive again. Effectively, I end up having to shut 90% of my network because of this issue.
Anybody have any ideas as to what is going on? I didn't even know that dynamic cargo rates were a feature of OpenTTD.
I have never encountered this problem before - I have played further on from the stage shown on the screenshot and it reaches a point where the payment rate for passengers becomes negative although the rate for coal becomes positive again. Effectively, I end up having to shut 90% of my network because of this issue.
Anybody have any ideas as to what is going on? I didn't even know that dynamic cargo rates were a feature of OpenTTD.
- Attachments
-
- Gordon & Co., 3rd Jan 2003.png
- (128.08 KiB) Downloaded 4 times
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Sudden negative cargo payment rates
Do you have a savegame for us?
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
Re: Sudden negative cargo payment rates
Inflation has probably something to do with that.planetmaker wrote:Do you have a savegame for us?
-
- Engineer
- Posts: 7
- Joined: 07 Jan 2010 16:33
Re: Sudden negative cargo payment rates
Here is the saved file. I hope you can work out what's going on.
- Attachments
-
- Gordon & Co., 3rd Jan 2003.sav
- (467.49 KiB) Downloaded 98 times
-
- Tycoon
- Posts: 2781
- Joined: 22 Feb 2011 18:34
Re: Sudden negative cargo payment rates
Given the sudden decline in operating profit and the upside down curves in the cargo payments rate (longer deliveries should mean lower profits, not lower losses), I think there is something else going on.Wold wrote:Inflation has probably something to do with that.planetmaker wrote:Do you have a savegame for us?
I can't load the savegame because I miss the rusrailw(1).grf.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
-
- Engineer
- Posts: 7
- Joined: 07 Jan 2010 16:33
Re: Sudden negative cargo payment rates
Sent you a PM with the missing file.Transportman wrote:Given the sudden decline in operating profit and the upside down curves in the cargo payments rate (longer deliveries should mean lower profits, not lower losses), I think there is something else going on.Wold wrote:Inflation has probably something to do with that.planetmaker wrote:Do you have a savegame for us?
I can't load the savegame because I miss the rusrailw(1).grf.
-
- Tycoon
- Posts: 2781
- Joined: 22 Feb 2011 18:34
Re: Sudden negative cargo payment rates
I have loaded your game and fastforwarded a couple of years, and noticed something strange in the Cargo Payments rate graphs. They go up like very fast, but when the 10 day delivery value hits something like €100,000k it changes to the negative side, to rise back up again.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
-
- Engineer
- Posts: 7
- Joined: 07 Jan 2010 16:33
Re: Sudden negative cargo payment rates
It sounds like a bug somewhere, especially as I am using the default industries etc. The only newgrfs I have are for vehicles and stations.Transportman wrote:I have loaded your game and fastforwarded a couple of years, and noticed something strange in the Cargo Payments rate graphs. They go up like very fast, but when the 10 day delivery value hits something like €100,000k it changes to the negative side, to rise back up again.
Re: Sudden negative cargo payment rates
Well I don't know the insides of the game but I guess due to inflation the price overflows ( int32 - 2,147,483,647 ) and starts from -2,147,483,648 again. If you can attach rusrail(1).grf it would be great. A short term fix could be for the prices to be a signed int..
-
- Engineer
- Posts: 7
- Joined: 07 Jan 2010 16:33
Re: Sudden negative cargo payment rates
Here is the newgrf file which is needed to load my savegame.
- Attachments
-
- rusrailw (1).grf
- (620.38 KiB) Downloaded 101 times
Re: Sudden negative cargo payment rates
I'm not quite sure what exactly you are proposing. An int32 is a signed int.Wold wrote:Well I don't know the insides of the game but I guess due to inflation the price overflows ( int32 - 2,147,483,647 ) and starts from -2,147,483,648 again. If you can attach rusrail(1).grf it would be great. A short term fix could be for the prices to be a signed int..
Re: Sudden negative cargo payment rates
Probably a typo for unsigned int. That would make more sense...
Temporary Permanent signature filling text. Content coming soon delayed indefinitely! Oh, and I have had a screenshot thread.
Linux user (XMonad DWM/KDE, Arch), IRC obsessive and rail enthusiast. No longer building robots; now I ring church bells.
Author of an incredibly boring stickied post about NewGRFs.
Linux user (XMonad DWM/KDE, Arch), IRC obsessive and rail enthusiast. No longer building robots; now I ring church bells.
Author of an incredibly boring stickied post about NewGRFs.
Re: Sudden negative cargo payment rates
internally, all places which handle prices should be "overflow-safe int64" (aka "Money"). the bug you see here is likely an oversight and should be trivial to solve, once the exact location where it goes wrong is found.
and "unsigned int" makes pretty much no sense...
and "unsigned int" makes pretty much no sense...
Who is online
Users browsing this forum: No registered users and 6 guests