Page MenuHomeWildfire Games

Fix game info leak - hide rubble of other players in the fog of war
ClosedPublic

Authored by elexis on Jun 13 2017, 7:43 AM.

Details

Summary

If a player decides to build a civic center, places a foundation, then deletes it to place it slightly differently, the rubble is spawned.
This rubble is visible in the fog of war to all players.
The fog of war is supposed to hide everything if it hadn't been explored prior, so do this.

Notice there are often only one or two places where a civic center is likely to be built, so it can be a critical giveaway to the enemy that might just want to build a civic center there too a minute later.

Notice the rubble isn't miraged, so it will be hidden completely in the fog of war, even if the entity has been explored prior.
But so are corpses and noone has complained about that yet. Also miraging corpses and rubble might be weird, since they are supposed to decay in some seconds, as opposed to resources and buildings.

The code is the exact same as rP16919, just without line ending mess.

Test Plan

Start a match with two players and explored map enabled. Place a foundation in the fog of war and delete it. Observe that you can still see it in the fog of war.
Place a foundation again. Change the perspective to that enemy and explore the foundation. Retreat. Delete the foundation with the owner and change the perspective again to the enemy and see that the rubble is invisible in the fog of war.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

elexis created this revision.Jun 13 2017, 7:43 AM
Vulcan added a subscriber: Vulcan.Jun 13 2017, 9:09 AM

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1551/ for more details.

Executing section Default...
Executing section Source...
Executing section JS...
Executing section XML GUI...
Executing section Python...
Executing section Perl...

http://jw:8080/job/phabricator_lint/192/ for more details.

elexis planned changes to this revision.Jun 13 2017, 11:23 PM

fatherbushido mentioned that

  1. the visibility properties`SpawnedEntityOnDeath` and Corpse can be merged (if we consider them to behave the same way forever)
  2. the SpawnedEntityOnDeath shouldn't be set to true in the templates, so that 1)a) we can place decorative rubble without the visibility behavior) change and 1)b) we don't need to set it true in all templates that will ever server as a SpawnEntityOnDeath.

This would work only effectively with the dynamic templates, i.e. doing AddLocalEntity("spawned_entity_on_death|" + this.template.SpawnEntityOnDeath); in Health.CreateDeathSpawnedEntity.
However this is blocked by missing AI support for new special templates: #4611.

elexis updated this revision to Diff 2554.Jun 13 2017, 11:27 PM

Fix (1).
Fixing (2) is blocked by #4611. That ticket should be done asap either way (in which case fixing (2) will be a three line patch).

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1555/ for more details.

Executing section Default...
Executing section Source...
Executing section JS...
Executing section XML GUI...
Executing section Python...
Executing section Perl...

http://jw:8080/job/phabricator_lint/196/ for more details.

fatherbushido accepted this revision.Jun 14 2017, 8:13 AM

Fixes the issue.
No comment to add.

This revision is now accepted and ready to land.Jun 14 2017, 8:13 AM

Notice the new skirmish map Corinthian Isthmus (4) places rubble, but only a visual actor, so it isn't affected (actor.xml sets Visibility.Corpse to false).

This revision was automatically updated to reflect the committed changes.
In D635#26126, @elexis wrote:

Notice the new skirmish map Corinthian Isthmus (4) places rubble, but only a visual actor, so it isn't affected (actor.xml sets Visibility.Corpse to false).

Sorry to jump in here, I don't know the right place report a bug on the current development. Doing my tests I found that after Alt-Tab on the game (switching to another program/app) after activating the game again all of your units and structures show the selected mark could be a bug. I'm on ubuntu using manual build.

Please refer to the attached picture.

Sorry to jump in here, I don't know the right place report a bug on the current development.

http://trac.wildfiregames.com

It's a consequence of the tab button toggling status bars: D537 / #4534. It must have occured before the commit as well, just wasn't noticeable long enough.