News:

Want to praise Simutrans?
Your feedback is important for us ;D.

Bug - Excessive revenue at beginning of month

Started by fbfree, September 27, 2011, 01:30:13 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

fbfree

In the following savegame, http://simutrans-germany.com/files/upload/NA1842.sve

At the beginning of the next month, convoy 19 will earn an income of over $3000 when he should earn less than $20.  He seems to arrive at the station exactly at the beginning of the month.  This bug is reproducable, and has occured for both passengers and mail.

The revenue is earned for the month of November, but at the moment of earning the income, the charts for the convoy still show the October statistics, notably the one for distance.  These charts update for the new month shortly thereafter, but retain the high income.

This is using Experimental 10.1 linux x386 with pak-brit-exp 0.8

jamespetts

May I check - you are using the x386 version of the binary: are you also running a 32-bit version of Linux? I ask because running the 32-bit binary on a 64-bit version of Linux is known to cause problems.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

fbfree

Hi James,

I am using a 32-bit kernel on this machine.

I'm running Ubuntu 10.04 with
Linux 2.6.32-33-generic kernel for i686

fbfree

#3
It's a different effect than first thought:

It seem to be the first convoy to arrive at Faringford Parish Hall Stop after October 1 rather than the convoy arriving at the very beginning of the month that triggers the excess revenue.  In the two other times I had reproduced this bug, I had restarted the same game from January 1843, and every time, the first convoy arriving in October triggered the bug.

There's also two more symptoms:
1) Travel times seem to be distorted.  i.e. The endpoints of the line have shorter travel between them than to from them to intermediate stops.
2) Passengers are being routed 'via' an intermediate stop.

sdog

#4
I had excessively high income too, with 64 bit binary on 64 bit linux. (10.x branch). I have only seen the bug so far in the income graph, so i can't give a good description of it occuring.

EDIT:
In this savegame line 42, engine 62 arriving during the first 10 minutes of October at Brentchester Terminus shall provide 450k revenue.
savegame requires 10.1 experimental with version 8.1 of the pak.


Delaying the arrival of the engine a little reduces the revenue hike.
6:30  400k
17m 100k
1h 60k (it even stopped at a different station the same month)
short-turning the convoy, this means setting it to reverse route one stop before the terminus only delayed the extreme profit. When it arrived at Brentchester Terminus the next month it received 50k

jamespetts

I have eventually tracked down this issue - thank you for the report. This was caused by an integer overflow in the average journey times code. This is fixed on 10.x. I should be grateful if anyone who can compile the code could test this. Also - can people check to see whether the fix adversely affects performance or memory consumption to a significant degree?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

wlindley

October 5th snapshot seems almost identical in performance and memory to the 24 September version on my system (64-bit Fedora).  I had also seen this bug with the 24 Sept.; have not seen it with the latest.

dustNbone

I can confirm that this was present in 10.0 and absent in 10.2, savegame from affected version loaded by unaffected version seems to produce excess revenue initially, and then taper to normal within a year of game time.

jamespetts

Excellent - glad that it works! The excess revenue initially on loading saved games from earlier versions is to be expected, as the earlier incorrect values will be loaded.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.