Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AI fields large armies that sit around and do nothing #5856

Closed
RecursiveStar opened this issue Nov 19, 2019 · 29 comments
Closed

AI fields large armies that sit around and do nothing #5856

RecursiveStar opened this issue Nov 19, 2019 · 29 comments

Comments

@RecursiveStar
Copy link
Collaborator

RecursiveStar commented Nov 19, 2019

1. Mod version (i.e Date - 4/23): Latest (with latest hotfix)

2. Mod list (if using Vox Populi only, leave blank):
Ingame Editor
Archaeology Aesthetic Adjustments
Calypso's Colored Religious Icons
Faster Aircraft Animations
Quick Turns

3. Error description: @ilteroi
I created a Duel map with Rome to test something unrelated. As part of this test I DoW'ed him, but even before my DoW I noticed an issue.

Rome is producing many units but they're just sitting around doing nothing in their borders, costing unit maintenance, and only leaving to escort Settlers. They aren't even patrolling.

Additional issue: Rome produced two Workers, but despite having researched both Mining and Trapping, they haven't bothered to improve the Hill/Deer tiles very close to their capital - the Workers are just sitting in the city doing nothing as well.

This issue has also been observed with France in the forum thread, wherein he declared war on another AI twice but never moved the majority of his army either time (https://forums.civfanatics.com/threads/new-beta-version-november-8th.651590/page-14#post-15597743). A screenshot of the issue is in this forum post.

Quoting from an earlier post, "Napoleon is useless, even in his war with Attila he didn't even move his army, and just peaced out doing nothing. He had a ton of space and went 10 city wide from the start, now he's fallen behind me and Attila in score, and I can't even use him to make up for my gold deficit because he doesn't have any money either."

Logs and screenshots for my encounter are attached.
Logs.zip

Screenshots of Rome's army and workers largely not moving, turn after turn:
Screenshot (20545)
Screenshot (20546)
Screenshot (20547)
Screenshot (20548)
Screenshot (20549)
Screenshot (20550)
Screenshot (20551)
Screenshot (20552)
Screenshot (20554)

@ilteroi
Copy link
Collaborator

ilteroi commented Nov 19, 2019

can the romans even embark?

also, can you make the map smaller? this isn't a very realistic case, your borders aren'r even touching

@RecursiveStar
Copy link
Collaborator Author

RecursiveStar commented Nov 19, 2019

In the linked forum post, the case was more realistic, I was just pointing this one out as it seemed unusual, given that they aren't even patrolling - they seem frozen.

At any rate, the Workers' behavior is still unusual.

Not sure if they could embark, that might be the cause - will test.

@LoneGazebo
Copy link
Owner

@HeathcliffWarriors it's sooo much easier to diagnose stuff like through the IDE, I do hope you're using it now. Attach to process and follow the breakpoints...

@RecursiveStar
Copy link
Collaborator Author

RecursiveStar commented Nov 19, 2019

@LoneGazebo I will figure out how to use it before my next pull request...wanted to prioritize the diplo stuff to improve player experience, but I've made all the changes I intend to for now, so I'll work on installing VS and figuring everything out. I'm sure it'll save much time in the future :)

@LoneGazebo
Copy link
Owner

Just ran a standard 8 on y'all's latest, very little conquest going on, even amongst warmongers. I can repeat note that armies do not appear to be doing much.

@RecursiveStar
Copy link
Collaborator Author

@LoneGazebo Is the problem the diplo AI not declaring war or the AI not attacking after war was declared?

@LoneGazebo
Copy link
Owner

yes

@ilteroi
Copy link
Collaborator

ilteroi commented Nov 20, 2019

what does the operation log say? what types of operations are they setting up, are they aborted, if yes why?

@RecursiveStar
Copy link
Collaborator Author

RecursiveStar commented Nov 20, 2019

I meant which is it :)

If it's the diplo AI then I can address it, but I'm nowhere close to skilled with the military AI, that's firmly ilteroi's domain :)

If it's both the diplo and military AI, my suspicion is that the AI is not moving their army in place to DoW when they're preparing for WAR, and since they don't DoW until their army is in place to attack, they're not attacking.

EDIT: Will be sending a pull request with diplo AI improvements to encourage conquest; any further issues should be on the military AI's end.

@RecursiveStar
Copy link
Collaborator Author

RecursiveStar commented Nov 20, 2019

#5861

...okay, now I'll work on figuring out the IDE :)

@LoneGazebo
Copy link
Owner

@ilteroi here's an example

image

