Skip to content

Commit

Permalink
made ships and fleets include stealth meter information under Basic V…
Browse files Browse the repository at this point in the history
…isibility, so that Basic Visibility info gleaned during combat would not necessarily be considered 'stale' (which was causing the human client MapWnd to suppress display of such)
  • Loading branch information
Dilvish-fo committed May 2, 2015
1 parent d1da5f5 commit 56e1808
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions universe/Fleet.cpp
Expand Up @@ -134,6 +134,10 @@ void Fleet::Copy(TemporaryPtr<const UniverseObject> copied_object, int empire_id
this->m_arrived_this_turn = copied_fleet->m_arrived_this_turn;
this->m_arrival_starlane = copied_fleet->m_arrival_starlane;

Meter* stealth_meter = this->GetMeter(METER_STEALTH);
const Meter* copied_stealth_meter = copied_fleet->GetMeter(METER_STEALTH);
stealth_meter->Set(copied_stealth_meter->Current(), copied_stealth_meter->Initial());

if (vis >= VIS_PARTIAL_VISIBILITY) {
this->m_aggressive = copied_fleet->m_aggressive;
if (this->Unowned())
Expand Down
3 changes: 3 additions & 0 deletions universe/Ship.cpp
Expand Up @@ -124,6 +124,9 @@ void Ship::Copy(TemporaryPtr<const UniverseObject> copied_object, int empire_id)
if (TemporaryPtr<Fleet> oldFleet = GetFleet(this->m_fleet_id))
oldFleet->RemoveShip(this->ID());
this->m_fleet_id = copied_ship->m_fleet_id; // as with other containers (Systems), actual insertion into fleet ships set is handled by the fleet
Meter* stealth_meter = this->GetMeter(METER_STEALTH);
const Meter* copied_stealth_meter = copied_ship->GetMeter(METER_STEALTH);
stealth_meter->Set(copied_stealth_meter->Current(), copied_stealth_meter->Initial());
}

if (vis >= VIS_PARTIAL_VISIBILITY) {
Expand Down

2 comments on commit 56e1808

@geoffthemedio
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm hesitant to make this particular change... What stealth level ships have seems like important information to keep hidden from empires that can't detect them.

@Dilvish-fo
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the concern -- keep in mind that unless we can figure out a 'perfect' solution then we need to choose a lesser of evils. I am happy to keep working on finding a perfect solution but in the meantime I think it is a lesser evil to disclose some stealth info as opposed to totally hiding the attacker from their target. I'll note below another imperfect-but-very-good solution, another imperfect-but-better-than-nothing solution, as well as my one idea for pursuing a 'perfect' solution.

As I noted in my intro comment to the PR, we do need some kind of additional change because without this or some other solution, the server will (at least in many cases) designate this info as stale-- the info is deemed to be from the previous turn, and certainly if the target empire still has the system in view the server decides that since they can no longer detect the stealthed attacker the info about it must be stale (and it might even be that the info was always getting designated as stale if the target empire even simply retained Basic visibility of the system). Being stale means that the human client MapWnd suppresses display of the fleet and ship and makes the entire handling essentially worthless (for human players at least). As I noted, it might be possible to change the stale info determination, this would be a potentially 'perfect' solution, but I looked at it for a bit and a modification to the algorithm did not come to mind. Suggestions are welcome.

One very easy alternate solution that would have limitations from both player perspective and yours, but might be a better compromise, is in this case of basic visibility, rather than giving the recipient empire the actual stealth, if the object did have more stealth than their detection then tell them the stealth is just one point higher than their current empire detection. They would know that this just really means it is at least that high, and that is not new info to them-- it is a simple deduction from the fact that the object was stealthed. But having this recorded in the stealth meter saves the info from being designated as stale by the stale-info algorithm. I think this still has a minor weakness in that once the empire's detection strength advances then the object would still get caught in the stale info determination and then its display would get surpressed. But that would normally take a while and is still much much better than the current situation of never getting any display of the attacker at all.

An alternate solution might possibly be to change the timing of at least this information update relative to the increase in the turn counter; that way the display on the MapWnd would not be suppressed for at least one turn. That seems rather on the lame side, but again is far far better than the current situation of never getting the display at all.

Please sign in to comment.