Does Better AI remove AI cheating?

alacast

Chieftain
Joined
May 7, 2010
Messages
5
One element of Civilization IV that has perpetually annoyed me is the computer opponents playing a fundamentally different game from the human player. I recently installed an individual's patch that reduced AI cheating, but there's still one feature that remains: the AI's ability to simply spawn new units without paying for them*. Does Better AI remove this? If not, what other mods/patches do this, if any?

*In one particularly egregious case, while playing on Noble a neighbor civilization had two warriors by turn 5. Turn 3 I saw their warrior near my borders, turn 4 I declared war and moved my warrior adjacent to their city, and turn 5 a second warrior spawns in the city, while the first warrior is still in site of my city. This sort of behavior basically kills the entertainment value of the game for me. Thanks!
 
Um, I don't think the AI has ever been able to just spawn units out of thin air. You sure that he wasn't running slavery and simply whipped a warrior when you declared on him?

Other than that, yes the AI does have many handicaps(and these change depending on the difficulty level you choose) to help it against the human. I'm not sure if BetterAI has actually lowered the bonuses yet(I'm sure somebody else knows better), but either way, the AI simply cannot offer a good challenge if you were to remove all its bonuses. You have the brain, AI has the bonuses.
 
Um, I don't think the AI has ever been able to just spawn units out of thin air. You sure that he wasn't running slavery and simply whipped a warrior when you declared on him?

This is the hypothesis typically given when this accusation is made, and if it's later in the game slavery is typically an option for the production of one unit out of thin air. But in the case of popping multiple units, or in the very early game, as I described, this just isn't possible. There's no way to have slavery in the first five turns, is there? And slavery won't work if the city only has one population (which it did in this case, because it was turn five). If I'm missing some possibility, let me know! This was on BTS patch 3.19. For any that are doubting that this occurs, I think I may still have the saved game file for that particular example and can post it here.

Obviously, for many players this isn't an issue for the game being fun. You're completely correct that we need to give the AI some sort of advantage, because as of yet many times it's just not good enough to challenge a human, let alone beat it. But what really kills the fun of the game for me is when I don't even know what game the AI is playing! Especially for players who like to try to make early kills in the first few moves of the game, not being able to accurately describe the capabilities of even one unit and one city, because the opponent can use magic to alter the nature of the game, is very frustrating.

Thanks for the help!
 
You're trying to rush the AI with a single warrior? Now that's a bit lame. Anyway, the behaviour you see is caused by INITIAL_AI_CITY_PRODUCTION which is set to 10. It's one minor advantage the AI has over the human to prevent such cheap rushes.
 
Attached are two such examples. For the Turn 5 example you should observe the opponent's Scout, then declare war and make the attack, revealing a warrior on the capital city. On the previous turn, turn 4, your warrior had been one tile south, on the hill, seeing Moscow unoccupied, but I hadn't saved then.

In the turn 5 example if you explore around you can see the opponent doesn't have access to enough hammers to produce a warrior in 5 turns (there are no tiles that produce 2 hammers, meaning a total of 3 hammers/turn available). In the turn 4 example the Romans do have access to enough production, but they haven't had enough time.

Again, if the AI had production discounts it might be able to pull this off, but those should be disabled with the patch I added.
 

Attachments

  • Turn 4 Example.CivBeyondSwordSave
    73.4 KB · Views: 275
  • Turn 5 Example.CivBeyondSwordSave
    71.4 KB · Views: 207
You're trying to rush the AI with a single warrior? Now that's a bit lame.

That's all a question of playing style. I enjoy snagging a city early on if I can.

Anyway, the behaviour you see is caused by INITIAL_AI_CITY_PRODUCTION which is set to 10. It's one minor advantage the AI has over the human to prevent such cheap rushes.

If you think it's cheap, that's fine. And if the game producers think it's cheap, and don't want it to be viable in their game, that's fine, too! What irks me is when this isn't illustrated to the player, but is hidden behind undescribed advantages to the AI. Now that I know about this initial production advantage, however, I can account for it, which is good! Better than not knowing, anyway.
 
Instead of accounting for it, just edit the XML and remove it.

Note that the AI is programmed not to rush players in the first few rounds of the game. The proper way to fix this would be to either have the AI do blatant "0 round" rushes, or beef up every players defences (so everyone starts with at least one warrior, and civilizations with hunting also start with a scout).

That makes the early game rush more of a gamble (as the defending player has a fortified warrior).

Going a step further, starting with 2 warriors might be required (to make a civilization with a production edge producing a 2nd warrior and 2-on-1ing less ridiculously powerful).

2 fortified warriors (+50% defence, maybe even +70 if the city borders pop) have a decent chance of holding off 3 attacking warriors. And failure for the attacker is pretty deadly, as they just emptied their own defences.

An alternative approach would be to make civilizations "round 0 bloodthirsty", but that would generate a whole bunch of randomness. It would also make non-noble starts pretty impossible for humans (as multiple archers attack your single warrior).
 
Everything you said, Yakk, makes sense. I don't have any problem with the game being carefully tweaked to have particular dynamics, such as no turn 1 rushes. The issue is just when the player isn't able to figure these things out with the data available to them during gameplay, but has to sift through an XML file to determine that certain strategies are untenable. Hopefully mods like Better AI can improve on this situation, and maybe we'll even get lucky in Civ 5.

Thanks for the help!
 
Any significant vulnerability to an immediate rush for an AI would also require you, the human player, to be equally vulnerable, adjusted for difficulty setting, or it wouldn't be balanced. I personally would not want to begin every game knowing the game could end for me 10 turns later due to something I have absolutely no control over, which is completely subject to the personality and proximity of my neighbors, and which would therefore feel extremely cheap.

