-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Attack dog leap improvement #13513
Attack dog leap improvement #13513
Conversation
|
||
var leapToken = ConditionManager.InvalidConditionToken; | ||
|
||
return ActivityUtils.SequenceActivities( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use child activities and OnFirstRun instead of SequenceActivities. Refer to the Transform activity for an example.
|
Forgot to mention, in parent-child activity version, I addressed far-jumping dogs |
Fixed shell map crash that wasn't caught before |
Needs rebase. |
Rebased |
OpenRA.Mods.Cnc/Activities/Leap.cs
Outdated
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Leave newline here.
conditionManager.GrantCondition(self, info.AttackingCondition, info.AttackingDuration); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
EOL fixed, squashed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TheCallFunc
activity is not serialization friendly (game saving). Granted, it may take a while before that can be added; however, it is better to code for its support now than to make more work for later.
{ | ||
attack.ApproachBuffOn(self); | ||
QueueChild(new MoveWithinRange(self, target, WDist.Zero, range)); | ||
QueueChild(new CallFunc(() => attack.ApproachBuffOff(self))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove:
QueueChild(new CallFunc(() => attack.ApproachBuffOff(self)));
var range = attack.GetMaximumRange(); | ||
if (!target.IsInRange(self.CenterPosition, range)) | ||
{ | ||
attack.ApproachBuffOn(self); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Append:
isApproachBuffOn = true;
|
||
if (ChildActivity != null) | ||
{ | ||
ActivityUtils.RunActivity(self, ChildActivity); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace with:
var act = ActivityUtils.RunActivity(self, ChildActivity);
if (isApproachBuffOn && act == this))
attack.ApproachBuffOff(self);
readonly Target target; | ||
readonly AttackLeapInfo info; | ||
readonly Mobile mobile; | ||
readonly AttackLeap attack; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Append:
bool isApproachBuffOn = false;
Removed CallFunc. Removed more visual glitch.
I also made rip condition to disable AttackLeap to prevent dogs from jumping immediately. The problem is, if I queue attack orders, rip disables the attack trait and the queue gets canceled. I didn't look into detail on the reason but I can't queue anymore with && !rip condition. If I remove && !rip things return to normal. I think AttackBase trait should be a pausable trait as well. |
This sounds like a sensible solution. Would you mind filing a PR for this? |
I'd like to see this trait renamed to AttackJoust during this PR, because it no longer involves a leap. See my reasoning at OpenRA/ra2#328 (comment). |
I let them overlap. Otherwise, when the cell contains 5 enemy infantries, attack dogs can't attack any of those infantries at all. If I don't hard-code one-shot kill into the code, I'd get overlap anyway if target HP > dog damage. The neatest solution without unit stacking would be to implement RA3 dog/bear melee attack. Now I see why WW hard coded one-shot-kill to RA2 attack dogs. |
I'll try. That should improve EMP in TS too. |
This is precisely the reason for the one-shot kill in the current implementation. |
I inteded to respect Mailaender's removal of one shot kill. I guess I have to bring back it back. On the other hand, if dogs jump at the same time to the same target, they will overlap. I think the proper way to avoid this is to introduce some kind of a coordination to the jumping, something like resource claim layer. What do you think about the doggy jumping coordination layer? |
Hardcoding the one-shot-kill will remove the chance of using this implementation for parasite behaviour (RA2 Terror Drone vs vehicles, Firestorm Limpet Drone). Another option would be that the actor would bounce to a free subcell after an attack when the target isn't killed. |
Hmm, probably why the attack dogs in RA1 "slides" after ripping up. I'll try that. |
Yes, we need this, but not as a layer. Implement it as a trait on the actor itself, like we have for external capturing or the various things that lock buildings. |
Parasite behaviour requires the targeting actor to enter the target, which is a completely different usecase. Trying to solve that with the same code as attack dogs makes for uglier and more complicated solutions than necessary for both. |
Squid parasite didn't really entered into the target, was moreso attached to. |
Squid parasite behaviour requires the targeting actor to attach to the target, which is a completely different usecase. Trying to solve that with the same code as attack dogs makes for uglier and more complicated solutions than necessary for both. 😉 |
@forcecore: do you plan on continuing with this in the short term? |
Not in the short term, I have personal issues to sort out for about a few weeks. |
Ok, no worries. I've moved this to the Future milestone so that we don't lose track of this, and will close it for now to help reduce the PR queue to items that need active review. Please do reopen this as soon as you are able to continue, because it would be good to finally fix this. |
Attempt to fix #7506
Based on Mailaender's dog improvement PR #11715. (Sorry about C&P instead of Git Cherry Pick but it was way behind bleed)
Demo: