par002 par002

AI isnt very smart.. it Cheats

AI isnt very smart.. it Cheats

Cheating AI

I did some tests with not only exploring ships that can auto survey, but also with a small galaxy and watching what the AI players do.

Auto Survey.

Take one of the ships that you have and make a direct b-line somewhere where it is completely surrounded by fog of war. When it is out far enough, turn on Auto Survey. It will go directly to an anomaly outside of its "viewed" space. Cheats Although is is for my empire, it just proves that the AI knows were everything is on the map w/out "discovering" it first.

AI Colonization.


I randomly kept generating a small galaxy map with only 2 players and I made sure that I was on the opposite end of the map from the AI. During gameplay, I built nothing but exploring vessels and researched sensors so that I could see a long ways. All I focused on was uncovering the map as much as I possible on my side of the galaxy w/out losing the ability to "see" where the AI was going..

I want to make it clear, I was EXTREMELY vigilant on watching where the AI ships were going and recorded what they could "possibly" have seen with their scouts.

Loe and behold, without any "scouting" ships (or ANY ships for that matter) I saw the AI player building colony ships and sending them to my side of the map to habitable planets that the AI could NEVER have seen.

I repeated this test 5 times with a small galaxy and a different race each time (thinking it might be possible for some races to be omniscient?). And all 5 times the AI exhibited the ability to see resources and habitable planets w/out "discovering" them first.

I am a programmer myself (business apps actually.. would like to get into gaming some day) but I focused on AI during my last year in college. It would not be "too" hard to create a heuristic that would allow the AI the INABILITY to choose destinations that it was unable to "discover" first.

By the way, the AI was on "NORMAL" for all of these tests.

This is the MAIN reason why this game needs multiplayer. There are only so many times I will play this game on single player *knowing* that I am at a distinct disadvantage from my opponents.

PAR
99,113 views 147 replies
Reply #101 Top
I'm disappointed that Brad hasn't found this to also be true...


