Richard Heaton Richard Heaton

1.04 AI cheats on tech tree, gets free techs from nowhere (bug?)

1.04 AI cheats on tech tree, gets free techs from nowhere (bug?)

I am not sure if this was a problem in 1.03. The computer will skip techs and cheat to get big ship techs. Here is a saved game which proves the point (.rar format):

http://www.restorethepledge.com/rapacity/GalCiv/techcheat.rar

The Altarians have battleship technology. Now, there are only two ways for that to happen. The first is for them to get it from somebody else. Go talk to the other races. Nobody else has it, so he can't have gotten it from one of them.

The second way is, of course, for him to research it himself. But if you talk to him you'll see that although I have interstellar tactics, he does not. So he can't have researched it. He appears to have simply gotten it from nowhere.

I suspect that the computer is also getting these techs without paying the development cost. Even if I beeline to dreadnaught and and ahead of the computers by a large margin in technological development, they beat me there. They also get dreadnaught technology practically instantly after getting battleship technology, even though it takes my superfueled researchers over 10 turns to research it. This part is harder to be sure about... maybe I'm overlooking something. But at any rate the computer should not be able to develop techs without having the requisite techs, or conjure them out of thin air when there's nobody else to get them from.

-Drake

~SDC~
5,202 views 123 replies
Reply #26 Top
Again AFAIK, the logs only shows techs researched the good old fashion way. We will discussing in another older thread why the Arceans(?) seem to be jumping techs based on their log.

It is very likely that techs bought, conquered or exhorted do not appear in the log. This seems also to be substantiated based on the tech research path/log for both Staffa and myself revealed by Brad.
Reply #27 Top
1D phasing is a strange tech too. It seems to me that in every game the Drengin get the tech at some point in time (without having instant communication).
Reply #28 Top
could they have gotten the tech from a minor races?
Reply #29 Top
I saw a very similar thing in one of my games (1.04, painful) where the Torians got Evolution Control before anyone, including me and all minors, had Terraforming. So I agree that there has to be some kind of bug here. Sorry, it's already a game or two ago, so I don't have the saved gmae evidence. Thank you Richard for being so careful with your documentation, and thank you Carielf and any other developers who work to fix the bug.
Reply #30 Top
It's likely worth a look just to be sure, as bugs will get past even the best Q&A for what's likely to be a large, complex code base.

Perhaps tech acquisition shouldn't be possible unless you have the prerequisites?
Reply #31 Top
Regarding the strategy of killing minors as soon as they come into the game, I've been doing the exact opposite, i.e. trade with them like crazy, using my trade goods to suck all their techs and basically using them as a tech researching center.

Should I instead invade, suck what they have and build up the planet? I'm much more of a "win without shooting a bullet" kind of guy (but I'll take any strategy that works), and my last game on medium/sub-intel I scored 1780 points and won by alliance by mistake, while going for a tech win. The minors helped me quite a bit when I was lagging on tech for a while.
Reply #32 Top
I've seen it often enough (particulary the oft-mentioned Virus Elimination) to say it is happening.

Hopefully it will be tracked down because while not a game breaker, it is bothersome to see an AI spontaneously leap frog ahead of you for no obvious reason.
Reply #33 Top
I just finished a game in which the Altarians beat me to battleships. This is fine and all, but after checking with all the other races, including minors and the Altarians, I was still the only one with Interstellar Tactics. Could someone explain this or is it a bug? The reason I ask, is because this ie the third time in five games that this has happened to me.
Reply #34 Top
Okuven, I think that ship techs are among the spontaneously generated techs (that or we notice them more due to their importance in the game).

While I will defend that this game does not *intentionally* cheat, I've seen this behavior too much to say that some code glitch is letting the AI cheat unintentionally.
Reply #35 Top
Popup-

Thanks. Apparently you're talking about the debug file. It's too late this time around, but I will remember that for next time.

-Drake

~SDC~
Reply #36 Top

Each AI players has its own way of researching tech.

I can say that the Altarians are not cheating. Their research code is still using the base research code which is in effect the code used to display the available techs to research.

The Altarians basically execute the code from the research screen list and then for picking use the AI value that's part of the .tech file.

