[TF2] Bots will now follow players during mimic taunts#1827
[TF2] Bots will now follow players during mimic taunts#1827FlaminSarge wants to merge 4 commits intoValveSoftware:masterfrom
Conversation
|
Wouldn't this possibly let 1 player to basically make a bunch of bots (if not all of them) basically useless until the player stops taunting/the bots manage to die |
Probably. If you have any suggestions on how to curtail that, let me know. Oddly enough, bots are not set up to override CTFBotTaunt with other actions like 'respond to threats or attacks', so they don't interrupt the taunt behavior for those. Other behaviors are interruptible by higher-priority behaviors. I could probably set the partner taunts to be a lower priority than other behaviors like that. One other situation I could probably handle is if the bot hasn't moved from its current location in a while (e.g. a player has herded it into a corner) it could stop taunting. I could also just have a hard limit of like 30 seconds on the taunt in general, too. Someone else suggested LOS or FOV checks. |
|
I've got a pretty good idea: if during setup, let them taunt forever; if not during setup, roll for them to stop the taunt with a cvar-configurable percentage every 5-15 seconds, maybe even with escalating odds. |
That sounds good to me |
59836d6 to
5b58e8e
Compare
Bots will attempt to face the person they mimicked for the taunt to within 10 degrees and stay within 100 range of them Bots will stop taunting if the target stops taunting, or if they lose LOS of the target or are outside 800 range of them Bots will roll every 5 seconds for whether to stop taunting based on tf_bot_taunt_stop_chance, default 30 Also correct tf_bot_taunt_victim_chance so it can't trigger when set to 0 and can never not trigger at 100
|
Alright this should work out nicely now, added various stop behaviors. |
| CTFPlayer *pTauntPartner = pTFPlayer->GetTauntPartner(); | ||
|
|
||
| Vector vPositionToFace = ( pTauntPartner ? pTauntPartner->GetAbsOrigin() : vec3_origin ); |
There was a problem hiding this comment.
This was entirely unused, and hence cleaned up.
| if ( !ToTFPlayer( victim )->IsBot() && me->IsEnemy( victim ) && me->IsSelf( info.GetAttacker() ) ) | ||
| { | ||
| bool isTaunting = !me->HasTheFlag() && RandomFloat( 0.0f, 100.0f ) <= tf_bot_taunt_victim_chance.GetFloat(); | ||
| bool shouldTaunt = !me->HasTheFlag() && RandomFloat( 0.0f, 100.0f ) < tf_bot_taunt_victim_chance.GetFloat(); |
There was a problem hiding this comment.
the <= was causing a bug where even at cvar 0 they could taunt
aa18950 to
bf78418
Compare
|
This is mostly ready to go, but |
Description
This implements a 'partner' param for CTFBotTaunt and causes bots to attempt to follow their partner during a taunt.
tf_bot_taunt_stop_chancecvar. (After about 30 seconds at the default of 30%, the chance they've stopped taunting is about 88%, as an example. There are no escalating odds.)tf_bot_taunt_victim_chanceand corrects the check for that cvar, which could previously proc at value 0.Note that the 'target yaw' is set based on a stored var rather than GetCurrentYaw, since AimHeadTowards (and therefore current yaw) may lag behind the target yaw, and so without letting target yaw accumulate, bot turning gets slowed to a crawl. Also note that we have to initialize this after the bot is confirmed as taunting, otherwise the bot tends to snap to some arbitrary angle before properly trying to aim at the player, due to that not being initialized properly.
The taunt turn speed logic is pulled from C_TFPlayer::CreateMove()'s taunt turn speed handling.
Demonstration: soon™