Well, I can understand Brad's reaction (or lack thereof) perfectly well.
You see, with GalCiv1, the same thing was going on over and over again - people accusing the GalCiv-AI of cheating and providing 'evidence'.
Now, in 95% of the time, those people just didn't understand the game mechanics (for example, all the 'How can the AI build ships so fast! Cheat!' - people : Well, it simply buys them...), or they didn't have much clue about programing and/or made wild assumptions. (NOTE: I'm not saying everyone was/is like that. But well, 95%, yeah)
The other 5% were bugs, which were usually fixed by Stardock.

Now it's starting again. See, there is nothing wrong with detecting unusual behaviour of the AI and report it.
But there is a definite difference between saying:
"Look, Brad, something is strange here and there, could you look into it?"
and saying:
"Your AI sucks you cheat!!!!!!"

This attitude is the problem, guys. Just assuming that Brad is lying all the time about is AI not cheating. You see, Brad&Co. aren't SOE or EA. They hang out at the IRC, they do an incredible amount of updates, they hang out in the forums, they even post code snippets. And usually, the listen to there fans. But if they are approached with a hostile attitude and half-baked claims, why the hack should they waste their time over and over again defending themselfes?
For that I learned from similiar GalCiv1-discussions: Everytime Brad proved peoples accusations wrong, they would just go on trying to find the next 'definite proof' that Brad's a liar. It wasn't about improving the game, it was all about 'Brad is lying'. Not for all of them, but for most. And yeah, I can understand that Brad prefers to ignore this. I would to.


I hope I didn't come of to fanboyish. To the current discussion, I haven't seen anything so far that I'd accept as proof for the AI knowing where the good planets are when it shouldn't, but some stuff that strongly suggests that there might indeed be something wrong. But I guess, if this should indeed be the case, I bet it's a bug and not Brad trying to fool us. And in this case, devs and fans should work together to hunt it down and fix it. Not against each other.

Oops. That was a rather long posting. Got to go back to work now and fix my own bugs.
Reply #102 Top
t is simple to prove the FOW doesn't effect the AI since if you play a normal game where the AI has planets to colonize with FOW cheat everything happens as you expect... AND FrogBoy/Brad says when the FOW is lifted it doesn't effect the AI...


Okay, I missed that - my fault.
I apologize.

Reply #103 Top
Is it possible that it may also share knowledge gleaned from scout vessels? In a large multi-race map perhaps enemy scout vessels not only discover habitable worlds for their race, but also for the other AI? Just a thought.
Reply #104 Top
I wonder, has anyone seen the AI appear to cheat without using ctrl+N or the no FOW cheat? Seems there are/were some issues with ctrl+n in the beta and we don't know what the cheats do to the AI. What might be better is to start a single map and use the cheats to cover the map in sensor ships to watch what the AI does.
Reply #105 Top
I don't think anyone has tried to say brad was lying. People have posted claims of weird behaviour, others have confirmed, and I have given a nice objectional view on a possibility where the error might be.

Originally I said that I don't believe there is a bug, but now I think there is because of what I have seen, and been able to reproduce in my example.

Now, to make sure we all get the idea... here are some points:

1) Whenever someone says "The AI Cheats", they really mean "There is a bug in the AI code", they just emphasise it wrongly.
2) It has already been stated several times that the rules are different for the AI as it is for the human, and so if it is considered normal behaviour for the AI to do what it does in my example, then it is a feature, and not a bug.
3) FrogBoy has said himself that the AI will not send a colony straigh to a habitable planet without prior knowledge of its existence from a scout first. My tests dis-proves this (and if you don't believe that, then try it out yourself).

So, I personally don't care if this is changed or not. all I wanted to was was find out what made the original poster and others believe the AI was "sending colony ships when they shouldn't", and this is most certainly how it does it.... It may not be the only way it does it, but it is definately _A_ way.

So, what should be done about it? well, whatever the programmers want to do about it, but now the people experiencing this oddity knows why it is most likely happening...

anyway, this is a forum... everyone argues on a forum
Reply #106 Top
Darkrenown - Yes of course, that is what started this 100 and growing long thread in the first place. And the sensor trick has been done with no cheating at all and saw the same behaviour...
Reply #107 Top
Is it possible that it may also share knowledge gleaned from scout vessels? In a large multi-race map perhaps enemy scout vessels not only discover habitable worlds for their race, but also for the other AI? Just a thought.



If this were true, it would be very disturbing to say the least. Interesting theory though.



So, what should be done about it? well, whatever the programmers want to do about it, but now the people experiencing this oddity knows why it is most likely happening...


Well, I'd personally like to play against a fair opponent, so it should be fixed somehow, no?

Reply #108 Top
FWIW, I have had AI ships and such appear in *unexplored* territory as clear as if I were spotting them. I don't know why this happens, but it does. Not in the fog of war area but places in FOW AND unexplored (I've never evenbeen there).

So there is a bug, but what it is I do not know.
Reply #109 Top

Okay this topic is obviously a very important and hot issue.... so my question is
" where are the developers? "

A quick 5_min post from the developers would place this hot important issue to sleep... an example:
DEV_A : The AI does not cheat based on programming... ya da ya da yaa da.
or
DEV_B: Currently the AI does cheat when reaching the good planets... we are working to improve the AI... ya da yada.

I've seen in other game forums where the developers will actually comment on the hot topics.
Reply #110 Top

I looked into this and was unable to get it to happen.

I  wrote my observations and debugger info here:

https://www.stardock.com/screenshots/cheatquery/

There are a couple of odd things going on however:

1) It's a scenario. 

2) There are a lot of saved games going on.

So based on what I'm reading here, I am going to put more effort into making sure the bIsKnownBy is cleared out between saved games and such because that's really the only way I can imagine someone seeing that.

But like I said, I loaded up the game in the debugger, played for quite awhile (I was up until 6:30am incidentally) and looked into this.  I saw no evidence of cheating and in fact, I saw some flaws in the AI colonization which you can see in there.

