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

Rewrite and simplify GPS dots #14117

Merged
merged 3 commits into from Nov 3, 2017

Conversation

Projects
None yet
6 participants
@pchote
Member

pchote commented Oct 5, 2017

Closes #14115.

The GPS code is a giant hack that doesn't fit with the current engine design, and can't reasonably be changed without changing its behaviour. #14115 shows that the legacy behaviour is controversial, and provides good motivation to rip out the problematic code.

The GPS dots are now purely visual, rendering for enemy actors who are (a) under fog (not shroud), (b) otherwise visible if the fog wasn't there (i.e. not cloaked), and (c) not already showing a visible frozen actor. Disguised actors (i.e. spies) now show indicators in their effective owner color instead of being hidden.

@Smittytron

Looks good in testing. Works just as I imagined it.

I do wonder about making spies the color of their disguise. If you see a dot that's your color, there is only one thing in the game that can be. It'll tell you exactly what's going on instead of, 'He has a guy there'.

@reaperrr

This comment has been minimized.

Show comment
Hide comment
@reaperrr

reaperrr Oct 7, 2017

Contributor

Needs rebase.

Contributor

reaperrr commented Oct 7, 2017

Needs rebase.

@pchote

This comment has been minimized.

Show comment
Hide comment
@pchote

pchote Oct 8, 2017

Member

Rebased.

Member

pchote commented Oct 8, 2017

Rebased.

@pchote pchote removed the PR: Rebase me! label Oct 8, 2017

@pchote

This comment has been minimized.

Show comment
Hide comment
@pchote

pchote Oct 11, 2017

Member

I do wonder about making spies the color of their disguise.

The motivation here is mainly technical. Having special case code in the GPS to check for “is this a disguised spy? Then remove the dot” is horrible for code generality. It is much nicer to have a blanket rule for “show dot for any hidden unit in the colour that the unit appears to the viewer”. I figured that this also matches the way that the satellite logically works: looking at the battlefield and reporting the location and owner of everything it sees.

If you think that change will unduely hurt gameplay then I don’t have a strong objection against adding it back, but it would be a bit of a shame.

Member

pchote commented Oct 11, 2017

I do wonder about making spies the color of their disguise.

The motivation here is mainly technical. Having special case code in the GPS to check for “is this a disguised spy? Then remove the dot” is horrible for code generality. It is much nicer to have a blanket rule for “show dot for any hidden unit in the colour that the unit appears to the viewer”. I figured that this also matches the way that the satellite logically works: looking at the battlefield and reporting the location and owner of everything it sees.

If you think that change will unduely hurt gameplay then I don’t have a strong objection against adding it back, but it would be a bit of a shame.

@dragunoff

This comment has been minimized.

Show comment
Hide comment
@dragunoff

dragunoff Oct 11, 2017

Contributor

Disguised actors (i.e. spies) now show indicators in their effective owner color instead of being hidden.

@pchote I understand that as "dots for spies will be shown in the color of the player who controls them, regardless of their current disguise (or lack of)". Is that correct?

I do wonder about making spies the color of their disguise.

And @Smittytron is worried that the spy dot will show up as the color of their disguise. Is there a misunderstanding here?

Contributor

dragunoff commented Oct 11, 2017

Disguised actors (i.e. spies) now show indicators in their effective owner color instead of being hidden.

@pchote I understand that as "dots for spies will be shown in the color of the player who controls them, regardless of their current disguise (or lack of)". Is that correct?

I do wonder about making spies the color of their disguise.

And @Smittytron is worried that the spy dot will show up as the color of their disguise. Is there a misunderstanding here?

@pchote

This comment has been minimized.

Show comment
Hide comment
@pchote

pchote Oct 11, 2017

Member

The spy dot will show up as the color of the disguise.

Member

pchote commented Oct 11, 2017

The spy dot will show up as the color of the disguise.

@dragunoff

This comment has been minimized.

Show comment
Hide comment
@dragunoff

dragunoff Oct 11, 2017

Contributor

The spy dot will show up as the color of the disguise.

Then I also wonder if that is a good idea. As Smitty put it "there is only one thing in the game that can be"

On second thought that would make GPS a great counter to spies so maybe not such a bad idea. And yeah - that's how a satellite logically works.

Contributor

dragunoff commented Oct 11, 2017

The spy dot will show up as the color of the disguise.

Then I also wonder if that is a good idea. As Smitty put it "there is only one thing in the game that can be"

On second thought that would make GPS a great counter to spies so maybe not such a bad idea. And yeah - that's how a satellite logically works.

@Smittytron

This comment has been minimized.

Show comment
Hide comment
@Smittytron

Smittytron Oct 11, 2017

Contributor

