Looking for implementation ideas for reduced stealth for tracked ships

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

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

Looking for implementation ideas for reduced stealth for tracked ships

#1 Post by Ophiuchus »

i was pondering if it was possible to give a stealth malus to a ship which has been detected (a lock, which could be broken as soon as the ship is not detected anymore). Or if a simple backend change could help.

the naive implementation has the main problem that the lock effect is visible to the locked ship's empire. this could be ok for certain kind of locks (e.g. if the lock came from combat). but it would be bad if the lock comes from a stealthed ship, giving away that such a ship is somewhere around. Same if the detector is out of your detection range, they can see you - you cant see them, but you know that they must be somewhere close.

One way out would be to have that lock only if the detected knows about it being detected - although that is very counterintuitive.

Another way round would be not to change stealth, but to give visibility under different circumstances (e.g. if the stealth <= detection level + 10 then give basic visibility). one of the problems here is that there is no UI telling you why/that happened.

Looking for ideas.
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
Grummel7
Space Dragon
Posts: 335
Joined: Mon Oct 09, 2017 3:44 pm

Re: Looking for implementation ideas for reduced stealth for tracked ships

#2 Post by Grummel7 »

The idea behind is that when an opponent has seen a ship, it keeps track of where it is, making it harder to hide, right?

Lowering stealth would be wrong in this case. Not because the owner can see it. Actually if he cannot see the source (e.g. a super stealthy special), his client will show the unmodified stealth value. The problem is rather that the reduced stealth means that other empire may also see the ship, although they have not spotted it so far.

Can we add a special to a ship, which has a owner other then the ship's owner? Such a special would be visible to the owner, but too stealthy for anyone else, so UI should be no problem.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Looking for implementation ideas for reduced stealth for tracked ships

#3 Post by Geoff the Medio »

Grummel7 wrote: Mon May 16, 2022 6:42 pmCan we add a special to a ship, which has a owner other then the ship's owner? Such a special would be visible to the owner, but too stealthy for anyone else, so UI should be no problem.
Specials do not have owners. They are essentially just a string attached to a UniverseObject, though also with a turn-added and capacity stat tracked.

An option might be to make the lingering-stealth effect a species effect, so any time an object is detected by an empire that has a ship with a particular species in the same system, the detected ship gets a special added, which lowers its stealth whenever another ship with that species is within some distance, and which lasts for 2 or 3 turns before removing itself.

Alternatively, the game does track the turns when empires have most recently had visibility of objects, so that could be made accessible to FOCS and used.

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

Re: Looking for implementation ideas for reduced stealth for tracked ships

#4 Post by Ophiuchus »

Grummel7 wrote: Mon May 16, 2022 6:42 pm The idea behind is that when an opponent has seen a ship, it keeps track of where it is, making it harder to hide, right?
yes. the idea is to make it easier to hide in the first place (e.g. ambush), but if you get detected it is not so easy to get away with it/hide again.
Grummel7 wrote: Mon May 16, 2022 6:42 pm Lowering stealth would be wrong in this case. .... Actually if he cannot see the source (e.g. a super stealthy special), his client will show the unmodified stealth value.
either: with the current implementation (as specials are unowned), there would be the UI issue that the detector can not see the effect as well.
or (i think this is what happens): the source is not known, but the change in stealth meter is known (so it would show the lowered stealth value and a description e.g. -10 unknown effect).
Grummel7 wrote: Mon May 16, 2022 6:42 pm ... The problem is rather that the reduced stealth means that other empire may also see the ship, although they have not spotted it so far.
true. thanks, forgot about this

Geoff the Medio wrote: Mon May 16, 2022 6:59 pm Specials do not have owners. ...

An option might be to make the lingering-stealth effect a species effect, so any time an object is detected by an empire that has a ship with a particular species in the same system, the detected ship gets a special added, which lowers its stealth whenever another ship with that species is within some distance, and which lasts for 2 or 3 turns before removing itself.
hm. not sure i understand. in order to break the lock you usually have to move your own ships apart? its easier to break locks if you have a multi-species fleet?
Geoff the Medio wrote: Mon May 16, 2022 6:59 pm Alternatively, the game does track the turns when empires have most recently had visibility of objects, so that could be made accessible to FOCS and used.
yeah, that sounds useful. where is it in cpp? I only found the EmpireObjectVisibilityMap in universe which is std::map<empire_id, std::map<object_id, Visibility>> and does not seem to track turns. Or is there an older universe lying around somewhere?
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
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Looking for implementation ideas for reduced stealth for tracked ships

#5 Post by Geoff the Medio »

Ophiuchus wrote: Tue May 17, 2022 11:44 ameither: with the current implementation (as specials are unowned), there would be the UI issue that the detector can not see the effect as well.
or (i think this is what happens): the source is not known, but the change in stealth meter is known (so it would show the lowered stealth value and a description e.g. -10 unknown effect).
The special itself has a stealth rating that could be quite low so that an empire that sees the object will also see the special. https://github.com/freeorion/freeorion/ ... cial.h#L49
Grummel7 wrote: Mon May 16, 2022 6:42 pm ... The problem is rather that the reduced stealth means that other empire may also see the ship, although they have not spotted it so far.
true. thanks, forgot about this
Suitably described, this could make sense. A part or buliding like a "Subspace Spotlight" would track any foreign objects visible to its owner that are within range, and reduce their stealth until they move out of range. This reduced stealth would sensibly apply for all empires.
Geoff the Medio wrote: Mon May 16, 2022 6:59 pmAn option might be to make the lingering-stealth effect a species effect, so any time an object is detected by an empire that has a ship with a particular species in the same system, the detected ship gets a special added, which lowers its stealth whenever another ship with that species is within some distance, and which lasts for 2 or 3 turns before removing itself.
hm. not sure i understand. in order to break the lock you usually have to move your own ships apart? its easier to break locks if you have a multi-species fleet?
You could probalby exclude an empire's own ships from the test for whether there is a particular kind of ship in range of the tagged object.
Geoff the Medio wrote: Mon May 16, 2022 6:59 pm Alternatively, the game does track the turns when empires have most recently had visibility of objects, so that could be made accessible to FOCS and used.
yeah, that sounds useful. where is it in cpp? I only found the EmpireObjectVisibilityMap in universe which is std::map<empire_id, std::map<object_id, Visibility>> and does not seem to track turns. Or is there an older universe lying around somewhere?
https://github.com/freeorion/freeorion/ ... rse.h#L163
https://github.com/freeorion/freeorion/ ... rse.h#L523

Daybreak
Vacuum Dragon
Posts: 641
Joined: Mon Aug 13, 2018 10:14 pm

Re: Looking for implementation ideas for reduced stealth for tracked ships

#6 Post by Daybreak »

I got lost in some of what was said above, so if below is not relevant, please disregard

Not looking at code, but at visually seeing a ship has been detected, could the detected ship have a flashing Border/Circle which is in the same colour as the detecing empire. This way stealth does not need to be lowered as an alert for the empire whose ships has been detected. If more than one empire has detected the ship, the colour would change as it flashes.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Looking for implementation ideas for reduced stealth for tracked ships

#7 Post by Geoff the Medio »

The scope of your suggestion is not clear, but in general, an empire doesn't know if another empire has detected a ship or fleet.

Daybreak
Vacuum Dragon
Posts: 641
Joined: Mon Aug 13, 2018 10:14 pm

Re: Looking for implementation ideas for reduced stealth for tracked ships

#8 Post by Daybreak »

Geoff the Medio wrote: Wed May 18, 2022 8:32 am The scope of your suggestion is not clear, but in general, an empire doesn't know if another empire has detected a ship or fleet.
The idea is - the ship/fleet that has been detected, have a flashing Border/Circle which is in the same colour as the detecing empire, until the lock is lost.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Looking for implementation ideas for reduced stealth for tracked ships

#9 Post by Geoff the Medio »

Daybreak wrote: Wed May 18, 2022 8:42 amThe idea is - the ship/fleet that has been detected, have a flashing Border/Circle which is in the same colour as the detecing empire, until the lock is lost.
There is no concept of a "detection lock" in the game mechanics. If the lowered stealth for recently-detected stuff is added as scripted content, that wouldn't immediately be accessible to the UI. There'd need to be a new "highlight in UI" effect or somesuch added. Or perhaps tags would need to be added to specials, which would let there be some special GUI-recognized tags that tell it to highlight a fleet a particular way... But that's not trivial to implement.

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

Re: Looking for implementation ideas for reduced stealth for tracked ships

#10 Post by Ophiuchus »

Geoff the Medio wrote: Wed May 18, 2022 8:47 am
Daybreak wrote: Wed May 18, 2022 8:42 amThe idea is - the ship/fleet that has been detected, have a flashing Border/Circle which is in the same colour as the detecing empire, until the lock is lost.
There is no concept of a "detection lock" in the game mechanics. If the lowered stealth for recently-detected stuff is added as scripted content, that wouldn't immediately be accessible to the UI. There'd need to be a new "highlight in UI" effect or somesuch added. Or perhaps tags would need to be added to specials, which would let there be some special GUI-recognized tags that tell it to highlight a fleet a particular way... But that's not trivial to implement.
Also probably daybreak use case looks like a more general one than locking. (So i think the idea is off topic here)

I think what daybreak would like to know is when a ship was stealthy last turn, but not this turn (according to their empire's knowledge).
So e.g. stealth meter dropped below enemy detection level or enemy detection increased above stealth meter. Moving into detection range probably should not trigger this.
So for all your ships you know are in enemy detection range, the client needs to know those four values (last turn/current turn level enemy detection level, last/current turn ship stealth meter).
If I am not mistaken those are available in principle?

For UI, with current implementation, one could spawn fields as markers or give sitrep warnings.
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
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Looking for implementation ideas for reduced stealth for tracked ships

#11 Post by Geoff the Medio »

Ophiuchus wrote: Wed May 18, 2022 9:02 amSo for all your ships you know are in enemy detection range, the client needs to know those four values (last turn/current turn level enemy detection level, last/current turn ship stealth meter).
If I am not mistaken those are available in principle?
The game doesn't remember previous turns' meter values for ships in general, except for cases like last turn was the most recent turn on which an empire had detection of a ship and that is thus the latest info available.

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

Re: Looking for implementation ideas for reduced stealth for tracked ships

#12 Post by Ophiuchus »

Geoff the Medio wrote: Wed May 18, 2022 9:27 am
Ophiuchus wrote: Wed May 18, 2022 9:02 amSo for all your ships you know are in enemy detection range, the client needs to know those four values (last turn/current turn level enemy detection level, last/current turn ship stealth meter).
If I am not mistaken those are available in principle?
The game doesn't remember previous turns' meter values for ships in general, except for cases like last turn was the most recent turn on which an empire had detection of a ship and that is thus the latest info available.
enemy ships/planets expected effect would be derived from current visibility map - so only if the detection source is visible.

for one's own ships. Right, stealth is not a persistent meter. would it hurt to change that? empire detection strength could probably be deduced from tech unlock age. anyway this is low prio for me.
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!

Post Reply