Report Questionable AI Behavior

:( I probably shouldn't post this.


if one wants to play optimally he'll produce all military units in a single city with all the GGs settled there.

I can't believe you actually believe/do that! If I have 7 cities and each city can produce a unit in 2-3 turns why would I Ever penalize myself by Only building units in 1 city? Even if that 1 city produces a top unit every turn the numbers will not match up, even with GGs present. If I Need that 1 producing city to send defenders to the borders, the time to get there vs I can build another defender in the closest city is still not as effective. I need that defender before the enemy gets there. Especially early game when GGs are scarce to non existent.

following this most cities of good player will not produce any military units ever.
Why would you follow this path? Shaka would eat you for lunch. You could possibly use this strategy Late game where you have a core group of cities well inside your empire that the AI would have a hard time getting to.

killtech, you keep extrapolating that your way of playing IS THE ONLY way to play ("cities of good players") but it IS a fatal flaw in your reasoning. It is egotistical/arrogant to presume you have the optimum way. So your vision is tunnel and not broad. This is hampering your modmods development and usage imho.


thus the -90% production penalty is ignorable. AI is too stupid to understand this strategy thus it's ok it doesn't build it (it would produce military in the olympic city).

Regrettable. :nuke:

JosEPh :sad:
 
It might be. A quick question, if a unit is escorting a settler, what unitAI is it? UNITAI_SETTLE? UNITAI_CITY_DEFENSE?
Yeah, that's the interesting part. Short answer: UNITAI_CITY_DEFENSE (most of the time, escorts can run other cityUnitAIs or even ANITAI_ATTACK).
A selectiongroup is controlled by the unitai of the headunit. The headunit is the unit with the highest AI_groupFirstVal (identical AI_groupFirstVal means the AI_groupSecondVal is used for ranking). The other units in the selectiongroup can all run whatever unitai they want, it simply doesn't matter, they are all lemmings following the headunit. And as far as I can see, that lasts until the headunit dies, which is soon and forseeable in the case of the settler that disappears upon founding the new city.
If you tell a unit with UNITAI_ATTACK to merge with a UNITAI_CITY_DEFENCE, it will either forever be controlled by the defender and never move out of the city again, normally. If that attack unit has a higher AI_groupFirstVal and can't run UNITAI_CITY_DEFENCE (AI_unitValue <= 0), then it will make the city defender tag along while it continues to be controlled by the attack unitai.

.

edit: So UNITAI_SETTLE has the highest AI_groupFirstVal. No matter what does the escorting, the settler will always lead. Which means I have no clue whatsoever what could cause the endless looping.
 
I can't believe you actually believe/do that! [...]
well actually i build troops in other high production cities from time to time when i need some additional cannon fodder. but these are only a few cities, the rest will never waste time on military. that has become more of a constant since i stated with the RoM/AND mod. the truth is that i don't build more military because i honestly don't need more. yes, it often leads to strange situations that i have a power ratio towards other civs of below 0.5 but it never turned out to be a problem. the high experience of my troops is more then enough to compensate that. i mean why should i have more military if my veterans have a >99.9% chance of survival on attacking an enemy unit? if you remember i had often pointed out the broken promotion system - it's too powerful and the AI doesn't understand any bit of it. i also wanted to limit GGs per city...

actually when i deactivated experience system (originally by Afforess bug, then by setting level 1 XP to 1000) and stated to play with random civs, i built more units and in more different cities (but still not all, just the highly industrial cities). i still play with this change but i assume it to be non-standard.

the problem seems to be that fighting strategies based on not loosing units and getting their XP up are too efficient because they result in next to zero casualties which implies higher experienced units which again win with higher chances to gain more XP. additionally you get more GGs to boost the XP of units when they're created. and since you don't need to spent that much time on military production (few losses=>few replacements needed) you build economy buildings resulting in faster growth, production) & research which boost further production of economic buildings. and it makes your totally over-experienced units the most advanced in the world.
... so it's a snowball effect (actually multiple) which produces invincible troops. because i value economy more then military i automatically fall into this snowslide. it's because eco helps you on the longer term, while military is something for few moment. and military is a waste when you are at peace.

as for shaka...
Spoiler :
he's the weakest AI from all. he builds so much military that he falls technologically totally back and you can harvest safe XP for your units. Impies are no match for axemen & swordsmen - no matter in what numbers. all you need to do to defeat Shaka is to wait until he kills himself. he doesn't build any economy. to illustrate how self destructing his policy is i remember an old game where i played with minor civs option (don't do that any more because it's totally broken for AI): i wanted him to become my vassal but he avoided to research so i cannot contact him... when i reached industrial age he was still researching pottery(!) and i finally gave up and razed his cities. btw. tech leaking option was on...


@Afforess:
you can see my post about the big difficulties the AI still has, so it's quite on topic.

