AI cheats at this game.

As far as I can tell the guts of the trade-network calculation are called by the line in CvPlotGroup::recalculatePlots() which goes....

gDLL->getFAStarIFace()->GeneratePath(&GC.getPlotGroupFinder(), pPlot->getX_INLINE(), pPlot->getY_INLINE(), -1, -1, false, eOwner);

The name suggests it's doing some sort of A* search, but I can't find the various functions being called anywhere to actually see what it considers during that search. Someone more experienced with Civ4 code might be able to find the bottom of this rabbit hole.

What I can say is that given the way the code in recalculatePlots() is written, it seems unlikely that there is any unintentional AI cheating going on (they still could have written a check into the actual A* search which makes it dependent on whether eOwner is human if they deliberately wanted the AI to cheat).
 
I'm looking forward to automated workers with comparable competence to AI workers. How come the AI workers never build improvements right on THEIR side of the border while at war?

The AIs don't put them on the borders, but they do leave them vulnerable from time to time. I've been able to snipe enemy workers during a war (and I mean well into the war, not the turn I declare on). Of course, I play below immortal, but if I remember correctly, you've been able to do this too in your videos.

That being said, I do agree that the human's automated workers are downright suicidal. I've told this story before, but I just love to re-tell it: In one game, where I had the entire continent to myself, I had the Great Wall. In the middle of the continent there was a small pocket that didn't have my culture and there was a barb unit trapped in there. Soon, I got a message saying that my auto-worker had got eaten by the barb. That means the worker had deliberately gone through the handful of tiles that could even theoretically pose a danger. :crazyeye:
 
The AIs don't put them on the borders, but they do leave them vulnerable from time to time. I've been able to snipe enemy workers during a war (and I mean well into the war, not the turn I declare on).

I know what do you mean literally. I personally dubbed this type of worker stealing "AI_routeCity Bug" or something like that in my book of worker stealing. AI workers while putting a network from point A to point B do not consider imminent danger while putting a new road. As if the function to check "MOVE_SAFE_TERRITORY" after moving to the next tile for putting a road.

Not to be over-annoying about deity, but that is the level where I encountered most of that type of worker stealing method (and I played more games under that difficulty) because quite often, after the first worker is stolen, the second built tries to put a route between the two initial cities. If the lands known after stealing the first, you can almost envision and set a booby trap to the asinine worker (who prioritizes bare lands for next roads over tiles that consume one :move:).

Wish I could understand the whole stuff behind scene (i.e. code).

In my book of worker stealing, there is another more obscure "exploit" I dubbed the successive worker stealing. On slower speed, I bet this could be over abusing.

If only I had those code reading abilities.
 
Looks like the "in danger" function (AI_getPlotDanger) has a special clause to account for human-controlled units being more of a threat. Specifically they are "a danger" from one square farther away. Might account for AI workers being more cagey when they're at war with us. Might also be a CHEAT! :D
 
It seems you should all be wary of accusing the game of cheating, when it might just be your imperfect understanding of the (admittedly obtuse) rules for trade networks that might be at fault...

Please edit the topic title to at least include a question mark, until you can present proof that the game is actually cheating.

Also please note that there's a difference between a bug and a cheat: it might just well be that the AI can do stuff the human can't because of an error in the programming. In order for something to be a cheat, there needs to be malicious intent present! Please don't accuse the Civ programmers of cheating unless you are absolutely sure they intended to give the AI advantages without either giving them to the player too, or at least include it in the documentation (such as the difficulty level bonuses).
 
Please edit the topic title to at least include a question mark, until you can present proof that the game is actually cheating.

I refuse. Even if the way I thought it was cheating wasn't true, there is indisputable evidence that the AI does in fact cheat at this game. Worst enemy map hack and seeing into fog using movement points are 2 obvious examples, but a lot of its "my rules are not your rules" type of stuff that doesn't depend on difficulty fits as cheating too, specifically PAssal and upgrades. Ignoring espionage to get exact power is another.

Please don't go pretending that a known aspect of the game for years doesn't exist. There is GOOD REASON to suspect the AI cheats in ways we haven't noticed, because it's already been documented to cheat in multiple ways and to play a different game than civilization IV.

Also please note that there's a difference between a bug and a cheat: it might just well be that the AI can do stuff the human can't because of an error in the programming.

Yes, I'm well aware of things like my units moving at the start of a turn despite efforts to select them, the game not letting me, then said units landing adjacent to the AI (or moving out of a city they're defending). Things like the controls not working (and I will roast you alive with evidence if you dare try to tell me they work), and basics like units with pathing automatically re-routing even though games from more than 20 years ago knew not to do that. All of that is irrelevant to this discussion though. Also, if the AI cheats through a bug instead of by design, it's still cheating.

