Announcement

Collapse
No announcement yet.

An Explanation of the Trillion Dollar from AI cheat(NOT BUG)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • An Explanation of the Trillion Dollar from AI cheat(NOT BUG)

    Well first of all this is not a bug and I think Firaxis or Infrogames or whoever should not even worry about this issue because its not a bug. ITS A CHEAT. This cheat in no way hinders gameplay whatsoever, its up to the human to take advantage of it, people need to stop complaining about it. If you dont like this cheat then dont use it, why should you care that someone else in there own single player game takes advantage of it?

    Anyways onto the main point. Although I have a limited knowledge of C++, from what I do know this error has to do with the fact there is a limit on the size of integer a computer can handle. For civ 3 I would assume that asking money from other civs would be declared as an int since nobody is going to make more then 32,000 or so gold and 32,000 is the limit for what the computer can handle for int variables. A solution would be probably to change it to a long. Longs are the same as int variables except they can go much higher without the computer returning incorrect data. Actually the variable may already be a long, I dont know, if thats the case the only solution would be to limit the number of digits in the per turn or lump sum box to 4 or 5. That way the most you could ask for would be 9,999 and the AI would reject that since its not out of the range of the 32,000 so the cpu could do the calculatiosn without errors. This is just a thought and please correct me if Im wrong. And I hope you'll can even understand what Im talking about.

  • #2
    I think it's unsigned long, isn't it? Assuming 32-bit development tools. That would be easy enough to test.
    "Entia non sunt multiplicanda praeter necessitatum." — William of Ockham

    Comment


    • #3
      I agree with what you're saying about it being a cheat and not a bug. I reminded of Civ1 where you could hold down shift and hit f1, f2, f3, f4... and you'd get the cheat mode. It was something you had to consciously do.
      "You don't have to be modest if you know you're right."- L. Rigdon

      Comment


      • #4
        It is probably not the data type they used, but what they used to control how the AI deals with the gold transactions. When it goes 9999999999999, the function breaks, dropping the variable without the computer checking to see if the amount can be taken from the other civ. Since the flag that says "DO NOT DO THIS" did not pop up, the computer assumes that the number is ok, and gives it away, causing the AI's gold to go negative. The best way to fix this would be to check if the civ has a negative number for it's gold if the transaction were to take place. If it is, then it won't do it.

        This is a bug, I doubt the programmers thought that typing in a large number should give the player that amount.

        Comment


        • #5
          If i'm correct (i'm probably not), with what I know about programming (which is probably wrong ), if they want to make the variable as large as possible, they'd use an unsigned double. As that can hold MANY more digits then the input box, that'd eliminate the problem... however, a more elegant (read -- less memory intensive) solution would be to, as ham said, limit the number of digits allowed in the box... either way, it shouldn't be a huge fix for faraxis...

          -- adaMada
          Civ 3 Democracy Game:
          PTW Game: Proud member of the Roleplay Team, and Ambassador to Glory of War
          Intersite PTW Game: Member of Apolyton

          Comment


          • #6
            This is clearly a signing bug. They didn't declare the variable as unsigned somewhere (like in the routines to handle calculations of whether a deal was valid), so when comparing 999999 against 0, it comes out as less rather than more and screws it up. That's it.

            As far as memory use goes... 4 bytes does not a memory problem make. An unsigned 4-byte integer is plenty to hold the gold you get in this game. C'mon now.... memory? Elegance? Puh-lease.

            Comment


            • #7
              It's not clear to me that the problem is in the variable that contains what you type so much as the one that measures how desperate the AI is. When I ran into this, I had an AI civ on the ropes very early in the game. I decied to ask for everything I could to get peace. I clicked all the techs. The advisor said it's acceptable. I click all the cities. The advisor said it's acceptable. I ask for all the gold in his treasury. Acceptable. I ask for 10 gold per turn. Acceptable. I up it to 50 per turn. Acceptable. Continue until I reach 50k per turn. Acceptable. Decide it's bug and start a new game.

              I know that the AI is capable of pulling units and money out of thin air. I have watched the AI do this repeatedly. I'm not saying that there isn't a problem with the input box, but my experience leads me to suspect that if the AI is desperate enough, it will manufacture whatever gold per turn it takes to buy peace.

              Comment


              • #8
                Actually, Im pretty sure that the AI doesnt go into negative gold when you use this cheat, from best I can tell its impossible for anyone to go into negative gold.

                As a test, I tried to see what would happen when Im the one giving away more gold than I have. I ran the test by giving another civ a "gift" of the amount of gold per turn I was taking in, and all my treasury gold. (Ironically they'd refuse to accept it if I offered them more gold per turn than I had coming in), then change my tax rate so that I had 0 gold in my treasury and negative gold per turn counting the gold I was sending to them. What happened? I sat at 0 gold, and ran about three turns, before I was satisfied. From best I could tell, they was still getting my gift each turn, and I wasn't being forced to sell off improvements or units (unless it was done without my knowledge, but the negative per turn stayed the same).

                Comment


                • #9
                  Re: An Explanation of the Trillion Dollar from AI cheat(NOT BUG)

                  Not only is this a bug, its a very common programming error. Simple failure to check inputs properly. Should be corrected in the patch.

                  Comment

                  Working...
                  X