EDIT:
killtech, you keep extrapolating that your way of playing IS THE ONLY way to play ("cities of good players") but it IS a fatal flaw in your reasoning. It is egotistical/arrogant to presume you have the optimum way. So your vision is tunnel and not broad. This is hampering your modmods development and usage imho.
i don't interpolate anything. i call achieving invincibility and total dominance independent of the starting parameters as 'optimally' because there doesn't seem be any other possibility to beat the game that easily. it's not my fault that the game design of Civ/RoM/AND allows such and strategy. and certainly it's not the only way to play civ. why would it? as described above i've modified the game for myself such that it doesn't work for me.

in my post i mealy described a strategy where you can put this wonder to good use. in general if you have more then 10 cities putting one aside for economy only specialization is a good option - but not a necessary one. depends where you are heading. so what? giving someone an advise how to go around a penalty is "egotistical"/arrogant??
 
1. As for military production I follow Killtech's idea but of course during the peace time. I also voted for GG settlement limitation. At this moment it seems reasonable to keep producing units in one city only.

2. As much as I want to hear other opinions, I can hardly understand Joseph's philosophy. I think (and believe me, I'm not 20 years old either) that instead of claiming that the game becomes too hard, it is better to adjust your playng strategy to follow up. After playing many games in CIV II, it was indeed hard for me to abandon fast expansion strategy, which was the only way to win in CIV II. Besides, we have 8 (?) difficulty levels so indeed, everybody can find its home, I guess.
 
I migh tbe able to go back and find the save where I noticed the bug, but basically, a city surrounded by a jungle reporting have a worker, when it had none. The empire only had 1 worker for the three cities, and it was close to 25 tiles away, working. When I changed that code, the city corrected itself, and it reported the number of workers correctly...

I'll try to reproduce it in Better Bug AI this weekend.
I'm getting the Assert message that the AI has less workers than it thinks it has quite frequently even before any player has founded a second city. Looks like whenever a worker finishes whatever it was doing (moving to a certain plot, building something) it gets counted twice. But even if I am right, and a worker can run MISSIONAI_BUILD while not having the group activityType ACTIVITY_MISSION at the same time, it wouldn't explain your example when the one worker was still building something that was not a road to the other city; I can only explain why one worker can count as 2.
 
I'm getting the Assert message that the AI has less workers than it thinks it has quite frequently even before any player has founded a second city. Looks like whenever a worker finishes whatever it was doing (moving to a certain plot, building something) it gets counted twice. But even if I am right, and a worker can run MISSIONAI_BUILD while not having the group activityType ACTIVITY_MISSION at the same time, it wouldn't explain your example when the one worker was still building something that was not a road to the other city; I can only explain why one worker can count as 2.

I've been using my custom change, and I have only got the asset a few rare times, when workers aren't inside a cities working radius, IE, building a road through unowned land. While I can't explain my situation; I would favor the side of false negatives (we think we have less workers than we have) than false positives (we think have more workers than we have). I don't see any good way to count workers who are building a road through wilderness...
 
Your way of worker counting should however exclusively give you false negatives, and they would occur when workers are outside city radius. And that would be intentional. False positives should be impossible if you use plotcount like that
pLoopPlot->plotCount(PUF_isUnitAIType, UNITAI_WORKER, -1, getOwner())
Code:
FAssertMsg(iTotalWorkersHave [B]<[/B]= (iNumWorkerAIUnits + iTotalWorkersFinishedSoon), "Player has [B]less[/B] workers than he thinks he has");
This assert only checks for false positives though, so if you're saying you get that: how does that happen?

edit: I fixed worker counting too. The hard way.
 
A new savegame for you to test out AIs, maintenance costs, etc, etc... :D

AND Log and again remember to remove Warlord from Custom Units
Spoiler :
Installed Components:
{Required Files} Sports ANM {Better RoM} {Building Upgrades}

Install Type:
Custom

Version:
1.74

Install Directory:
C:\Program Files (x86)\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\Rise of Mankind

Windows Version:
Windows
 
Newest savegame for analysis. I'm now in Modern Era. However, I have Mercy Rule on so it says I'm going to win soon. Good game this time :D. Next time I play this mod, I play with Prince as maximum.

As always use that RoM-OS79 folder :lol:.
 
This is a completely new game. Same setup as before except that I turn off Ruthless AI and push up the Flexible Difficulty maximum to Prince.

It is now at Classical for my civ. I will post savegame each time I enter a new era.

The AIs seem to be better this time. However, I can't say for sure until I go into conquering mode :). Yeah, yeah, I'm supposed to be a "bleeding heart :rolleyes:" progressive but in my games I love to be a aggressive conqueror for my empire's glory :lol:.
 
When the chinese researched Vassalage, 7 minor states directly joined his empire as Vassals.
 

Attachments

  • Vassals.jpg
    Vassals.jpg
    88.6 KB · Views: 111
When the chinese researched Vassalage, 7 minor states directly joined his empire as Vassals.

The AI is better at telling when it's the underdog, and I suspect that the first vassal was because that player was very weak. That made the Chinese seem stronger, which caused the second player to vassal, which made the Chinese seem even stronger, which...

Feedback loop. Anyway, it's not a bug. Have a fun game! ;)
 
Medieval Era now... Actually, a Great Prophet pushed me into Medieval era :lol:.

