Negative gold

Whisker

Chieftain
Joined
Oct 10, 2016
Messages
69
I had funny thing happen to me in latest NC game. My treasury got to -1 gold.
I believe it happened by me spending my exact treasury on research and then enemy privateer plundered some gold from me. This was funny until I realized that I was unable to whip in any of my cities. Confirmed this was the reason by begging gold enough to get back to zero, after which cruelty could continue freely. Anyone else had this happened to them?
 

Attachments

  • negative gold0000.JPG
    negative gold0000.JPG
    331 KB · Views: 118
I had funny thing happen to me in latest NC game. My treasury got to -1 gold.
I believe it happened by me spending my exact treasury on research and then enemy privateer plundered some gold from me. This was funny until I realized that I was unable to whip in any of my cities. Confirmed this was the reason by begging gold enough to get back to zero, after which cruelty could continue freely. Anyone else had this happened to them?

Amazing!

No, years of playing, I've never even heard of negative gold.
 
Another first, folks! After all these years.
 
Woah, now that is something not seen. This reminds me of one time when I got permanent blockade around some cities after AI that was using ships to blockade waters was eliminated but tiles remained blocked.
 
if you stay in negative gold, can you avoid strike?
It looks like this is not the case. The CvPlayer::doGold() function which handles strikes reads:

Code:
    if (getGold() < 0)
    {
        setGold(0);

        if (!isBarbarian() && (getNumCities() > 0))
        {
            bStrike = true;
        }
    }

Apparently OP found some way of losing 1 gold after the doGold() function was already called, but at the start of their next turn if they were still below 0 it should get bumped back up to 0 and their civ put into strike.
 
It looks like this is not the case. The CvPlayer::doGold() function which handles strikes reads:

Code:
    if (getGold() < 0)
    {
        setGold(0);

        if (!isBarbarian() && (getNumCities() > 0))
        {
            bStrike = true;
        }
    }

Apparently OP found some way of losing 1 gold after the doGold() function was already called, but at the start of their next turn if they were still below 0 it should get bumped back up to 0 and their civ put into strike.
Thanks for the code dive! I have to admit, that looks pretty robust. Still I'm not quite ready to give up... how much negative gold would we need to trigger an integer underflow?
 
It seems the lowest amount you can have is -1000. I changed my treasury to -99999999999999 (or something like that) in the Worldbuilder, but when I closed it my debt was only -1000. My gold went back up to 0 when the turn rolled over, but a strike broke out anyway. I did the same thing next turn and lost my starting scout. 🙁
 
It seems the lowest amount you can have is -1000. I changed my treasury to -99999999999999 (or something like that) in the Worldbuilder, but when I closed it my debt was only -1000. My gold went back up to 0 when the turn rolled over, but a strike broke out anyway. I did the same thing next turn and lost my starting scout. 🙁
dang, those civ4 devs thought of everything!
 
Top Bottom