Add maskSkill setting to hide exact skill values from other players - #92
Add maskSkill setting to hide exact skill values from other players#92tomjn wants to merge 1 commit into
Conversation
New opt-in global setting maskSkill (default 0, off). When enabled, skill values shown to other players are rounded down to the nearest 10 with a floor of 10, to prevent lower-skilled players from being singled out: - sendPlayerSkill: the battle script tag is broadcast identically to all clients, so it cannot be per-viewer; the masked value is sent to everyone. Team balancing is unaffected (it reads %battleSkills directly). - getBattleLobbyStatus (!status): masked per-viewer; a player still sees their own exact skill, and privileged users (level >= privacyTrustLevel) see exact values for everyone. Adds getMaskedSkill() helper, registers maskSkill in %globalParameters, the spads.conf template, and a helpSettings.dat entry.
|
Thanks for this PR, however I'm not sure a host-scoped setting is ideal to manage privacy (what's the point of hiding precise skill values on your host if on all the other hosts the exact skill values are shown ?). If SLDB is used with TrueSkill, then the global If a custom skill algorithm is used through a SPADS plugin (implementing the updatePlayerSkill customization callback), then imo this plugin is the correct place to manage privacy modes. Currently, plugins can already alter the way the skill values are presented to the users in the |
Summary
Adds a new opt-in global setting
maskSkill(default0, disabled) that hides exact skill values from other players, to mitigate lower-skilled players being singled out / bullied over their rating.When enabled, skill values shown to others are rounded down to the nearest 10, with a floor of 10. The real skill is still used internally for everything (team balancing is unaffected).
Behaviour
Skill is exposed through two channels, handled differently because of a hard constraint:
sendPlayerSkill) —SETSCRIPTTAGS game/players/<name>/skillis broadcast identically to every client in the battle, so it cannot be made per-viewer. WhenmaskSkillis on, the masked value (~N) is sent to everyone. This is consistent with the existing private-TrueSkill broadcast form, which already sends~N.!statuscommand (getBattleLobbyStatus) — this is per-viewer, so masking is conditional: a player still sees their own exact skill, and privileged users (access level>= privacyTrustLevel) see exact values for everyone. Everyone else sees~N.Masking is applied uniformly regardless of skill origin (rank / TrueSkill / Plugin / etc.).
Changes
getMaskedSkill()helper:max(10, int(skill/10)*10).maskSkillregistered in%globalParameters(SpadsConf.pm),etc/spads.conftemplate, and ahelpSettings.datentry.sendPlayerSkilland in both the player and spectator branches ofgetBattleLobbyStatus.Verification
No automated tests exist in this project and SPADS cannot run in a dev checkout, so this has not been verified at runtime — only:
perl -c(with a stub harness) passes forspads.plandSpadsConf.pm.helpSettings.datround-trips throughloadHelpSettingsFilewith the new entry parsed into all fields.getMaskedSkill()rounding/floor logic unit-checked in isolation (round down to nearest 10, floor 10, fractional and out-of-range inputs).Runtime behaviour (lobby broadcast +
!statusrendering on a live host) still needs human verification. Default-off, so existing deployments are unaffected until opted in.Draft pending that real-host verification.