In order for something to be a cheat, there needs to be malicious intent present!

Check the definition of cheating and try again.

Please don't accuse the Civ programmers of cheating unless you are absolutely sure they intended to give the AI advantages without either giving them to the player too, or at least include it in the documentation (such as the difficulty level bonuses).

I have no such burden of evidence to prove cheating. You don't get to make up what words mean; if the in-game behavior fits at least one definition of cheating, then I can call it cheating appropriately. Please don't abuse language and communication by changing the accepted definition of words.
 
@Kazapp: As the MeInTeam points out in his post, it's well-known that the AI cheats. It needs certain information to make more informed decisions and since an AI is more simple than a human, it needs information that the human doesn't see (directly). It simply isn't able to make intuitive leaps like a human or learn from experience (like learning when a good attack date is, what size of a force it will need at this or that time, what to expect from its rivals, etcetera).

They also get difficulty dependent bonuses that aren't (AFAIK) officially published. The AI doesn't get any smarter when you choose a higher difficulty; it just gets a handicap to waste.

I don't know what difficulty you play at, but you'll find that at the higher difficulties, the way to win is to leverage the AI bonuses and use them for yourself somehow (usually through war and tech trades, less commonly through vassal abuse and espionage).

The fact that the OP happened to be wrong about this particular mechanic is purely coincidence.
 
Hmm, haven't read all of TMIT, but does the AI really cheat? I'm not so sure about that, have heard everything, AI can see hidden ressourcces, lie, AI has further sight-range, lie, a.s.o.

Anybody got any links that confirm any cheating of the AI?
 
Hmm, haven't read all of TMIT, but does the AI really cheat? I'm not so sure about that, have heard everything, AI can see hidden ressourcces, lie, AI has further sight-range, lie, a.s.o.

Anybody got any links that confirm any cheating of the AI?

AI can *not* see hidden resources, it was play tested with screenshots + save years ago. AI changed its settling patterns drastically based on resources when it was worldbuilder'd techs vs not having them.

It *can* see anywhere its units have movement into fog (A player also proved this with a save + destroyers + worldbuildering targets at different points all out of view). You can easily reconfirm that with a worldbuilder test yourself; if you put a dude within capture range of a worker or work boat the AI will 100% hit as long as it's within the AI unit's current movement radius (even using roads). It makes no difference whether the AI can actually see it. It "sees" where it can move that turn. The thread proving it is old, but still around if you really care.

Arguably the AI lying can be considered a bug. It averages diplomatic relations with master + vassal...so if you have a vassal it is annoyed towards but it's friendly towards you it's actually CAUTIOUS. The problem is that the UI still tells you FRIENDLY, and even shows "-1 we are upset that our rivals are your vassals"...with 0 indication that instead of a -1 penalty, you are in fact receiving a -8 penalty or more.

AI CAN detect a trade with its worst enemy before it meets you. Simply stick gandhi + shaka next to each other in world builder with different religions, meet gandhi, trade him a big tech, then meet shaka. -4 worst enemy trade. WE can't detect AI-AI trades before we meet the AI though. This is a serious problem in LHC games because it forces an already weak position to be weaker; you have to delay trades until you know the ramifications and risk getting your powerful monopoly tech begged before doing so, potentially costing tens of thousands of :science:...and of course if you give into that bribe you STILL get the worst enemy demerit because failaxis.

AI does not need espionage to know your power when deciding if you're above the threshold for war. The great DanF showed us the line in the code himself.

Then you have the collusion; the AI behaves differently towards the human than other AI. You can prove this anytime in the game that you want to trade a clam, corn, or dye for the AI's spare iron. YOU can't make that trade. The AI CAN and WILL make that trade with other AI, and this can make choking away iron mighty difficult when they trade a single clam and 0 money for iron. AI taking obvious culture AI as a vassal state is also a deliberate attempt to throw the game so the human can't win and frowned upon...but arguably AI collusions is just firaxian idiocy rather than actual cheating. It would have been much better in civ IV if the AI actually attempted more than 1 of the 5 non-time victory conditions, ever.
 
Yes TMIT, but how come, that when I worker-steal, and a roaming Archer comes to my unprotected capital which is on a hill, that he doesn't capture it? I think it's because he cannot see it because it's on a hill and surrounded by forrests. I hade that very very very many times when Quechua-rushing.
 
Yes TMIT, but how come, that when I worker-steal, and a roaming Archer comes to my unprotected capital which is on a hill, that he doesn't capture it? I think it's because he cannot see it because it's on a hill and surrounded by forrests. I hade that very very very many times when Quechua-rushing.

Surrounded by forest = the AI can't move there in one turn.

And because the situation presented was:

It *can* see anywhere its units have movement into fog

Unless the AI has a 3 movement unit at the time you are quechua rushing, the AI will not be able to see your undefended capital under the condition listed above.
 
Yes TMIT, but how come, that when I worker-steal, and a roaming Archer comes to my unprotected capital which is on a hill, that he doesn't capture it? I think it's because he cannot see it because it's on a hill and surrounded by forrests. I hade that very very very many times when Quechua-rushing.

There are a lot of reasons for that potentially, not the least of which is when the AI runs the script to "choke" you by placing a unit or small group on a defensive tile in your borders and just sitting there unless you have a weaker unit or worker stand near it. AIs LOVE this tactic, and I find it a bit dubious that an experienced HoF warmonger such as yourself isn't aware of its existence.

Also, as kesshi says archers only have 1 movement point, so unless it's immediately adjacent to your capitol said situation really doesn't refute the "can see anywhere it can move".
 
-.-

You really had a bad day.

I am aware of camping Archers.

I still don't understand how the AI is cheating, and would like to know, because that would be good for my game. If I understand you right, the AI can see any tile it can move too so it has no Line of Sight that gets broken by anything?
 
^
I am currently looking (since 30 min ago) for that issue I postponed way too much due to laziness.

Choke script doesn't exist , but many testing indicates UNITAI_PILLAGE is the exact script.

Me too, prince and monarch levels are really risky levels for worker stealing as their first scout unit is either a warrior or an archer (for those without Hunting). But ,always, they get UNITAI_EXPLORE, which makes them flinch the moment we get a decent city defender and as long the said unit doesn't have overwhelming odds (like an archer vs our warrior) being next to city.

UNITAI_ATTACK_CITY archers will go after the city no matter what, but they arrives as stacks and much later. The AI train a bunch of archers before going all the way to our city and hence the power of choke...because the AI is not bright to see two archers are sufficient.

UNITAI_RESERVE...I have no idea what's that behaviour. But they are not interested in exploring the surroundings of our city.

Few things can be exploited from these assumptions except one interesting detail: the unit tendencies to fortify on a defensive tile that is the most NW. Why such behaviour?

