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

Turrets target moving cars #2165

Merged
merged 3 commits into from
Dec 17, 2022

Conversation

joveeater
Copy link
Collaborator

Summary

SUMMARY: Features "Turrets, defense bots and mi-go now target moving cars"

Purpose of change

Make the tactic of avoiding enemies by crouching in your car less effective. More intelligent enemies (i.e. turrets, defense bots and mi-go scouts) will now target moving vehicles, favoring shooting at the controls if they can.

Describe the solution

There's a new json property in the gun special attack that controls the behavior. It causes the closest moving vehicle to be targeted if there's nothing better and it will favor shooting the controls of the vehicle if it can see them. Vehicles do not require any targeting time from the turret.

Describe alternatives you've considered

Giving it to more monsters maybe?

Testing

The old seems to work.

Additional context

Crouching in your car is still a fairly effective strategy. It gives pretty good protection but it's a lot more risky. Note that this does work across z-levels so they will shoot at helis as they pass.

@github-actions github-actions bot added JSON related to game datas in JSON format. src changes related to source code. labels Nov 5, 2022
@joveeater
Copy link
Collaborator Author

Good catch!

if( !veh ) {
return false;
}
for( const vpart_reference &vp : veh->get_avail_parts( "CONTROLS" ) ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it will make sense if they also can target wheels.

@Coolthulhu Coolthulhu self-assigned this Nov 15, 2022
@olanti-p
Copy link
Contributor

olanti-p commented Dec 8, 2022

I think I found a bug, but I'm not sure whether it's caused by this PR or just by wacky monster targeting in general.

  1. Spawn a vehicle, install drive by wire controls on it
  2. Spawn a laser turret, stand just outside of its range
  3. Use remote vehicle controller to drive the vehicle. The turret will ignore it as long as avatar stays visible.

Upd: heh
image

@joveeater
Copy link
Collaborator Author

Yeah, this is a common thing for all monsters. If they can see the player they ignore everything else. I imagine it's the same if you throw zombies at it as well. Also lol at the turret struggling to stand.

@Coolthulhu Coolthulhu merged commit df96b6f into cataclysmbnteam:upload Dec 17, 2022
@Coolthulhu
Copy link
Member

Few notes:

  • This allows exhausting turret ammo easily. Would be great if they had some sort of precalculation for viable targets, so that they won't shoot a moving wall of steel. Especially if they did start shooting its weak backside.
  • It's OK to have the turret magically guess the controls actually used by the player rather than first-best.
  • Use VPFLAG_CONTROLS over "CONTROLS" where possible, bitflag flags are faster to check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JSON related to game datas in JSON format. src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants