Montania

Discussion of Pop Top's last release of RRT.
RayofSunshine
CEO
Posts: 1288
Joined: Sat Nov 11, 2006 12:04 pm
Location: Colorado Springs, CO

Montania Unread post

Question :?:

Or at least a comment to a problem. It is a 100 yr scenario. 80 towns have to be connected by 1920, but at that date, if 100 are connected there is a $10M bonus. The game ends at the end of 1955.

The problem came in th 50s and during a Depression. Prior to 1951 with an Industry Profit goal of $500M, I had $1.9M. However at the start/end of 1951 the ledger shows a -$2.0M, which naturally defunks all medals.

Now, checking, although not making an addition amount for a yearly total, I find that of the 27 pages of industries listed, all are showing a profit.

My opinion is that of some type of programming error. The reason I make such a claim is the figure during the next few years of playing thru 1955, as that (-)negative figure continues to decrease due to the profits being made by the active industry profits. And I check each year to make sure that there are not any industries not making a profit.

I am not computer efficient to change items in the editor.

Any comments.[/list]
User avatar
ChrisW
Watchman
Posts: 53
Joined: Sat Sep 15, 2007 11:20 pm

Unread post

That's peculiar. If the game were storing your profit total in a 20-bit integer, it would exceed its maximum value at $2,097,151 dollars and wrap around to the lowest negative number, -$2,097,152. But 20 bits is an exceedingly weird size for an integer variable -- 16 bits and 32 bits are standard nowadays, and if it were 32 bits your profit could go to over 2 billion (2 thousand million for the Brits), not 2 million.

Besides, if the game were really using a 20-bit variable, it would never be possible to reach $500 million, and the scenario author would have caught that in testing.

Which is a longwinded way of saying I have no idea what's causing this peculiarity. 8)
RayofSunshine
CEO
Posts: 1288
Joined: Sat Nov 11, 2006 12:04 pm
Location: Colorado Springs, CO

Montania Unread post

:) Thanks CrisW,

And it makes sense to people who know programming, and your reply was well founded.

I asked my knowledgeable Son about the 20 bit integer and this is the explanation of the problem. There were enough 1 & 0s to the limit of the $2.0M, and when it reached that limit, it triggers the system to go back to the (-), and the opposite of (+). Thereafter, any revenue derived from the industries would be on the (+) factor and then decrease some of the (-) amount. Actually the amount in question was $2,047M, which would have been over that limit.

Makes sense to me, but then I don't know a dam thing about programming except that the creator did not expand the limit to include any overflow for the required $2M.
User avatar
ChrisW
Watchman
Posts: 53
Joined: Sat Sep 15, 2007 11:20 pm

Unread post

It does sound a lot like an integer wraparound bug, in that it went from a high positive value to a negative value of approximately the same magnitude and then became less negative as you made more money... I just have trouble believing that anybody would use an integer variable of such an odd size.

I wonder if the game is actually storing the total profit value as a numeric string or packed decimal or even a floating point, instead of an integer? That might account for why the size is weird. But I've played scenarios where my total profits were in the hundreds of millions without any such problems, so that still doesn't make sense.

Unless that particular scenario is doing something odd with the total profits, like trying to store them in a scenario variable of the wrong type, or something. Is this a scenario you're creating, or one you downloaded from here?

Edit: Ah, I found it on this site. It's in the "Other Lands" section.
Gwizz
CEO
Posts: 1100
Joined: Sat Nov 11, 2006 6:45 pm

Unread post

On one of my RT2 maps I had 1 Billion as a goal.
I would think it would not be different in RT3.

!00 years in a long time and not many players would stick that long.
Could simply be a bug in how it was programed that no one caught.

Ray Of Sunshine. You have been absent for a while.
Welcome back.
Post Reply