Does AI forget troops from failed invasion missions?

Describe your experience with the latest version of FreeOrion to help us improve it.

Moderators: Oberlus, Oberlus

Forum rules
Always mention the exact version of FreeOrion you are testing.

When reporting an issue regarding the AI, if possible provide the relevant AI log file and a save game file that demonstrates the issue.
Post Reply
Message
Author
User avatar
Oberlus
Cosmic Dragon
Posts: 1489
Joined: Mon Apr 10, 2017 4:25 pm

Does AI forget troops from failed invasion missions?

#1 Post by Oberlus » Fri Nov 02, 2018 9:42 am

I've seen several mentions to the AI not defending troops standing still (including from me).
Now I've been paying more attention to that. It seems to me that the AI protects relatively well its troops when accumulating them (in some system close to its target) and when sending the troops to the destination. Each time I kill an undefended stack of troops, this stack seems to belong to a failed invasion mission. So far I've identified two situations when this happen:
1. The military force of the invasion mission got to destination and was killed.
2. The military force of the invasion mission retreats when the defending forces have grown stronger and counter-attack before the invasion has been attempted.
3. The military force of the invasion mission seems to be called upon something happening elsewhere.
In the three scenarios, the accompanying troop ships are left where they were, apparently forgotten, and will stay put even if they see incoming enemy forces with ETA>1.
Pleasepleaseplease, join fifth multiplayer slow game!

User avatar
Oberlus
Cosmic Dragon
Posts: 1489
Joined: Mon Apr 10, 2017 4:25 pm

Re: Does AI forget troops from failed invasion missions?

#2 Post by Oberlus » Mon Nov 05, 2018 1:26 pm

Regardless of the assumption in the OP, AI seems to forget stacks of troopers constantly (currently playing build 2018-10-21.d62cfa5). I keep finding troopers standing still in systems for tens of turns, even if there is a planet nearby they could be conquering.
In my last game this happened:
I attack and invade a system of a human AI Empire, cutting its empire in two separate supply groups. One planet is Mu Ursh (my first). I built there a Geo-Integration Fac. while accumulating forces to fence off the stronger fleet of the human AI that is in the next system, waiting. There are also troopers of this AI in that system, that where there before I conquered the Mu Ursh system.
A different AI makes me convene my forces to a different place. The first AI then attacks the Mu Ursh system and holds there for 5 turns, until my forces are coming back and it retires from the Mu Ursh system without having used the available troopers that were standing still in the adjacent system (more than enough to retake the whole system during these 5 turns).
Pleasepleaseplease, join fifth multiplayer slow game!

User avatar
Dilvish
AI Lead, Programmer
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Does AI forget troops from failed invasion missions?

#3 Post by Dilvish » Mon Nov 05, 2018 3:33 pm

I am pretty sure that the AI is not 'forgetting' about those troopers, but you are right that its invasion planning & tactics are still on the fragile side & can sometimes lead to troops getting stuck in limbo (not as often as it used to be, though, I think). You can check the AI logs if you want to verify that the troops were still assigned to that particular invasion mission. If there is not currently an open Issue about troop invasions for you to add an example problem (and savegame or set of savegames) to, then feel free to open up a new one.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

ovarwa
Space Kraken
Posts: 106
Joined: Thu Dec 11, 2014 3:22 am

Re: Does AI forget troops from failed invasion missions?

#4 Post by ovarwa » Mon Nov 05, 2018 7:25 pm

Hi,

Whether the behavior is a deliberate AI choice or not, troop ships are often left unattended, unmoving and visibly in harm's way for extended periods of time.

(Technically, I suppose, the AI cannot be said to have forgotten these ships unless there is a memory leak or the ship's data structures are GCed. But...)

Anyway,

Ken

Morlic
AI Contributor
Posts: 281
Joined: Tue Feb 17, 2015 11:54 am

Re: Does AI forget troops from failed invasion missions?

#5 Post by Morlic » Mon Nov 05, 2018 11:16 pm

I started to hack together some dirty and lazy logic to let the AI perform at least some evasive maneuvers. It will need a lot of polishing and doesn't cover a good number of cases yet where the AI should probably retreat but... Anyway, I had some fun chasing a colony ship in circles until I ran out of fuel.

Feel free to cherry-pick following commit (it's python only, no need to recompile) and provide some feedback if this actually goes into the right direction. It should cover the idling troop case (but untested).
https://github.com/Morlic-fo/freeorion/ ... 5c7ecba036

Note that AI is only expected to react if
* your fleet is visible
* your fleet is (approaching) the fleet's current(next) system or any neighbor.
* it doesn't want to refuel its fleet or actually perform some kind of mission (yeah, I know. Did I mention this was hacked together and still WIP?)

Disclaimer: Crippling AI bugs may or may not occur, feel free to report them.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Oberlus
Cosmic Dragon
Posts: 1489
Joined: Mon Apr 10, 2017 4:25 pm

Re: Does AI forget troops from failed invasion missions?

#6 Post by Oberlus » Tue Nov 06, 2018 11:39 am

I will give it a try and report.
But I assume that won't fix the problem of the AI not using available troop ships for no apparent reason, right?Sorry, I hadn't read your post well.
Just in case, I'll keep an eye on that and keep all saves.
Pleasepleaseplease, join fifth multiplayer slow game!

User avatar
Oberlus
Cosmic Dragon
Posts: 1489
Joined: Mon Apr 10, 2017 4:25 pm

Re: Does AI forget troops from failed invasion missions?

#7 Post by Oberlus » Wed Nov 07, 2018 11:52 am

Morlic wrote:
Mon Nov 05, 2018 11:16 pm
Disclaimer: Crippling AI bugs may or may not occur, feel free to report them.
I've reported a possible crippling bug, as a comment on your commit (I hope that's fine).
Pleasepleaseplease, join fifth multiplayer slow game!

Post Reply