Skip to content
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

Fix worms not releasing targets when they move deep onto rock #7126

Merged
merged 1 commit into from Dec 22, 2014

Conversation

penev92
Copy link
Member

@penev92 penev92 commented Dec 14, 2014

Meant to fix the problem described in #7125, introduced by #6821.
Basically the worm checked if a target is valid when:

  • Searching for one
  • Launching an attack against the current target

This means that if a unit reached solid ground before an attack, one of 2 things would happen:

  • It will be on rock, but near the edge and inside the worm's attack range. The worm will then try to launch the attack and see that the target is no longer valid and move on.
  • It will move deep within the rock "island", far from the worm's attack range. The worm would then continue its AttackMoveActivity indefinitely, causing it to not move and also ignore any other possible targets.

I added a check for target validity on each tick of the Attack activity. Now once the target is out of reach the worm should just move on and forget about it.

Note: There were several approaches proposed for fixing the issue, but I feel that:

  • This is the simplest one
  • It is the most consistent one with what the worm logic already uses
  • It is probably the safest way to go and not have a 100 cases where the other approaches might fail

@obrakmann
Copy link
Contributor

This seems to work (mostly).

  • When a unit moves onto rock, worms reacquire a different target immediately if one is available.
  • if not, then they sometimes just stop moving until there's a new target, sometimes they continue roaming (which is probably the correct action, I'd say), and sometimes they travel to the position where their last target drove onto the rocks and stay there. I'm not quite sure what to make of that.

@Mailaender
Copy link
Member

This works pretty well, because now you can properly flee from worms by getting back on rocks. 👍

@penev92
Copy link
Member Author

penev92 commented Dec 14, 2014

I don't really like the usage of "sometimes", but as long as it doesn't get stuck like it did, it should be fine.

pchote added a commit that referenced this pull request Dec 22, 2014
Fix worms not releasing targets when they move deep onto rock
@pchote pchote merged commit e212517 into OpenRA:bleed Dec 22, 2014
@obrakmann
Copy link
Contributor

Changelog

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

Successfully merging this pull request may close these issues.

None yet

4 participants