Sneak attack went off fine, Operational and Diplo AI are functioning okay. AI did a good job of setting up an attack...and then the units just bled away. Spearmen went back to garrison, archers failed to stay to attack, they wandered off to stand (not defend) by Nimrud.

Siam's units also remained near Sukhothai, did not really counterattack.

@LoneGazebo
Copy link
Owner

image

Here, Zulu did a good job of taking a city, but Assyria just set back and watched it happen.

@LoneGazebo
Copy link
Owner

Turn of war start for Assyria v. Zulu,

Line 122336: 112, Assyria, Zone ID: 1932, Land, Nineveh, Steamroll
Line 122337: 112, Assyria, Zone ID: 1494, Land, Kar-Tukulti-Ninurta, Counterattack
Line 122338: 112, Assyria, Zone ID: 1359, Land, Nimrud, Hedgehog

Steamroll is an odd choice for defending Nineveh.

@LoneGazebo
Copy link
Owner

Another example:

image

Japan declared war 10 turns ago, but units are just hanging out at Osaka.

@LoneGazebo
Copy link
Owner

The catch here, and I realize this is a little too vague to be actionable, but the AI doesn't seem to be shifting units towards fronts as effectively as it should - it's not trying to create opportunities. I think, even if it results in more lost units, the AI should be a bit more willing to commit units to opening a front, even if the front isn't immediately vulnerable. Otherwise it's a lot of declaring war and waiting around.

The AI is simply too cautious, both on offense and defense. It's not very interesting.

@LoneGazebo
Copy link
Owner

image

All this time passes, literally no defenders in Nineveh...and Assyria never even tried to take it back.

@LoneGazebo
Copy link
Owner

Note how far Nineveh is from Zulu lands.

@RecursiveStar
Copy link
Collaborator Author

@LoneGazebo ilteroi added some combat tuning knobs to CoreChanges.sql that control how much danger is acceptable and such, might be useful for your testing.

@ilteroi
Copy link
Collaborator

ilteroi commented Nov 20, 2019

those parameters are for tactical AI, but i suspect the problem here is on a higher level ... i'll take a look later

@LoneGazebo
Copy link
Owner

I don't think there's a bug per-se. Perhaps the AI should be a little more eager to exploit an undefended city, but ultimately the AI just feels a lot more passive on a fundamental level. I realize that's a very vague statement, but the AI just isn't getting troops to the front line and getting stuck in like it used to,

@ilteroi
Copy link
Collaborator

ilteroi commented Nov 20, 2019

ok i pushed a preliminary fix - not saying it's perfect yet but it's a step forward

@JLazeZ
Copy link

JLazeZ commented Nov 21, 2019

Version - 11/8 with latest hotfix
Mod List
-Quick Turns
-Calypso's Coloured Religious Icons + the extensions
-Pineappledan's Unit Tweaks

King, Standard Size, Standard Speed

Russia has been sending a large embarked army to my borders and just leaving them there unprotected. They've been doing it for the around 10 turns.

20191121114434_1

Logs and Save:
Logs + Save.zip

@ilteroi
Copy link
Collaborator

ilteroi commented Nov 21, 2019

@JLazeZ : that's weird indeed, i'll see what i can do

anyway pushed another fix, that should solve some city non-capture issues

@LoneGazebo
Copy link
Owner

On your latest @ilteroi, AI is definitely trying, but still no cities are falling. Furthermore @HeathcliffWarriors I'm not seeing any attacks or opportunity strikes on CSs, even by thirsty conquerors.

@ilteroi
Copy link
Collaborator

ilteroi commented Nov 22, 2019

yeah i know there are still errors in the log. will investigate

@RecursiveStar
Copy link
Collaborator Author

@LoneGazebo I only modified the logic for major civs. Possible that since there's more major civ war going on, they're not tempted to go after City-States?

@RecursiveStar
Copy link
Collaborator Author

It's probably this:

	// Minor Civ
	if (GET_PLAYER(eTargetPlayer).isMinorCiv())
	{
		bWantToAttack = !bAtWarWithAtLeastOneMajor && (GetMinorCivApproach(eTargetPlayer) == MINOR_CIV_APPROACH_CONQUEST);
		pOperation = GetPlayer()->GetMilitaryAI()->GetSneakAttackOperation(eTargetPlayer);
	}

@RecursiveStar
Copy link
Collaborator Author

@LoneGazebo Busy IRL with other things at the moment, but this should fix it. Will tweak more later but it'll do: #5871

@RecursiveStar
Copy link
Collaborator Author

Gonna close this given all the changes that've been made, if problems persist opening a new issue would be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants