-
Notifications
You must be signed in to change notification settings - Fork 9
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
Rewrite stukabat NPC to support optional fly nav, divebomb telegraphing, ragdolling, unique stukapup model, etc. #262
Rewrite stukabat NPC to support optional fly nav, divebomb telegraphing, ragdolling, unique stukapup model, etc. #262
Conversation
…ng, ragdolling, unique stukapup model, etc.
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.
I left a few questions on the PR, but I don't think any of them are blockers. I'd like to talk about them before I merge this ideally, but either way I am approving this for the next release
@@ -37,6 +37,10 @@ class CNPC_FlyingPredator : public CNPC_BasePredator | |||
|
|||
virtual int RangeAttack1Conditions( float flDot, float flDist ); | |||
|
|||
// Used by base LOS functions | |||
virtual float InnateRange1MinRange( void ) { return 64.0f; } |
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.
Why does innate range attack 1 need a minimum range? Why can't they dive bomb from any range?
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.
This function is used by base LOS tasks such as TASK_GET_PATH_TO_ENEMY_LOS
or TASK_GET_FLANK_ARC_PATH_TO_ENEMY_LOS
, which are used by the new stukabat schedules. This does not actually prevent stukabats from attacking at this range (or at least not non-flying stukabats).
|
||
if ( IsFlying() ) | ||
{ | ||
// HACKHACK: Slam velocity and pitch/roll to 0 |
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.
Why? What's the use case for this?
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.
Since most NPC functions only compensate for yaw and limited movetypes, this prevents flying stukabats from being caught at an incorrect pitch/roll or velocity when entering scripted sequences (i.e. dynamic interactions).
This is something which probably would've belonged in the PR for predator dynamic interaction fixes.
return true; | ||
|
||
// Stukabats gib for any non-crush, non-blast damage greater than 15 (TODO: cvar?) | ||
if ( info.GetDamage() > 15.0f || (info.GetDamageType() & (DMG_CRUSH | DMG_BLAST) ) ) |
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.
I want to revisit this later. Perhaps we can implement the exploding ragdolls concept from way back
m_flNextSpitTime = gpGlobals->curtime + GetMinSpitWaitTime(); | ||
if ( CapableOfFlyNav() ) | ||
{ | ||
if (flDist <= InnateRange1MinRange()) |
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.
Why is this case specifically for when the stukabat has the capability to use flying navigation?
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.
IIRC this is related to flying-capable stukabats being able to go directly back to flying after dive bombing at certain heights. This condition prevents them from getting caught in a loop. Non-flying stukabats don't have this problem because they always fall to the ground after a dive bomb.
…-pistol-upwards-viewkick weapon_pistol upwards view kick cvar
This PR makes several changes to the stukabat (or "flying predator") NPC. The highlights of these changes include:
CanUseFlyNav
keyvalue. This allows them to fly around in a similar fashion to crows, dive bombing from different heights and locations around the enemy. This behavior will be disabled by default and must be enabled manually in Hammer or throughnpc_create
KV.-0.2
, which is relatively common) instead of 45 degrees (0.75
). The 45-degree viewcone seems to have been an oversight, as a comment mentions increasing the FOV to prevent tunnel vision, yet the viewcone is smaller than nearly any other NPC. This new FOV also fits in better with the positions of the stukabat's eyes.