My reports so far?
I had not had chance to conquer yet but from what I can see from scoreboard only, Carthage is on a good track (at least for a game without Ruthless AI on). It have a good number of cities (check whether it is hurting itself with that amount, maybe?) grew faster in this game. The power ratio of other civs vs me had not dived into two digits yet, but again I hadn't a chance to go conquering yet.

So, still need analysis by you but I'm feeling this may be a good game like the last game :).
 
My proposal on Realistic Cultural Spread:
How about for Ancient and Classical eras only you code AI workers to recognize that a tile is within a city's workable radius and go ahead and chop down forest/jungle after the other workable tiles are done with. Reason: you, Afforess, said before that AI can not see far into future so they cannot plan well without tools at hand. Therefore, in Ancient and Classical eras, they are without buildable culture in the city and without the scalable culture because they are gotten in techs Music and Drama respectively (actually Drama comes first). So, in Ancient and Classical eras, it should be worth the loss of production from chopping forest/jungle outside of temporary cultural limit so that the culture can spread to workable tile(s).

In my game, the AIs were doing much better but I had Realistic Cultural Spread on and it handicapped AIs more than me in Ancient and Classical eras.
 
I just saw the AI send a team (5 units, since I have 5 units/tile activated) of powerful units (one of them was a warlord) into a big tundra plain, stopped there for a couple turns (to heal?) and then walked back (at that point they all had about 20% of health left)....and all of them died before they made it out....

I think that qualifies as bad AI decision.

PS, 1.74G
 
Wow, just wow...

The Arabia's capital, before I finally conquered her, was a tough city. I started out with a GC, 5 Riflemen, 5 Grenadiers, and 5 Cannons. The city wore my stack down to a GC, 3 of others. And Arabia was a far down in scoreboard and power ratio! A very good fight :D.

Well, it is now in Industrial era. I have the largest empire. But I'm suddenly not so sure about my rapid victory in this game :lol:. Oh, I will win, but not as fast as the last game.

That means I was right about Ancient and Classical eras weakness of AI in relation to Realistic Cultural Spread. Because in the later eras, they catches up fairly fast :lol:.

Definitely looking forward to the challenge of winning this game :satan:.
 
Spoiler :
Installed Components:
{Required Files} {Military Civics} Sports ANM {Better RoM} {Civic Diplomacy} {Building Upgrades}

Install Type:
Custom

Version:
1.74

Install Directory:
D:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\Rise of Mankind

Windows Version:
Vista
patch G
View attachment 261046

View attachment 261045

Assuming I have the correct screenshot here, you can see the AI is significantly overproducing missionaries (Mastery victory is on, so maybe he was trying to score points towards that?). At one point in this game, something like 8 of the twelve civs were running that religion, and as he founded it, obviously he had been spreading it for a while. But that one stack has around 60 missionaries and between all the stacks, I think there were more missionaries than cities in the game

I cleared some of this up in later turns by sending warlords of various strengths wandering around his territory. He doesn't seem to register that the warlords are a threat to his 0 strength units, so I wiped out sizable stacks of workers and missionaries most of the evening.
 
(abusign this thread for more code review)
In revision 258, SelectionGroupAI.cpp: You added stack attack for the AI (2x):
if ((!isHuman() | isAutomated()) && getNumUnits() > 1)
I assume you meant the logic OR "||". Not really a bug since bitwise OR will give you the same result in the end.

"Compare City Maintenance to Next Largest Empire"
Better RoM addition iirc: For every nation, the maintenance scales with the number of cities in comparison to the largest civ. Only for the largest civ, it scales to the number of the 2nd largest?
I think it's bad practice to mistreat a single empire like that. Use one number for all, either 2nd largest, average, 80% of largest, doesn't matter. Just don't treat one civ completely differently from all others.

But most importantly: The "Civic Vacuum". What you are doing is creating a complete vacuum, and making all decisions based on the vacuum values of the civics. That is NOT how it works.
Remove that vacuum thing and use the "imperfect kludge/hack" for AI_civicValue() instead (see LM post), that will at least not cost you that many cpu cycles.
Alternatively, create vacuums only for one civic option at a time, while you are evaluating the civic for it. I hope I can have a version of that ready this week in case you don't know what I'm talking about.
 
"Compare City Maintenance to Next Largest Empire"
Better RoM addition iirc: For every nation, the maintenance scales with the number of cities in comparison to the largest civ. Only for the largest civ, it scales to the number of the 2nd largest?
I think it's bad practice to mistreat a single empire like that. Use one number for all, either 2nd largest, average, 80% of largest, doesn't matter. Just don't treat one civ completely differently from all others.

That code is specifically designed to curtail the player (as they're usually the civ with the most cities) and give the AIs a fighting chance for research costs. I think we may find its slightly unnecessary once the AIs stop leaving 22 missionary units in their cities costing them bonus gold.
 
Curtailing the human player to give the AIs a chance, that's what difficulty levels are for, those should be modded/extended if that's all this is about. The "largest amoung the rivals" is not as ideal as it seems, it's just unfair.
 
Back
Top Bottom