Traitor fighter attacks its fleet

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

Moderator: 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: 5714
Joined: Mon Apr 10, 2017 4:25 pm

Traitor fighter attacks its fleet

#1 Post by Oberlus »

Playing latest Windows Test version. Check out attached screenshot.
TraitorFighter.png
TraitorFighter.png (925.07 KiB) Viewed 5247 times
A purple colonizer (Egassem) was in Tewari alpha on turn 68, and my fleet of two Fleet Carriers LBz was on its way.
At start of turn 69 the Egassem colonizer has colonized Tewari alpha II, my fleet arrives and combat ensues, but the combat is between my figthers!
Check out screenshot for combat log. Looks like my own figthers got crazy and attacked its own fleet.
Oh, and one of the fighters attacked the uninhabited planet Tewari alpha III.
WTF
Attachments
freeoriond.zip
(843.15 KiB) Downloaded 159 times
freeorion.log
(1.27 MiB) Downloaded 150 times

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Traitor fighter attacks its fleet

#2 Post by Ophiuchus »

Oh the cylons! Even the developers did not know they are here :)


The culprit is "Weapon has no targeting condition?? Should have been set when initializing PartAttackInfo"


But the parsing of FT_HANGAR_3.focs.txt goes through fine.

Is that a game freshly started with the test version?
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Traitor fighter attacks its fleet

#3 Post by Ophiuchus »

Ok, I can replicate the issue. The targeting condition works (so bombers attack ships first etc) until it runs out of targets. Then everything matches, which is plainly wrong.

I checked with the TopmostMatchesCondition branch which introduced the new targeting conditions and i could not replicate the issue so it looks some (not-so-)unrelated commit in master broke it.

Edit2:
It is actually a subtle bug in the OrderedAlternativesOf condition which did not manifest without the changes in master. In master species targeting was added which at the moment for any species' fighters matches any target. This ensures that all targets are in the matches set before the OrderedAlternativesOf condition is evaluated and applied. The OrderedAlternativesOf should match nothing if none of the conditions applies.

edit1: thought this was a usage bug
edit2: actually the matches input set seems is not correctly moved to the non_matches input set if none of the alternatives applies, needs a bugfix
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Traitor fighter attacks its fleet

#4 Post by Ophiuchus »

Fixed in PR 2413.

Note also the freeorion beta snap already got a hotfix release. I can't do anything about the windows and mac builds, so i guess those will be fixed with the next weekly release.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

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

Re: Traitor fighter attacks its fleet

#5 Post by Oberlus »

Good job!

Post Reply