0*40=2,000,000,000+?

Had an interesting bug crop up in a 0.21 game I tried to play. I was spreading out like crazy, dropping tiny hulls with high defenses everywhere I went. (0 maintenance according to the ship construction screen, though ship design showed a rather hefty maintenance fee). Then all of a sudden, I get a popup telling me that my treasury has gone into the negatives. I was surprized, and then quite shocked to find out it was in the negatives by over 2B BC. Somehow, even though all my ships showed 0 maintenance individually, the total listed in the empire overview screen was over 2B. To make maters worse, the game promptly had a meltdown so I couldn't delete one (or a few) ship to restore the 0 maintenance (not that it would matter, that far negative), nor could I load the saved games.

Anyone else seen this?
11,781 views 10 replies
Reply #2 Top
You rolled over the bits
Reply #3 Top
Ii was pretty sure that something like that happened, I've been programming since the TRS-80 model I days. Any time I see a number near +/- 2B or +4B, I instintively think 32 bit int (or unsigned, in the +4B case).

I just don't get how it could overflow adding up zeros, which is why I brought this up. This will definitely take someone that knows the code, as opposed to an educated guess. Even if I added up the maintenance costs shown on the design page (which was non-zero), it would take a lot of ships to wrap around a 32 bit int. The closest thing to a rational explanation I've got is that at some point, the zero's rounded down to -1, and then something had an adverse reaction to the idea of me getting paid to maintain my ships, assumed I was cheating, and decided to make me pay for it.
Reply #4 Top
I have no idea what you are talking about.

I'm guessing the design screen was not adding up your costs properly for some reason, and displaying zero. Did ytou build all the ships inside a turn or two? I dunno why it would suddenly plumet to -2 billion, I've never seen a treasury go even remotely near that. Definitely a bug, did you get a smartexception report or anything? I'm sure stardock would like to see that one!
Reply #5 Top
i had this once - i thought it was related to setting military spending to zero and then trying to upgrade a ship, but i iz an idiot
Reply #6 Top
I have also seen this. You may wish to look at my post -- https://www.galciv2.com/Forums.aspx?ForumID=274&AID=81565 -- to check for and report similarities and differences between what we each saw. Every little bit of information helps to find the problem(s).
Reply #7 Top
The curse of the plumetting treasury strikes three times! Run in fear the tax man is here!
Reply #8 Top
...I can program my ti-82... yep.. that was the entire comment
Reply #9 Top
I've been programming since the TRS-80 model I days


Danm, now that was back in the 70's... lol- RADIO SHACK RULES! (I never could get those dang tape decks to save my stuff correctly) PEBKAC most likely...


Bummer about the bug- its to bad it didn't send the amount to the + side
Reply #10 Top
I had that show up in my current game last night as well.

I was making close to 100,000bc per turn, just completing up the tech tree, had taken the Korx worlds and many more by influence and had stock exchanges coming out my ears.

I only had two planets building anything, so I set my research up to 100% to zip through the last few techs. after I hit turn I checked the research graph to see how high it was, and it was a flat line. The other graphs still showed correctly, however.
When I went back into the spending slider screen I noticed it said I was making something like 1,000,000,000bc per turn. Clearly an impossibility considering the number of planets and how much I was making with research on 5%. It should have been around 100,000bc, but no more. (and perhaps there was a minus sign next to the number that I did not notice)

Upon hitting turn again, I went an odd figure around 2B bc in the hole, when the previous turn I had been close to 4M bc in the green.

I exited the game and plan to load up the autosave shortly to see if it does it again. Perhaps I won't set Research to 100% this time, keep it at 90% or so and see how it fares.