Looking for implementation ideas for reduced stealth for tracked ships
Moderator: Committer
Looking for implementation ideas for reduced stealth for tracked ships
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.
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!
Look, ma... four combat bouts!
Re: Looking for implementation ideas for reduced stealth for tracked ships
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.
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.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Looking for implementation ideas for reduced stealth for tracked ships
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.
Re: Looking for implementation ideas for reduced stealth for tracked ships
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.
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).
true. thanks, forgot about this
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 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.
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?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.
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!
Look, ma... four combat bouts!
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Looking for implementation ideas for reduced stealth for tracked ships
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#L49Ophiuchus 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).
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.
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.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 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.
https://github.com/freeorion/freeorion/ ... rse.h#L163yeah, 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?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.
https://github.com/freeorion/freeorion/ ... rse.h#L523
Re: Looking for implementation ideas for reduced stealth for tracked ships
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.
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.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Looking for implementation ideas for reduced stealth for tracked ships
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.
Re: Looking for implementation ideas for reduced stealth for tracked ships
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.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.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Looking for implementation ideas for reduced stealth for tracked ships
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.
Re: Looking for implementation ideas for reduced stealth for tracked ships
Also probably daybreak use case looks like a more general one than locking. (So i think the idea is off topic here)Geoff the Medio wrote: ↑Wed May 18, 2022 8:47 amThere 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.
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!
Look, ma... four combat bouts!
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Looking for implementation ideas for reduced stealth for tracked ships
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.
Re: Looking for implementation ideas for reduced stealth for tracked ships
enemy ships/planets expected effect would be derived from current visibility map - so only if the detection source is visible.Geoff the Medio wrote: ↑Wed May 18, 2022 9:27 amThe 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.
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!
Look, ma... four combat bouts!