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

TS: Implement Hunter-Seeker #12918 #21253

Closed
wants to merge 1 commit into from
Closed

Conversation

tinix0
Copy link
Contributor

@tinix0 tinix0 commented Dec 13, 2023

Implements #12918
Implements random hunter seeker behavior by adding a trait and issuing move + suicide on idle command, if there is an existing target. I am not 100% if the spread on the weapon is correct and if it cant cause the explosion to kill multiple stacked units, but I could not think of any better way, since we have to target ground to attack targets in shroud.

Copy link
Member

@PunkPun PunkPun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be using an attack activity in theory as to make the activity sticky to moving actors, though they are made to respect fog and shroud

OpenRA.Mods.Cnc/Traits/HunterSeeker.cs Outdated Show resolved Hide resolved
OpenRA.Mods.Cnc/Traits/HunterSeeker.cs Outdated Show resolved Hide resolved
OpenRA.Mods.Cnc/Traits/HunterSeeker.cs Outdated Show resolved Hide resolved
OpenRA.Mods.Cnc/Traits/HunterSeeker.cs Show resolved Hide resolved
@tinix0
Copy link
Contributor Author

tinix0 commented Dec 14, 2023

I think I will rework it into attack activity. After I read your comment I've realized that it will indeed not track moving targets, so that needs to be fixed and a custom attack activity is probably the way.

@PunkPun
Copy link
Member

PunkPun commented Dec 14, 2023

Might want to make a new activity or something inheriting MoveAdjecentTo (or however it's called)

if (target.Disposed || target.IsDead)
SelectNewTarget(self);
else
self.Kill(self);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will fail if the target is loaded in a transport, or goes underground or something like that. Why is this not part of the activity? Isn't it already since the activity attacks? If not it should be, and then the activity can do the proper checks and re-queue a move activity as child if necessary or cancel itself (so that a new target is chosen).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the weapon fired by attack activity should explode the hunterseeker. At least that's how I understand the current self-destruting units work

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume the same. We shouldn't need the self.Kill(self) here then, right?

Comment on lines +173 to +175
// Cancel non-forced targets when switching to a more restrictive stance if they are no longer valid for auto-targeting
if (newStance > oldStance)
return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is doing nothing?

Comment on lines +22 to +23
/* Attack against targets that might not be visible (i.e. Hunter-Seeker) */
public class AttackIgnoringVisibility : Activity, IActivityNotifyStanceChanged
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/* Attack against targets that might not be visible (i.e. Hunter-Seeker) */
public class AttackIgnoringVisibility : Activity, IActivityNotifyStanceChanged
public class AttackIgnoringVisibility : Activity, IActivityNotifyStanceChanged

That is Imho obvious from the name. That being said, can we not re-use one of the existing attack activities? This looks like a bunch duplicated code from a quick glance.

@PunkPun
Copy link
Member

PunkPun commented Dec 23, 2023

related #6478

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

3 participants