@GumChewer & DeltaEpsilon:
Currently I've identified some general issues with the AI's logic. So working on feature-requests will have to wait.
I noticed that one of the intended behaviours didn't work properly. But after fixing it, the AI actually did worse in the benchmark. I tried that maybe the feature doesn't make sense and thus disabled it. And this also did work in the benchmark. So if the bugged behavior is better than the intended behavior, this means that my intentional-behavior isn't good.
The intention was: "Don't attack if you can't return to good cover after attacking."
The bugged behavior was: "It went to the position, realized it didn't have enough TUs to both attack and go back to cover and then went back to cover, thus wasting their TUs".
My hypothesis as to why that bugged behavior still led to overall better results is that it could spot enemies it otherwise probably wouldn't have spotted and that the new cover-position was better for acting next turn.
If this makes it better, it means two things:
The current changes to peeking-behavior are probably a regression. My thought process was that if the "walktotarget" was already spotted by someone else, then peeking is not necessary. However, I now realized that a unit that has recently been spotted always takes precedent as a "walktotarget" over hypothetical units that are just guessed. So if a unit was spotted very far away, a unit now might not peek because it already knows a target but thus will miss targets that are much closer. And the aforementioned bug helped against that being an issue in some cases. So instead there should be a peektotarget, which is the assumed closest enemy regardless of whether it was already spotted. But even this might be worse than just always peeking. Maybe peeking logic should be reworked completely. The goal is to get the best possible reconnaissance for the lowest possible TU-investment.
The other thing that this indicates is that the makeshift cover-position it goes to after realizing it can't attack and go to cover could be better than the prior, much safer cover-position afterall. This means that the changes to cover seeking-logic an 7.3.0 also are questionable.
They were made to maximize safety when seeking cover. But this has the disadvantage of units not taking part in an ongoing combat, when they don't want to leave their save spots. This in turn will lead to enemies being singled out.
My idea is to change the behavior when contact has been made. In this case cooperation with the own team should take precedent over individual safety and less good cover should be considered as viable.
There also is a general contradiction with good cover and the peeking-logic. If the goal of peeking is to get the most reconnaissance for the lowest investment of TUs, then too good of a cover-position will contradict this goal.
Overall: Turns out finding the best approach is pretty difficult given how many possible scenarios there are.