Return of the regenerating shields/defenses invasion bug

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.
Message
Author
User avatar
Oberlus
Cosmic Dragon
Posts: 5716
Joined: Mon Apr 10, 2017 4:25 pm

Re: Return of the regenerating shields/defenses invasion bug

#16 Post by Oberlus »

Ophiuchus wrote: Sat Apr 18, 2020 3:13 pm

Code: Select all

    combatTargets = And [
        [[COMBAT_TARGETS_VISIBLE_ENEMY]]
        OrderedAlternativesOf [
            Or [
              [[COMBAT_TARGETS_NOT_DESTROYED_SHIP]]
              [[COMBAT_TARGETS_PLANET_WITH_DEFENSE]]
            ]
        ]
        Planet
    ]
It should be

Code: Select all

    combatTargets = And [
        [[COMBAT_TARGETS_VISIBLE_ENEMY]]
        OrderedAlternativesOf [
            Or [
              [[COMBAT_TARGETS_NOT_DESTROYED_SHIP]]
              [[COMBAT_TARGETS_PLANET_WITH_DEFENSE]]
            ]
            Planet
        ]
    ]
Right? (Notice the Planet is now within OrderedAlternativesOf []

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

Re: Return of the regenerating shields/defenses invasion bug

#17 Post by Ophiuchus »

Oberlus wrote: Sat Apr 18, 2020 4:14 pm It should be

Code: Select all

    combatTargets = And [
        [[COMBAT_TARGETS_VISIBLE_ENEMY]]
        OrderedAlternativesOf [
            Or [
              [[COMBAT_TARGETS_NOT_DESTROYED_SHIP]]
              [[COMBAT_TARGETS_PLANET_WITH_DEFENSE]]
            ]
            Planet
        ]
    ]
:mrgreen:
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: Return of the regenerating shields/defenses invasion bug

#18 Post by Ophiuchus »

Made a pull request #2872. Please test.
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: Return of the regenerating shields/defenses invasion bug

#19 Post by Ophiuchus »

With the current state the PR looks like it is working okay.

But it does also something more: it attacks also neutral defenseless planets (which might be what we want if that is a planet with regenerating defenses/natives).

So any ideas what is the best criterium to use for the attacking defenseless planets? Population greater zero? High-tech natives?
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
swaq
Space Dragon
Posts: 384
Joined: Tue Aug 20, 2019 1:56 pm

Re: Return of the regenerating shields/defenses invasion bug

#20 Post by swaq »

Does that mean that non-neutral enemy populated planets also continue to receive fire even after they are suppressed? I remember that was something we were trying to avoid so that planets didn't cause your ships to waste too many shots.

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

Re: Return of the regenerating shields/defenses invasion bug

#21 Post by Ophiuchus »

swaq wrote: Sun Apr 19, 2020 1:34 pm Does that mean that non-neutral enemy populated planets also continue to receive fire even after they are suppressed? I remember that was something we were trying to avoid so that planets didn't cause your ships to waste too many shots.
Ah right, I forgot about expendable munitions (i.e. missiles etc). Yes, if we use targeting for solving this it means shooting at defenseless planets. We could simply forbid expendable munitions to fire at such (or even wait until defenses are strong enough to warrant a response).

If we do not use targeting to solve this it means you guys need to come up with a better solution.
Last edited by Ophiuchus on Sun Apr 19, 2020 1:44 pm, edited 2 times in total.
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
swaq
Space Dragon
Posts: 384
Joined: Tue Aug 20, 2019 1:56 pm

Re: Return of the regenerating shields/defenses invasion bug

#22 Post by swaq »

Ophiuchus wrote: Sun Apr 19, 2020 1:39 pm
swaq wrote: Sun Apr 19, 2020 1:34 pm Does that mean that non-neutral enemy populated planets also continue to receive fire even after they are suppressed? I remember that was something we were trying to avoid so that planets didn't cause your ships to waste too many shots.
Ah right, I forgot about expendable munitions (i.e. missiles etc). Yes, if we use targeting for solving this it means shooting at defenseless planets. We could simply forbid expendable munitions to fire at such (or even wait until defenses are strong enough to warrant a response).

If we do not use targeting to solve this it means you guys need to come up with a better solution.
This was a problem even for non-expendable munitions. Defending fleet in a system with 3 or 4 planets was very hard to defeat due to so many shots continuing to fire at the planets.

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

Re: Return of the regenerating shields/defenses invasion bug

#23 Post by Ophiuchus »

Another KISS idea: add minimal infrastructure to outposts? OTOH why did this bug reoccur?
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
swaq
Space Dragon
Posts: 384
Joined: Tue Aug 20, 2019 1:56 pm

Re: Return of the regenerating shields/defenses invasion bug

#24 Post by swaq »

Ophiuchus wrote: Sun Apr 19, 2020 1:44 pm Another KISS idea: add minimal infrastructure to outposts? OTOH why did this bug reoccur?
If I recall correctly this bug was unfixed when trying to fix the planets keep taking fire issue. Previously when ships fired indiscriminately the planets would always be hit (and resuppressed) regardless of what their regen status was at the expense of wasting many shots.

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

Re: Return of the regenerating shields/defenses invasion bug

#25 Post by Oberlus »

swaq wrote: Sun Apr 19, 2020 1:41 pm This was a problem even for non-expendable munitions. Defending fleet in a system with 3 or 4 planets was very hard to defeat due to so many shots continuing to fire at the planets.
That should not be a problem now because Ophiuchus fix uses the OrderedAlternativesOf, so it would target defenseless planets only if there is not other interesting target. And also (and I like that quite a bit, unless I'm missing something) it would not target defenseless planets if there is enough defensive ships in the system, so invasion would be hindered by such strategy (not much, just one turn, because of the 1 shield regen).

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

Re: Return of the regenerating shields/defenses invasion bug

#26 Post by Ophiuchus »

swaq wrote: Sun Apr 19, 2020 1:57 pm
Ophiuchus wrote: Sun Apr 19, 2020 1:44 pm OTOH why did this bug reoccur?
If I recall correctly this bug was unfixed when trying to fix the planets keep taking fire issue. Previously when ships fired indiscriminately the planets would always be hit (and resuppressed) regardless of what their regen status was at the expense of wasting many shots.
That was long ago wasn't it? Why is it now again a problem?
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: 5716
Joined: Mon Apr 10, 2017 4:25 pm

Re: Return of the regenerating shields/defenses invasion bug

#27 Post by Oberlus »

Ophiuchus wrote: Sun Apr 19, 2020 2:59 pm That was long ago wasn't it? Why is it now again a problem?
Maybe because Magnate complained quite a lot about it in current MP game :lol:

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

Re: Return of the regenerating shields/defenses invasion bug

#28 Post by Ophiuchus »

Oberlus wrote: Sun Apr 19, 2020 3:02 pm
Ophiuchus wrote: Sun Apr 19, 2020 2:59 pm That was long ago wasn't it? Why is it now again a problem?
Maybe because Magnate complained quite a lot about it in current MP game :lol:
:lol: so everybody was just ignoring the bug?
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: Return of the regenerating shields/defenses invasion bug

#29 Post by Ophiuchus »

Ophiuchus wrote: Sun Apr 19, 2020 1:44 pm Another KISS idea: add minimal infrastructure to outposts?
Made an alternative PR-2879 which ensures minimum (Max)Construction one for empire's outposts. I checked that the construction value gets set to one on the outpost I build.

Do non-empire outposts exist? If so the implementation would not work for that case. I think outpost == (owned + zero pop), so that should not happen. Never depopulated natives.

I think I prefer the outposts-have-minimal-construction-one fix to the shoot-at-defenseless-planets-if-no-other-targets fix.
Please playtest.
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: 5716
Joined: Mon Apr 10, 2017 4:25 pm

Re: Return of the regenerating shields/defenses invasion bug

#30 Post by Oberlus »

Ophiuchus wrote: Sun Apr 19, 2020 3:58 pm :lol: so everybody was just ignoring the bug?
Well, it's indeed annoying, but it only means you have to wait for one turn to invade (or bring in troopers for the combat). Not big deal.

Post Reply