^
most of the code is like that
Code:
for (iDX = -(iSearchRange); iDX <= iSearchRange; iDX++)
	{
		for (iDY = -(iSearchRange); iDY <= iSearchRange; iDY++)

....
so the checks goes like that: most west-most/north-most most westmost/2nd north(a south)....
westmost-but-one/most-north... east-most/south-most

Actually reading the thread I was quite surprised it took quite a lot of time to find AI_searchRange since it's used so much (almost everywhere).
Recon missions add visibility like removing the fog for the player and there are quite a bit of cases when the AI checks the visible defenders.

So, if I understand well, the pillage scripted archer coming from west and a defensive tile is available around NW two tiles away from city square, the archer will do the sitting duck as long you don't put a weak unit by him, making the KILL KILL KILL rule overwhelms his typical pillage script.
And to give a random example, I clearly remembered in my poor BOTM52 attempt, an english archer (most probably under UNITAI_PILLAGE spell) remainded on a hill NW of my capital. And further testing I am currently making still procede the same way. That's quite interesting. But how to differentiate UNITAI_EXPLORE archer from UNITAI_PILLAGE. That's the question.

But they are so many weird behaviours, likely due to RNG. Thus it is hard to make something clearcut.
 
-.-

You really had a bad day.

I am aware of camping Archers.

I still don't understand how the AI is cheating, and would like to know, because that would be good for my game. If I understand you right, the AI can see any tile it can move too so it has no Line of Sight that gets broken by anything?

Oh, Seraiel, be more patient sometimes. Do I ever tell the story where in my first 10 posts in HoF, I received a huge diatribe targeting me, just me. And it was pretty caustic. My reaction wasn't: f-ck you, b_tch!
But instead an apology because a lot of truth was oozing from the big post.
I was a newbie and I wasn't in position to fight back. That is why I can't forgive... Sojuz. Blantant misinformation + you are all morons attitude = me :mad: .

As the explanations, I gave some parts elsewhere, so let me quote it.

Code:
int CvUnitAI::[COLOR="Red"]AI_searchRange[/COLOR](int iRange)
{
	if (iRange == 0)
	{
		return 0;
	}

	[COLOR="Red"]if (flatMovementCost() || (getDomainType() == DOMAIN_SEA))
	{
		return (iRange * baseMoves());
	}
	else
	{
		[COLOR="Red"]return ((iRange + 1) * (baseMoves() + 1));[/COLOR][/COLOR]

Basically, the AI's don't have an extended sight of fogbusting ( a terrible mistake I assumed in the thread elsewhere), but has a special search for victim function called AI_searchRange. In fact, AI unit has a pretty normal fogbusting ability, but has some sort of limited omniscience.

In the condition if, it tells all units with flatMovementCost() (which means units that doesn't consider terrain cost like gunships(not sure for gunship though) and explorers) or Navy units has a limited omniscience of their base movement points. So I suppose a gunship sees as far as 4 tiles (but testing shown differently, so I'm not sure).
Roading seems to change a little the way it works.

But for navy, it's pretty direct. If a navy has such movement points, it sees as far as :move: restrict. But still, I don't understand how a barb galley can see as far as 7 tiles. So I am confused too... :p

In the "else" part, if the said unit doesn't correspond the first condition, then in {return ((iRange + 1) * (baseMoves() + 1));} rules.

For 1 :move: units, it omniciently sees as far as 4 tiles away.
For 2 :move: units, it omniciently sees as far as 6 tiles away.

And you may notice it dovetails well with engineering type of roads for 2 :move: units. But that's a supposition of mine.
 
But for navy, it's pretty direct. If a navy has such movement points, it sees as far as restrict. But still, I don't understand how a barb galley can see as far as 7 tiles. So I am confused too...

It's a different function, no? Tied into how the barbs search for tiles to pillage although it wouldn't surprise me if naval had its own code for barbs. There's also a delay between making the fishing boats and the barb galleys being able to "see" into it. Land barbs operate on that "target city" type script too so they're a bit of a special case.

I still don't understand how the AI is cheating

Tachy's done that part pretty well. I believe I've already explained about AI detecting worst enemy trades you make before they actually meet you and that's a big one too. Upgrades are technically cheating too since their cost reduction is *independent* of difficulty and undocumented in any set of rules presented by failaxis that the player can see without resorting to looking at the code directly...but everyone knows the AI has reduced upgrade costs. Still, technically that's cheating too :lol:.

Abusing the "route to" script on enemy workers is comical, until you realize it happens to us too. Firaxis is a big fan of putting features in the game and then making sure they don't work (control, alt, shift clicks, route-to, auto workers, interrupting units with movement orders when an enemy obstructs them, interrupting movement orders on a unit that will move adjacent to an enemy).

I can't count how many times I've had a catapult waypointed to a city, an enemy HA is in its way at the start of the turn, and AS I TRY TO CLICK ON THE CATAPULT TO STOP IT, the game FORCIBLY MOVES IT next to the horse archer. Now, THAT isn't AI cheating, but it is a disgrace and falls under that "bug" category. It's difficult for me to forgive that they made it to bts patch 3.19 without fixing known and long-standing control errors...but felt the need to make barb galleys spawn 4x as much (without playtesting it; the only cost effective way to deal with them on high levels is to abuse spawn and movement code, not fight them directly), bug overflow (apparently permanently, double fail), and nerf protective trait. Really? THAT was necessary, but not making the controls work consistently?

If I sound a bit bitter over it, it's because I am, especially because I watched many of the exact same mistakes find their way into civ V, ignored. Units still moved next to danger last I played, and I still watched civ V governor change tiles worked AFTER end turn to STARVE a city. I ordered a treb, clearly displayed to make a "ranged attack" on screen, and it simply moved towards the enemy city without attacking at all...all while the game runs at a snails pace despite being a TBS so that I spend half of my time "playing" the game waiting to be able to do something. THAT is why I'm still playing civ IV, but unfortunately civ IV has a lot of these problems too...

Watch how many times in my let's play of the 2 warlords II maps I did where my units moved against my will at the start of the turn into danger. Watch how many times I tried to select or unselect a unit and the game simply forced me to select all of them (again). Watch how many times units run into an enemy and re-path without prompt. Watch how many times the game "thinks" I'm pressing "alt" and declares without prompt. ZERO.

Now, in my civ IV let's plays, all of the above is routine. It's rare that I go a game without the majority of them happening (the unit selection issue is shown in nearly every let's play I do).

The last tidbit is that Warlords II was made in 1991. Civ IV came out well after 2000. A game that is SIGNIFICANTLY more than 10 years older than civ IV and nearly 20 years older than civ V runs CIRCLES around failaxis when it comes to basic gameplay controls and how the game runs its engine vs computes of the game's time. I don't want to hear excuses about how programming working controls is "too hard" or "too expensive". It's a joke, and it's sad that a game with such depth and great strategy as civ IV is marred by the fact that basic controls don't work, the AI cheats, and the interface lies.
 
stick gandhi + shaka next to each other in world builder with different religions, meet gandhi, trade him a big tech, then meet shaka. -4 worst enemy trade. WE can't detect AI-AI trades before we meet the AI.

99% of the time it's obvious. Change places with Shaka - in his position who would you think traded Gandhi the big tech he just got out of nowhere?
 
Back
Top Bottom