-
Notifications
You must be signed in to change notification settings - Fork 20
Fixes for ghost beacons #1442
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
Fixes for ghost beacons #1442
Conversation
Agiel
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.
Good work!
186b85c to
deabc00
Compare
Fix NeotokyoRebuild#1426 where spectators of a ghost carrier would see the ghost beacon UI visuals immediately, instead of having the correct ghost bootup delay applied. Fix NeotokyoRebuild#1441 where our ghost beacons max range was slightly incorrect. Also fix some incorrect ghost beacons related cvar naming with the proper `cl_neo_...` and `sv_neo_...` prefixes, and refactor some of the cvar locations. The previously client-sided cvar "neo_ghost_delay_secs" has moved server side, and an additional server cvar "sv_neo_serverside_beacons" is introduced to toggle between this new server-sided behaviour (which is now the default), and the old client-sided FCVAR_CHEAT based solution. In the server-sided mode, off-PVS enemies will no longer be networked to the ghoster until they are ready to be displayed, and the ghost beacon beep sounds will be handled server-side (since we can no longer know the nearest off-PVS enemy distance client-side in such cases). The timing to network this server-sided state is estimated from the ghoster's average latency, with some extra for safety to ensure they should still arrive in time. This "sv_neo_serverside_beacons" server-side mode is somewhat experimental, and probably needs playtesting to verify it's working correctly. The unfortunate side-effect of the server-sided mode is that the ghost beacon beep sounds are no longer playing at the exact distance-based timings (since they depend on the EmitSound server->client packet arrival latency), which means at least theoretically they aren't quite as accurate anymore for estimating the nearest enemy distance for ghosters with wildly fluctuating ping or otherwise unstable connection. One alternative worth exploring could be to explicitly network the nearest enemy distance as a netprop to the ghoster, since someone attempting to use the networked data to cheat could already derive an approximation of the nearest enemy distance from the ghost beep frequency anyway.
The "sv_neo_serverside_beacons" feature introduced in 23f5cd9 has been improved; when enabled, we now perform the ghost beacon beep sounds again client-sided, while retaining the benefits of calculating most of the ghoster-related logic (like the bootup sequence duration and distance) server-sided. "sv_neo_serverside_beacons 1" is now the recommended value for this option. In the "sv_neo_serverside_beacons 0" mode, ghosters who have the ghost equipped will instantly be transmitted all enemy player netprops, as a legacy option. The ghost beacons logic has also been refactored to remove some of the dependencies between gamerules and the ghost.
deabc00 to
bd7a09a
Compare
|
Well, this PR grew a bit larger than I expected. There's now more logic on whether to network enemies to the ghoster based on ghost activation time, distance etc. This is toggleable with a new cvar Since the ghoster needs to know the distance to nearest enemy for the beacon sound effect's playback interval (it would be a bit unreliable timing-wise to send them from server->client), there's a new Here's an example of the timed beacons networking, tested with beacons.webm |
Description
Fix a problem with spectators seeing the spectated ghoster's beacons instantly, instead of after the delay specified by the cvar
neo_ghost_delay_secs. For the default case, we can derive the ghost equip time from itsm_flNextPrimaryAttack, but for theneo_ctg_ghost_beacons_when_inactivemode I also had to add a new time variable (m_flPickupTime) for tracking when the ghost was initially picked up.Also fixes an inaccuracy for the ghost beacons maximum visible distance.
Toolchain
Linked Issues