In other words, if the Altarians are "cheating" then you should be able to do the same thing on that research screen.

Now if it was a different AI player, we could look more closely into that. But the Altarian's aren't cheating on techs. Theirs and the Yor (both use the base research class) are the most straight forward.

Reply #37 Top
Is it possible that they are stealing the techs becuase of their espionage rating?

-Vaaish

~SDC~
Reply #38 Top
Is it possible that they are stealing the techs becuase of their espionage rating?
End of quote

The trick is that these techs very often appear with no one else having them so where could they steal them from?
Reply #40 Top
No, the same tree. So something funny is going on. Like I said before "battleship technology" shows up as his most time intensive research. So I would bet 55 creds for 17 turns and interstellar capitalism technology that something funny is going on. If he isn't jumping techs, then there is a bug in what shows up as his most time intensive research.

I remain convinced that despite the developers' honest opinion that the AI doesn't cheat, something got by them. Put aside the jumping techs issue. I challenge everybody thus: Explain to me how an AI stuck in the corner of the map with two worlds, no resources, and no military to speak of manages to keep up with and even AHEAD of me technologically when my tech graph is about as huge as everybody else's combined, without doing something that I as the human player cannot do. Explain that to me, and I won't care if the computer jumps techs anymore, because I will beat it every time, on every difficulty level, with any start, with ease.

In any other game if you saw something like this you would just shrug your shoulders. Maybe the problem isn't with the code so much as with the stance that there is no funny business going on with the AIs.

-Drake

~SDC~
Reply #41 Top
I snagged a good save game this morning if any of the devs want to look at it:

Small map, version 1.04.059. I have contact with all majors and minors. I am the only race that has Battle Armor but the Arceans and Drengin both have Space Militarization available to trade to me.

I can appreciate that you all *think* the code is sound, but I've been there myself screaming at the monitor that it "can't" be doing that. Unfortunately, it is.
Reply #42 Top
Here is another game which shows the problem:

http://www.restorethepledge.com/rapacity/GalCiv/battleship.rar

This time included the debug.err file. There is no mention in it of anybody trading for battleship tech, and it doesn't appear to list what techs were researched, so I'm not sure if it's that much help. But anyway, again the Altarians have battleship technology even though nobody else does and they do not have interstellar tactics.

Another thing. Now that I am looking at the debug.err file after this stuff happens I can say with confidence that the computers trade with each other on more favorable terms than they do with you. Here are some highlights:

Debug Message: Year: 2179. Altarian Republic traded Diplomacy to the Drengin Empire in exchange for Deflectors
Debug Message: Year: 2179. Altarian Republic traded Medical Theory to the Torian Confederation in exchange for Trade
Debug Message: Year: 2179. Altarian Republic traded Industrial Theory to the Torian Confederation in exchange for Nano Electronics
Debug Message: Year: 2179. Torian Confederation traded Industrial Theory to the Yor Collective in exchange for Deflectors
Debug Message: Year: 2180. Drengin Empire traded Cold Fusion to the Altarian Republic in exchange for Shields
Debug Message: Year: 2181. Altarian Republic traded Sensors to the Drengin Empire in exchange for Photons
Debug Message: Year: 2182. Arcean Empire traded Nano Electronics to the Yor Collective in exchange for Deflectors
Debug Message: Year: 2182. Yor Collective traded Industrial Theory to the Arcean Empire in exchange for Trade
Debug Message: Year: 2182. Drengin Empire traded Space Militarization to the Torian Confederation in exchange for Advanced Trade

And so on. Try making any of those trades yourself and see where it gets you. I especially like the ones where the computers are passing deflectors around like hot cakes. The computer will not trade deflectors to the human player unless you're willing to offer about half your star systems. Admittedly the computer sometimes comes to YOU willing to make a favorable trade, but that is very rare... so at the very least it makes more good offers to the other computers.

I also liked this:

Debug Message: AI: Drengin Empire blackmailed Carinoids for $ 1199!

Given its positioning in the log that happened in 2181 or 2182. That is simply impossible. Although the minors may have that much money that early on, nobody has enough military to extract that much. I generally find that if my military is *vastly* superior (as in, battleships or dreads, so WAY later on) then I can get up to 50 for 20 turns, or almost as much but stretched out over time. There is no way you can extort them for that much in 2181 or 2182, when you're flying around with corvettes.

Anyway. I think I have proven my point, so I will quit heaping evidence up. The computer *does* cheat. So if it's not supposed to, it should either be fixed, or we should simply accept that the computer cheats and acknowledge it openly.

-Drake

~SDC~
Reply #43 Top
On tribute, the human player isn't even allowed to *ask* for that much money upfront for anything -- tribute, trade, et al -- unless their current treasury is at least that much, while the AI can come knocking asking for $1500 when you're at negative levels.
Reply #44 Top
On tribute, the human player isn't even allowed to *ask* for that much money upfront for anything
End of quote


Actually, yes. Just manually type in the number. As an alternative, do 500 for 2 months instead of 1000 for 0 months.
Reply #45 Top

If you guys want to say the AI cheats then go ahead.

However, having written this code, I can tell you that it affects humans the *exact* same way.

That is, the AI rolls a random on which player it's going to blackmail or offer trade to. If it's the human, it opens up the screen and tries to blackmail you or tries to trade a tech with you.  If it's another player, it writes it to the debug.err as you saw there.

I am sure I'm not the only one who have had the Drengin or someone else in 2182 or whatever come and ask for $1182 or whatever if we had that kind of money.

Anyway, I think some of you are getting a little anal about it.  You are correct in the sense that the AI handles humans different in diplomacy now. It wasn't the case in the original release so much but as we've seen, humans exploit computer players in the diplomacy AI much more than what the AI does to one another in general so the two trade evaluations have increasingly become different and I expect that to continue. 

But is that a surprise? That the diplomacy screen has increasingly had to treat humans different from computer players? It wasn't comkputer players exploiting trade goods after all. It was humans. It wasn't computer players selling a gazillion ships for techs. The AI doesn't aggressively trade like that. And so it doesn't need the kinds of checks.

If or when we have the AI be more aggressive in trading, then we'll have to revisit returning the diplomacy AI to being the same for humans vs. AIs.

But at the end fo the day, it's a video game. For fun. And as a result, we don't have the AI trade as aggressively as it could because we want human players to have the opportunity to be able to flexibily trade as part of their strategy without having to compete wholesale with the AI in this area. Because IT IS A GAME FOR FUN.

That we've had to tighten up the diplomacy AI to deal with exploits was done because people asked for it and it made the game more fun. But if we had to rewrite the diplomacy AI for the computer players each time, it would have a) made it take a lot longer and 2) made the game less fun because then the AI would be competing with humans on the increasingly restricted amounts of trade.

I think some peopole here have so little experience playing other strategy games that they simply have no understanding of what cheating really is.  Because it is in that context that the AI plays by the same rules as the humans other than a few specific exceptions (knowing the color of the stars and where resources are located). The typical strategy game AI doesn't actually play the game in any way that can be remotely considered to be the same game as the human is playing. Units are simply created. Projects are instantly created based on random rolls on the difficulty levels. Units move in a pre-scripted way. Etc.  That is where the bar has been at.

At the end of the day, the computer players in GalCiv are playing the same game as you are. Since 1.0, changes have been made to the diplomacy AI to stop humans from exploiting the AI whereas the AI to AI checking has remained pretty much the same. But none of these really affect the larger issues at hand.

 

Reply #46 Top
Frogboy, I appreciate your long explanation here. Any of us who have played the game for awhile take your point that the AI is not intentionally coded to cheat.

But your reply does not address the main point of this thread; the AI appears to research techs without researching/trading for the pre-requisites. Many of us have seen this behavior in games. The screenshots and debug files here seem to document it clearly.

It sure sounds like a bug. Will you look into it? Or if this is designed behavior that we don't understand, will you explain it?
Reply #47 Top
Brad, with all due respect because I do love this game, I have to question why once again you reply to a thread to miss the forest for the trees with regard to the problem at hand. I know it must get tiresome to find criticisms of your "baby", but doing the politician feint and double speak is not the way to handle it.
First, for the single specific example you addressed in all that:
I am sure I'm not the only one who have had the Drengin or someone else in 2182 or whatever come and ask for $1182 or whatever if we had that kind of money.
End of quote

