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

Allow turreted units to acquire targets of opportunity while moving #16112

Merged
merged 3 commits into from Feb 3, 2019

Conversation

Projects
None yet
4 participants
@pchote
Copy link
Member

pchote commented Jan 26, 2019

Fixes #14009.
Fixes IceReaper/KKnD#19.

Depends on #16067 and #16110.

This PR (last three commits) implements an OpportunityFire flag on AttackFollows, which works as described for RA2. It is enabled by default for all turreted units, but can be disabled on specific units by setting OpportunityFire: False on AttackTurreted in the yaml.

I raised the idea of implementing this several days ago in the Discord channel, and the response was a rather enthusiastic yes, but that this really wanted to be included in the playtest so that rebalancing can be done at the same time as for the fog targeting.

@matjaeck

This comment has been minimized.

Copy link
Contributor

matjaeck commented Jan 26, 2019

This in conjunction with the prior commits is a big win for gameplay and adds a lot of responsiveness and control when microing units. Tanks become a lot more fun to use.

As described, move orders in defend or attack anything stance or with direct targeting become more effective vs enemy targets than attack/assault moving as these orders will make the unit stop while attacking (I think we should clarify what the desired behavior for these activities is in #16105).

@matjaeck
Copy link
Contributor

matjaeck left a comment

Something here has regressed the behavior, that you could forceattack an actor or location with a turreted unit and then issue a move order and the unit would keep attacking while moving.

Also, cruisers that are given a direct target order on an enemy structures under fog will acquire a new frozen target when given a move command (attack defences when ordered to attack a building).

@matjaeck
Copy link
Contributor

matjaeck left a comment

After another look at it, I noticed the following:

  • Force attack with idle unit on a location in range + move command will cancel the attack
  • Force attack with moving unit on a location in range + move command will not cancel the attack
  • Force attack with idle/moving unit on a location outside of range + move command will not cancel the attack

@pchote pchote force-pushed the pchote:turret-opportunity-targets branch 2 times, most recently from 95982e4 to a3dd823 Jan 26, 2019

@pchote

This comment has been minimized.

Copy link
Member Author

pchote commented Jan 27, 2019

Rebased.

@pchote

This comment has been minimized.

Copy link
Member Author

pchote commented Feb 1, 2019

Apparently this breaks force-targeting vs the ground - need to investigate and fix.

Bug found

@reaperrr reaperrr removed the PR: Needs +2 label Feb 1, 2019

@pchote pchote force-pushed the pchote:turret-opportunity-targets branch from a3dd823 to 8fa744d Feb 2, 2019

@pchote

This comment has been minimized.

Copy link
Member Author

pchote commented Feb 2, 2019

Rebased and fixed the force fire issue by introducing an opportunityForceAttack that inherits requestedForceAttack when downgrading the requested target.

@matjaeck
Copy link
Contributor

matjaeck left a comment

Force Attack behavior is fixed and works as expected.

Something breaks Hold Fire stance. Turreted actors will autotarget regardless of being in HoldFire Stance, noticeable for Phase Transports for example but also applies to tanks that do not respect Hold Fire. Usually, if the unit was already attacking and then put into Hold Fire, you would have to issue a stop order to stop the attack. This does not work anymore.

Return Fire stance is also not working, so it looks like the autotargeting is not accounting for unit stances.

pchote added some commits Jan 25, 2019

@pchote pchote force-pushed the pchote:turret-opportunity-targets branch from 8fa744d to 6764579 Feb 2, 2019

@pchote

This comment has been minimized.

Copy link
Member Author

pchote commented Feb 2, 2019

Something breaks Hold Fire stance.
Return Fire stance is also not working

Fixed. It turns out that AutoTarget does the stance checks before calling ScanForTarget, so I needed to add the same checks to AttackFollow.

@matjaeck
Copy link
Contributor

matjaeck left a comment

This looks good to me now 👍

@pchote pchote added the PR: Needs +2 label Feb 2, 2019

@obrakmann
Copy link
Contributor

obrakmann left a comment

Works as intended. As a nice side effect, this fixes the sitting-duck behaviour for many units while they are Waiting.

@obrakmann obrakmann merged commit f899147 into OpenRA:bleed Feb 3, 2019

2 checks passed

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

This comment has been minimized.

Copy link
Contributor

obrakmann commented Feb 3, 2019

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