Much more serious problems (present in a disturbing number of games in the past because they didn't have the programming expertise to write good AI) are things like AI's accessing knowledge that, by the game rules, should be off-limits to them, such as knowing what is going on in map fog they have no vision of, what the world looks like before exploring it, etc. I can definitively assure you that Civ4, with no help needed from BBAI, has always been impressively flawless in this regard. The entire vanilla codebase was extremely well-written as programming projects go, and that means the game commands significant respect. Yes they could've documented the AI's free starting defenders more clearly, but it's the kind of isolated issue you learn about pretty quickly and then either continue playing, or mod it how you want it instead. But it's not an ongoing, systemic problem where losing interest in the game might be justified.
 
Actually the AI does cheat a little with regard to fog of war. For the AI each units vision range is the same as its movement range, if greater than regular vision range.
 
Actually the AI does cheat a little with regard to fog of war. For the AI each units vision range is the same as its movement range, if greater than regular vision range.

ORLY? Well that's disturbing. Guess I'll have to fix that. Though that does explain why the speed 3 Cheetah animals in my mod always lock-on to our units from 3 tiles out, in the fog. Fine, the AI is ALMOST flawless in this regard lol. Thanks for pointing this out; should be easy to change.

The AI completely ignores the fog for the purpose of finding new city locations though (and it'S still qite bad at it, ironically)

Well this I can understand; we often allow scouting ahead a number of turns then going back to be able to make better beginning city-placement decisions ourselves in our games (and it's what the demolish city feature in my mod is for if necessary), so I can pretty much forgive that, but it still wouldn't hurt to fix this either, especially if it's still so bad at it... But JDog had worked a lot on the city placement AI already I thought.

But yeah, looks like I was wrong about the fog and map issues. It still doesn't look at an enemy's force distribution under fog to see what the best target city would be, or where an attack is going to be coming from... right? Please don't say it does lol.
 
I'm not saying there have been no improvements but occasionally the AI still puts cities in strange places, most likely because of max distance but even that can't explain situations like this (I think the recommendations for the human player use the same code).
 
I'm not saying there have been no improvements but occasionally the AI still puts cities in strange places, most likely because of max distance but even that can't explain situations like this

I don't see anything wrong with that location... it eliminates any overlap with the city to the NW and minimizes the amount of desert in its radius.

(I think the recommendations for the human player use the same code).

It does, yes.
 
AI is given hammers in 1st city to offset 1st warrior rush deaths.

But simply put betterAI doesn't remove much AI cheating because that's not the primary scope of betterAI. The AI cheats in all kinds of ways you're not aware of lol.
 
AI is given hammers in 1st city to offset 1st warrior rush deaths.

But simply put betterAI doesn't remove much AI cheating because that's not the primary scope of betterAI. The AI cheats in all kinds of ways you're not aware of lol.

Apparently I forgot how sucky the pure vanilla game is, since I've played exclusively with my mod for years now. This particular issue is easily fixed by setting INITIAL_AI_CITY_PRODUCTION to zero in GlobalDefinesAlt.xml, which I did so long ago I'd forgotten about it heh, so I don't really see this as a problem.

I am keenly intent on evaluating all instances of AI cheating though, and think/hope it's pretty much limited to what's been mentioned so far in this thread.

Actually the AI does cheat a little with regard to fog of war. For the AI each units vision range is the same as its movement range, if greater than regular vision range.

Having just taken a good long look, I cannot find any evidence of this in the code. Are you guys sure about this?
 
Actually the AI does cheat a little with regard to fog of war. For the AI each units vision range is the same as its movement range, if greater than regular vision range.

Having just taken a good long look, I cannot find any evidence of this in the code. Are you guys sure about this?

I'm no AI expert, but I seem to remember hearing about this before. IIRC it's only a problem with naval units who have lots of movement points.
 
I'm no AI expert, but I seem to remember hearing about this before. IIRC it's only a problem with naval units who have lots of movement points.
You can find a more detailed discussion of this in here ( especially the posts by Dresden and DanF5771 in page 2 ).... and in fact, it is quite the oposite of what you say, given that land units receive a bigger bonus than a water one with the same moves per turn ;)

I think, as most of the people in that thread , that this feature is a simple mock up of memory of the other civs troop locations by the AI, given that it has no native way of remembering that it saw a unit 2 tiles away in the previous turn. But yes, it gives a lot of probably excessive help to the AI :/
 
You can find a more detailed discussion of this in here ( especially the posts by Dresden and DanF5771 in page 2 ).... and in fact, it is quite the oposite of what you say, given that land units receive a bigger bonus than a water one with the same moves per turn ;)

Interesting. Thanks for that link, I hadn't seen that thread before and there's a lot of good information there. I'm going to leave this alone for now b/c restricting them to actual fog would be crippling as things currently stand, even though I could easily implement that now. I would love to see the AI need to make use of Sentry promotions, other units placed a bit further out for vision, aerial recon missions, etc... but for that to work the key thing imo is something no one else has realized yet: the AI units would need to move one tile at a time and re-evaluate their mission and destination each tile in case they discover an enemy unit (or goody hut) mid-move, like humans do. That's actually something I might be able to code but it's not quite trivial heh (and would probably slow down turn processing considerably, when you factor in all the normal speed-1 units that are still moving up to 10 tiles per turn b/c of Railroads or whatever).
 
An easier solution is to give units a vision radius of based off of their ability to move. Ie, each unit can see (movement bubble) plus (vision range) on their turn.

Then the AIs mode of movement decisions would work for players.
 
Top Bottom