In the future, if someone wants a serious response, they should consider better titles.  Having some guy come on and declare that the AI isn't smart AND that it cheats is a bit off putting and erroneous.

Reply #111 Top
In the future, if someone wants a serious response, they should consider better titles. Having some guy come on and declare that the AI isn't smart AND that it cheats is a bit off putting and erroneous.


Completely agree...was very bad taste, but it sparked a decent conversation at least.

Reply #112 Top
Okay this topic is obviously a very important and hot issue.... so my question is
" where are the developers? "

Frogboy, draginol (and other aliases?) has replied several times already, and he is the AI coder and the owner of Stardock. He even posted part of the game code to show how this issue is handled (and I have never seen that happen before with any developer).
Reply #113 Top
Well, I have tried the method put by SmackleFunky :

- Launch GC 2 in cheat mode
- start a small universe with 1 opponent
- at the first turn:
- clear the FOW (CTRL + U)
- clone enough colony ship (CTRL + C)
- teleport them near colonizable planets (CTRL + T)
- Colonize all planets except one, which need to be reachable by the AI colony ship but outside its sensor range
- Create a battle ship (CTRL + B) near the ennemy flagship. Upgrade it (CTRL + A) and kill the flag ship
- hit turn and kill any produced souts

Now you will see that the ennemy colony ship will move toward the only available planet, even if the AI hasn't visited it yet.

I hope that Frogboy will be able to devote some of his precious time to enlight us about what happen in this particular case.
Reply #114 Top
FrogBoy, I think you should have a look at the Link I posted earlier. It shows a scenario which is very rare in a real game (so your tests that you described earlier would of missed it), but is very plausible and will happen on occasion.

In short, the problem I noticed was that a colony ship would go to an un-scouted available planet iff te scout already exists, but has no known planets that it can go to. This only happens in the game if a colony ship was created, but the planet it was heading for gets snatched up before the colony ship makes it AND there is no other known planet to go. My link shows how to reproduce this scenario pretty quickly and easily. No save games required.

On a side note, I found some odd behaviour loading the saved games a bit (not AI related), but I will leave that for another time.

Reply #115 Top
Have you changed it when creating your race? Or was it correct the first time and get screwed woith CTRL+N?


Hmm I got that from ctrl+n I believe. Not sure when the first time it happened. Now when I start a new game in the main menu, it still name the star/system custom star. Home planet has the right name, however.

I also get all kinds of weird home star/system. From 1 planet that can be colonized (home planet) to 4 with one of them being a PQ 23.

Maybe it's some kind of bug.. I'll see what happens after the next update.
Reply #116 Top
In short, the problem I noticed was that a colony ship would go to an un-scouted available planet iff te scout already exists,


When I say "te scout already exists", I of course mean "the colony ship already exists"... stupid edit button not working
Reply #117 Top
But like I said, I loaded up the game in the debugger, played for quite awhile (I was up until 6:30am incidentally) and looked into this. I saw no evidence of cheating and in fact, I saw some flaws in the AI colonization which you can see in there.


Mmm. I was up to 6:30am, too, but that's just because my sleeping schedule likes to run on 26 hours. Dang artificial lighting.

At this point, I'm more inclined to agree with you that I must've missed a scout somewhere. I ran a couple more tests - this time horribly abusing cheat codes. Not to remove fog of war, but to clone and teleport sensor ships all over the place to accomplish roughly the same thing, since people have been concerned that the AI might function differently with that particular code turned on.

I did see some very peculiar behavior on the part of the AI, but not with colony ships. It really does seem that if they don't get a planet within sensors, they won't send colony ships out, not even blindly.

I also saw some other places the AI could be improved. I'm going to move my observations to a new thread. Oh, and if people want the save game files or notes from those tests, give a yell. I haven't bothered uploading them yet. There's one more test I want to run involved with reloading saved games tonight. It seems that just saving a game doesn't do anything, but I've seen some odd things reloading that I want to check out.

crickel