What about leaving spy dots as the color of their owner? The player with GPS will know something is there, they just won't know it's a spy until they see it.

If this is also technically unfeasible, I have no objections to shipping this PR as is. Fixing GPS is much more important to gameplay.

Contributor

Smittytron commented Oct 11, 2017

What about leaving spy dots as the color of their owner? The player with GPS will know something is there, they just won't know it's a spy until they see it.

If this is also technically unfeasible, I have no objections to shipping this PR as is. Fixing GPS is much more important to gameplay.

@pchote

This comment has been minimized.

Show comment
Hide comment
@pchote

pchote Oct 11, 2017

Member

Updated. I kept my first approach, but added a check to hide the indicator if it would otherwise be drawn in the color of the viewer or one of their allies.

This is an improvement over the original (release/playtest) behavior, which would hide the indicator for all disguised spies, even if they were disguised as an enemy player. Now, in a FFA game with two enemies then enemy A's spy disguised as you will be hidden, and enemy A's spy disguised as enemy B will show as enemy B's.

Member

pchote commented Oct 11, 2017

Updated. I kept my first approach, but added a check to hide the indicator if it would otherwise be drawn in the color of the viewer or one of their allies.

This is an improvement over the original (release/playtest) behavior, which would hide the indicator for all disguised spies, even if they were disguised as an enemy player. Now, in a FFA game with two enemies then enemy A's spy disguised as you will be hidden, and enemy A's spy disguised as enemy B will show as enemy B's.

@penev92

Some small things to clean up, otherwise works as advertised.
Also needs a rebase.

Show outdated Hide outdated OpenRA.Mods.Cnc/Traits/GpsWatcher.cs Outdated
Show outdated Hide outdated OpenRA.Mods.Common/Activities/Move/MoveAdjacentTo.cs Outdated
Show outdated Hide outdated OpenRA.Mods.Cnc/Effects/GpsDotEffect.cs Outdated
// Hide the indicator if the unit appears to be owned by an allied player
if (actor.EffectiveOwner != null && actor.EffectiveOwner.Owner != null &&
toPlayer.IsAlliedWith(actor.EffectiveOwner.Owner))
return false;

This comment has been minimized.

@penev92

penev92 Oct 17, 2017

Member

This check means that you woudn't see dots for spies that are disguised as your/allied soldiers.
Simply removing it should be more than fine, as if it really was an allied unit it wouldn't be under fog (barring some really sick edge case in scripted missions?!?), so you wouldn't be seeing a dot anyway, and without it you see a dot in the proper color.

@penev92

penev92 Oct 17, 2017

Member

This check means that you woudn't see dots for spies that are disguised as your/allied soldiers.
Simply removing it should be more than fine, as if it really was an allied unit it wouldn't be under fog (barring some really sick edge case in scripted missions?!?), so you wouldn't be seeing a dot anyway, and without it you see a dot in the proper color.

This comment has been minimized.

@pchote

pchote Oct 17, 2017

Member

See my comment about this in the original PR description and the discussion that followed. This was an intentional change in response to that PR feedback.

@pchote

pchote Oct 17, 2017

Member

See my comment about this in the original PR description and the discussion that followed. This was an intentional change in response to that PR feedback.

This comment has been minimized.

@penev92

penev92 Oct 17, 2017

Member

[13:45] <+penev> fine, I guess it's too obvious if you see a dot in your color...
[13:45] <+penev> damn gameplay implications...
[13:45] <+penev> always messing with good code
[13:45] <+penev> :D

@penev92

penev92 Oct 17, 2017

Member

[13:45] <+penev> fine, I guess it's too obvious if you see a dot in your color...
[13:45] <+penev> damn gameplay implications...
[13:45] <+penev> always messing with good code
[13:45] <+penev> :D

@pchote

This comment has been minimized.

Show comment
Hide comment
@pchote

pchote Oct 21, 2017

Member

TODO: include a fix for #14229.

Member

pchote commented Oct 21, 2017

TODO: include a fix for #14229.

@pchote

This comment has been minimized.

Show comment
Hide comment
@pchote

pchote Oct 22, 2017

Member

Updated. #14229 requires cleaning up a different set of ugly GPS code than what is here, so i'm going to leave that for a later PR.

Member

pchote commented Oct 22, 2017

Updated. #14229 requires cleaning up a different set of ugly GPS code than what is here, so i'm going to leave that for a later PR.

@penev92

This comment has been minimized.

Show comment
Hide comment
@penev92

penev92 Oct 26, 2017

Member

👍

Member

penev92 commented Oct 26, 2017

👍

@reaperrr reaperrr merged commit 4fe7ffe into OpenRA:bleed Nov 3, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@pchote pchote deleted the pchote:remove-fog-visibility-modifier branch Apr 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment