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

Obstructing hidden ship does not trigger combat #4834

Open
agrrr3 opened this issue Jan 3, 2024 · 4 comments · May be fixed by #4835
Open

Obstructing hidden ship does not trigger combat #4834

agrrr3 opened this issue Jan 3, 2024 · 4 comments · May be fixed by #4835
Labels
category:feature The Issue/PR describes or implements a new game feature. component:game mechanic The Issue/PR deals with the currently used or planned game mechanics.
Milestone

Comments

@agrrr3
Copy link
Contributor

agrrr3 commented Jan 3, 2024

Bug Report

It was reported that with current freeorion, hidden ships with passive blockade cant be countered if the stealth is high enough.

Triggering combat in this situation would allow to break the blockade.

Description

oberlus reported a feature request #4824 to counter this, but this issue IMHO a bug and more specific a regression.

The line of thought in many parts of the blockade code is that one is only able to blockade if one is able to attack (e.g. by firing warning shots to prove that ability).
If one wants to pass the blockade they should be able to attack to break the blockade (or ignore the blockade and maybe get extra punished).
Firing (warning) shots would decloak stealthed ships.

  • An empire armed ship set to "Initiate Combat"; and an enemy or unowned visible ship or planet
  • An empire armed ship set to "Initiate Combat"; and an enemy or unowned hidden ship with at least "Obstruct Passage"
  • An unowned armed ship set to "Initiate Combat" and the capacity to do some kind of damage; and an empire owned visible ship or planet
  • An unowned armed ship set to "Initiate Combat"; and an empire owned hidden ship with at least "Obstruct Passage"

armed means here - the capacity to do some kind of damage to the mentioned target.

i.e. stealthed ships on "Defensive Hide" and "Passive Hide" fleet stance never initiate combat, but stealthed armed ships on "Initiate Combat" and "Obstruct Passage" do

ps: i am not sure how the initiating of combat by unowned/monster ships is currently handled in the backend, but i think for consistency it should respect monster fleet stance the same way as empire fleet stance is handled. Fleet stance changes can be scripted in FOCS if necessary.

ps ps: btw. pedia entries/references for/to fleet stance are in poor condition

@agrrr3 agrrr3 added the category:bug The Issue/PR describes or solves a perceived malfunction within the game. label Jan 3, 2024
@geoffthemedio geoffthemedio added category:feature The Issue/PR describes or implements a new game feature. component:game mechanic The Issue/PR deals with the currently used or planned game mechanics. and removed category:bug The Issue/PR describes or solves a perceived malfunction within the game. labels Jan 3, 2024
@geoffthemedio geoffthemedio added this to the v0.5.0.1 milestone Jan 3, 2024
@agrrr3
Copy link
Contributor Author

agrrr3 commented Jan 4, 2024

Analysis notes...
The function ServerApp::CombatConditionsInSystem returns true if combat should be triggered in a system.

CombatConditionsInSystem
  for each aggressive fleet
    find the empires it is at war with
    GetFleetsVisibleToEmpireAtSystem
      for each fleet in the system
        check if the aggressive empire has at least VIS_BASIC_VISIBILITY of the fleet and if so, save it as visible
      handle what monsters can see
      return those visible fleets
    for each of those visible enemy fleets
      check if the owner is one of the enemies of the agressive fleet and if so, return true

One implementation idea would be to rename GetFleetsVisibleToEmpireAtSystem to GetFleetsVisibleToEmpireForTriggeringCombatAtSystem and check inside if fleets which are not visible do actually obstruct a fleet of the aggressive empire.
I am just not sure yet how I can check that.

@agrrr3
Copy link
Contributor Author

agrrr3 commented Jan 4, 2024

hm. i think the current implementation does not make too much sense returning all visible fleets, we usually could return true as soon as single such pair is found.

side note: i probably should check if the armed condition is actually considered for starting combat or not.

i am not completely sure when blockade etc gets determined, but it has to be between sending the turn and movement resolution
@geoffthemedio for the blockade case it would be enough to return true as soon as a blockaded aggressive fleet is found; do you agree?

@agrrr3 agrrr3 linked a pull request Jan 5, 2024 that will close this issue
@o01eg o01eg modified the milestones: v0.5.0.1, v0.5.1 Jan 30, 2024
@geoffthemedio
Copy link
Member

I think this is / is mostly resolved in master...

@Vezzra
Copy link
Member

Vezzra commented May 1, 2024

I think this is / is mostly resolved in master...

Sufficiently to close this issue as resolved...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:feature The Issue/PR describes or implements a new game feature. component:game mechanic The Issue/PR deals with the currently used or planned game mechanics.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants