The International Simutrans Forum

 

Author Topic: [Bug v4.5] An Easy Way to Become a Billionnaire ^_^  (Read 4446 times)

0 Members and 1 Guest are viewing this topic.

knightly

  • Guest
[Bug v4.5] An Easy Way to Become a Billionnaire ^_^
« on: July 05, 2009, 08:52:13 AM »
Colin has spotted a bug : if you try to add or remove electrification, you will find that your money increases drastically.

« Last Edit: July 05, 2009, 03:20:24 PM by Knightly »

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18763
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [Bug v4.5] A Easy Way to Become a Billionnaire ^_^
« Reply #1 on: July 05, 2009, 09:58:10 AM »
Thank you for the report - problem found and will be fixed in the next version :-)

Offline Nathan Samson

  • *
  • Posts: 89
Re: [Bug v4.5] A Easy Way to Become a Billionnaire ^_^
« Reply #2 on: July 05, 2009, 10:28:47 AM »
WTF, this has been a problem in simutrans-standard a long time ago... and it was not in the 4.4 version...

Why is this problem always comping back...

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18763
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [Bug v4.5] A Easy Way to Become a Billionnaire ^_^
« Reply #3 on: July 05, 2009, 11:12:23 AM »
Because the base values for the price of the way object is an unsigned integer. If that is used in the accounting without casting, where a - is used, it overflows and becomes a very high number. The fix is to cast it to a signed integer somewhere, but, if the code is changed around, somebody might well forget to cast it back again.

Offline Nathan Samson

  • *
  • Posts: 89
Re: [Bug v4.5] A Easy Way to Become a Billionnaire ^_^
« Reply #4 on: July 05, 2009, 11:56:43 AM »
Because the base values for the price of the way object is an unsigned integer. If that is used in the accounting without casting, where a - is used, it overflows and becomes a very high number. The fix is to cast it to a signed integer somewhere, but, if the code is changed around, somebody might well forget to cast it back again.

That explains it

Offline Colin

  • Devotees (Inactive)
  • *
  • Posts: 663
  • Certa Cito
Re: [Bug v4.5] An Easy Way to Become a Billionnaire ^_^
« Reply #5 on: July 05, 2009, 04:44:07 PM »
That explains it
WTF, this has been a problem in simutrans-standard a long time ago... and it was not in the 4.4 version...

Why is this problem always coming back...

This post by Nathan is strange to me because, the many years that I have been playing Simutrans this is the first time I have come across this particular phenomenon. I must have missed a version somewhere down the track.

Offline Nathan Samson

  • *
  • Posts: 89
Re: [Bug v4.5] An Easy Way to Become a Billionnaire ^_^
« Reply #6 on: July 05, 2009, 09:25:45 PM »
This post by Nathan is strange to me because, the many years that I have been playing Simutrans this is the first time I have come across this particular phenomenon. I must have missed a version somewhere down the track.

I think I made a mistake:
I interpreted electrifaction as laying power lines between a power factory and another factory, but what was meant here was electrification of tracks

Offline Colin

  • Devotees (Inactive)
  • *
  • Posts: 663
  • Certa Cito
Re: [Bug v4.5] An Easy Way to Become a Billionnaire ^_^
« Reply #7 on: July 05, 2009, 09:30:13 PM »
I think I made a mistake:
I interpreted electrifaction as laying power lines between a power factory and another factory, but what was meant here was electrification of tracks

I thought I had'nt seen this bug before. Yes it is electrification of Tram & Train lines.

Offline Nathan Samson

  • *
  • Posts: 89
Re: [Bug v4.5] An Easy Way to Become a Billionnaire ^_^
« Reply #8 on: July 05, 2009, 09:36:26 PM »
I thought I had'nt seen this bug before. Yes it is electrification of Tram & Train lines.

Thats what I mean, this particular bug indeed didn't exist before (as far as I know), but a similar bug with powerlines did

cwlau9

  • Guest
Re: [Bug v4.5] An Easy Way to Become a Billionnaire ^_^
« Reply #9 on: July 28, 2009, 05:40:44 PM »
This bug seems to be reappeared in ver 6.1 again.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18763
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [Bug v4.5] An Easy Way to Become a Billionnaire ^_^
« Reply #10 on: July 29, 2009, 08:15:02 AM »
Thank you for the report - I will have to look into this...

Edit: I cannot reproduce this. Can you give more details about the circumstances in which it occurs?
« Last Edit: July 29, 2009, 08:12:24 PM by jamespetts »

Offline Hanczar

  • *
  • Posts: 28
Re: [Bug v4.5] An Easy Way to Become a Billionnaire ^_^
« Reply #11 on: July 29, 2009, 08:43:26 PM »
Quote
I interpreted electrifaction as laying power lines between a power factory and another factory, but what was meant here was electrification of tracks
Quote
Thats what I mean, this particular bug indeed didn't exist before (as far as I know), but a similar bug with powerlines did

For me it looks now exactly as this.  Construct power line on every title gives me ~43000000 $ .
It happens when I have exe built from sources, or downloaded from http://www.43-1.org/~simutrans/simutrans-exp/i386/.
I have used clean configs but all time the same.  Build 5.1 ( released 17 VII 2009 ) works ok , build 6.1 ( released 26 VII 2009 ) gives 43M per power line title.

Ubuntu 9.04, 32-bit
EDIT: I tested pak64 and pak128 on both problem is reproducible.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18763
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [Bug v4.5] An Easy Way to Become a Billionnaire ^_^
« Reply #12 on: July 29, 2009, 09:55:22 PM »
Ahh, sorry, I thought that it was to way electrification that reference was being made. I have found this and fixed it, and the fix will be available with the next release.

Offline Hanczar

  • *
  • Posts: 28
Re: [Bug v4.5] An Easy Way to Become a Billionnaire ^_^
« Reply #13 on: July 30, 2009, 11:04:10 PM »
Could you commit fix to github? Current version because of this bug has very limited playability - no power lines at all

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18763
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [Bug v4.5] An Easy Way to Become a Billionnaire ^_^
« Reply #14 on: July 31, 2009, 10:09:45 AM »
That'll be done to-morrow - I can't do it in advance of a release, because the Linux nightlies will then automatically build, and I don't want them being built with a half-baked version.