-
Notifications
You must be signed in to change notification settings - Fork 20
Spectator ability to take over bots and AFK players #1294
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
Spectator ability to take over bots and AFK players #1294
Conversation
7bb32c3 to
0568d9c
Compare
This comment was marked as resolved.
This comment was marked as resolved.
015f565 to
63aee57
Compare
At this point, I believe marking the bot as dead/invisible/non-solid is the cleanest way to handle these two cases. Here's a video that demonstrates a player taking over a bot and disconnecting: bot_takeover_player_disconnect.mp4In order to add some options to mitigate griefing with this feature, I have added a configurable minimum XP threshold under which players cannot use the takeover feature anymore. This is aimed specifically for a self Known bug? I wasn't able to get the AFK feature working on my test setup, because GetTimeSinceLastUserCommand() always returns 0 with my local test setup. For now I have left the feature convar disabled by default. |
08ebb0c to
4c3b01f
Compare
|
The latest changes involve changing the criteria for which players are counted as AFK to use a different timer based on the last time they fired their weapon. This is admittedly kind of a jank workaround for the previous timer always being 0, but at least it allowed me to test takeovers of AFK players. That led to removing the freezing flag from the taken over player, because there was a bug where an AFK player could not move around as a spectator after being taken over, until the round reset. As far as I can tell, I have addressed the feedback from earlier threads, so I will mark those as resolved, but feel free to revisit them to see if I have addressed the issues in the way that is satisfactory. |
|
@sunzenshen Thanks! Is this PR good for another review, then? |
Yup, would appreciate any thoughts. |
This comment was marked as outdated.
This comment was marked as outdated.
030f808 to
044caa6
Compare
044caa6 to
86d56ea
Compare
Rainyan
left a comment
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.
LGTM, tested again with 2 Steam clients (1 Windows, 1 Linux). Sorry about the delay with the review.
86d56ea to
9a9fea7
Compare
9a9fea7 to
f1b7a7d
Compare
|
Done resolving the merge conflict, it was just an additional newline at the neo_player.cpp that caused a collision. Squashed to simplify the rebase, rebuilt, and sanity checked that the feature still works on a single machine. |
NeotokyoRebuild#1254 Clarify when to hard reset and not for takeover revert Configurable post-takeover loadout change Allow AFK to PreThink player takeover Evaluate everywhere SpectatorTakeoverPlayerRevert should be called Also check that AFK player has not returned when reverting Prevent loadout change after takeover Also fix ghost capture single point award for possessing player. Refactor CTG and VIP game modes to use same award logic Also transfer possessed XP in Winning Team logic. Fix 2nd extra death of taken over player - new USERID2NEOPLAYER macro similar to USERID2PLAYER - don't penalize taken over player for possessing player's mistakes - increase AFK time threshold because WIP approach of getting last weapon fired time might lead to premature takeover situations. - Remove version of restore player from takeover that also transferred a 2nd death event. Allow AFK players to move after getting kicked to spectate. Change AFK timer check to use GetTimeSinceWeaponFired Because GetTimeSinceLastUserCommand seems to be always 0 if player is connected, and I want this to work on LAN. Also tweaked the failed takeover messages to be more lore appropriate, though at the possible risk of less clarity.
- Increase AFK takeover time threshold - Format nit for IsAFK
e2506da to
80e916c
Compare
bot_takeover_post_lamdba_refactoring_mistake.mp4 |
Description
Proof of concept for taking over AFK players and bots as a spectator
Toolchain
Linked Issues