Edit: Well that took all of about 15 minutes to check out. I loaded up a couple saved games and let them run to see what would happen. Didn't see anything odd with any colony ships. So much for my other hypothesis that reloads might be affecting it!
Reply #118 Top
It really does seem that if they don't get a planet within sensors, they won't send colony ships out, not even blindly.


haha, Now you are "changing sides"... Just when I was starting to agree with you

Oh well, I hope everyone else is having as much fun with this as I am.

Reply #119 Top

It really does seem that if they don't get a planet within sensors, they won't send colony ships out, not even blindly.


Well that much can be said about the code. AI has demonstrated its inefficiencies as many dare not send out a colony ship until a planet is 'known,' even if all the scouts they build get blown up in the process.

1. Build scouts
2. Secnd scouts.
3. Scouts find planet (planet is 'known')
4. Immediately purchase colony ship and send the planet that way.

From that we can conclude the code is not in err. It is clear that the code is written so the AI would not send out a colony ship until it is 'known.' If there is a bug in the code, it's not in the know planet/colonize planet part. It's how the AI acquire the information on the planet.

Now the question is.. how does the AI know the planet even though the scout got nowhere close to it?

The part of the code that needs to be examined is probably the part that relate to how AI come to know about the planet.

Like SmackleFunky mentioned: "What does the colony ship do if it has no where to go?"
In game, we often see the colony ship just staying in the same spot.. but that's because all the colonizable planet in range have been taken. What if there is a planet in range that is not discovered? Would the colony ship somehow head toward it.

I would suspect the code here might be different because the ship is already in place. Earlier, the ship was purchased and autopiloted to the planet in response to discovering a planet.

What the colony ship would do if it was already created isn't really tested except by SmackleFunky.

There were cases of player reporting that the Ai would send the ship to another planet if the destined planet is colonized.. so maybe that part of the code need examination.
1) head toward destined planet
2) if destined planet taken, automatically head toward next planet... or next 'known' planet?
Reply #120 Top
Very interesting thread all. I'm glad to see that most of the flaming died down after the first page. Thanks to everyone who put work into this, especially Brad for putting up with us. SmackleFunky, your hypothosis is interesting. "Where does the colony ship go if it has no where to go?" It's a very good question. I might take a little poke a this tonight.

-Dewar

PS: Oh, and as long as the computer isn't outright cheating all the time, it's not that big of deal to me.
Reply #121 Top
To further that note;

The code posted by FrogBoy, I believe, is to evaluate whether or not to create more colony ships. And so the error (if there is one) is not necesserily there, as a colony ship may already exist. Secondly, its not how does the AI gain knowledge of a planet, because it has been shown that they never magically gain knowledge of a planet

Rather, how does a colony ship move through space? I believe that somewhere in that code, the AI is going through the list of known, free planets - picking one and heading for it.

But something is going wrong when no known, free planets are find. Possibly not checking to see if that list is 0, which results in the colony ship going to the next planet on the list.

This is my suggestion to the cause of the bug. If anyone else has another suggestion that isn't just a random guess, but something with a procedure to back it up and show examples, then I would like to hear it.
Reply #122 Top

I did put in some code to make sure that the bIsKnownBy variable is intiailized to 0.

Because it IS possible that under some circumstances that you could end up with garbage in that variable and so the AI thinks it knows about it.

So try it out with 1.0X and let me know.

Reply #123 Top
Well that has definitley cleared up my findings - I can no longer do what I mentioned before. So from me.

I guess at some point, under the conditions I gave it, it was not getting initialised properly... odd.. but all is good. I'll try the more complex scenario by crickel just to be sure.
Reply #124 Top
On a side note, the colony ship just goes back to a home planet when it has no where to go... shouldn't it try out some exploration, other than wasting time sitting at a planet?
Reply #125 Top
On second thoughts, using Crickel's old save game would be inconclusive, since its a save before the change and therefore unreliable... Oh well, we'll just have to wait and see if it pops up again in a new game.