You missed what was said: the AI does not come and ask for $1182 when you have that kind of money, the AI comes and asks for $1182 when you're already at negative $750 (or, if you're lucky, at positive $82). I've lost many a game because the AI put me in the position of either going to war with it or shutting down my entire empire's production for years. That is definitely not the same game that I get to play with the AI. This has been brought up numerous times, and I've never seen it addressed, and here you went out of your way to claim the problem doesn't exist.

Then, you didn't even address the real crux of this thread: the AI is getting to research techs without having the pre-reqs. Many of us even have save games that demonstrate this phenomena. Again, not to be anal about it, but that's not anywhere close to the same game I get to play, nor do I believe it is the game you intend for the AI to play.

I understand fully that you've tweaked the AI to not always be fair with the human, I think that's a kludge way of handling the AI, but as I said in another thread somewhere I know that it's a rough approximation of the way a human player would never hand over certain techs/goods unless the deal was really good. Conversely, since you don't have the AIs being as gungho in wheeling and dealing as the humans, it's not necessary to make sure that everyone of their trades is absolutely strategic. I understand that, I think most people understand that. However, what we don't understand is why the AIs are getting Virus Elimination without the prereqs, why they're getting Battleship Tech without Interstellar Tactics, or why they're getting Space Militarization without Battle Armor.

Kludged AI to simulate a crafty human is one thing. Putting a stack of aces up the sleeve is a whole other and I must believe it is a bug.
Reply #48 Top

Everytime I've looked at a saved game where someone claims it was cheating (And I've done many of these) it's becaus ethe human player didn't take something into account.

Here is the source code for the research for the Altarians:

for(ulTechID = 0; ulTechID <= g_pGalaxy->ulHighestTechID; ulTechID ++)
{
  if(this->AreTechParentsKnown(ulTechID))
   if(this->IsTechKnown(ulTechID) == FALSE)
   {
            pCurrentTech = g_pGalaxy->apTechnologies[ulTechID];

            //============== Morality ==================
            ULONG ulTechMoralityReq;
            ULONG ulPlayerMorality;

            ulTechMoralityReq = pCurrentTech->ulAlignmentCategory;
            ulPlayerMorality = this->ulMorality;

                  if(ulTechMoralityReq != NEUTRAL)
                  {
                    if(ulTechMoralityReq>NEUTRAL)
                        if(ulPlayerMorality <ulTechMoralityReq)
                            continue;

                    if(ulTechMoralityReq<NEUTRAL)
                        if(ulPlayerMorality > ulTechMoralityReq)
                            continue;
                  }
            //============== Morality ==================

    ulThisTechAmount = rand()% ULONG(pow(pCurrentTech->ulAIValue,1.3));
    if(ulThisTechAmount > ulBestTechAmount)
    {
     ulBestTechAmount = ulThisTechAmount;
     ulBestTech = ulTechID;
    }
   }
}

if(ulBestTech!=INVALID_TECH)

  this->StartResearch(ulBestTech);

=

So you tell me, where is the cheating? It checks to see if parents are known. It checks the morality. What "cheating" do you suggest I fix? This is the same code used to diplay your own tech list box.

Reply #49 Top
Sigma 7 --

Try it. You can type in any number you choose, but it'll reset to 0 for 0 unless this has changed recently.



Reply #50 Top
I can't say that I've seen where the Altarians have an unexplained tech and, yes, that code is pretty straight forward assuming there are no glitches in the AreTechParentsKnown() function.

OTOH, I do have my save game from this morning where the Drengin and Arceans both have Space Militarization (not sure who got it and then traded or if they both researched it) but I'm the only one with Battle Armor (and I have contact with all races so I know that it the case). You mentioned earlier that only the Altarians and the Yor used the above straight forward code, so maybe there's something off with either the Drengin or Arcean.

I'm not trying to bitch, I'm trying to help you guys track down what is a bug unless you can somehow explain my savegame.