Add a persistent AFK time reserve earned through gameplay and purchasable with bank points #12

Open
opened 2026-10-12 19:58:04 -04:00 by goddard · 1 comment
Collaborator

Implement a shared AFK reserve across T5 and T6. Players receive a free allowance, earn additional time through active play and contribution, and optionally purchase time using bank points.

This replaces unlimited protected AFK. When available time reaches zero, AFK ends and the player immediately becomes vulnerable again.

Earning and storage

Initial rates should be configurable:

Source Reward
Free allowance 30 minutes per rolling 24 hours
Active play 1 minute per 5 active minutes
Round completion with meaningful participation 15 seconds
Every 100 kills 30 seconds
Every 25 headshot kills 15 seconds
Every successful teammate revive 30 seconds
Bank purchase 10,000 points for 10 minutes
  • Store balances against the same persistent player identity used by the bank, shared across servers, maps, T5, and T6.
  • Earned and purchased time persists without expiration, with an initial reserve capacity of six hours.
  • Free allowance is separate, does not accumulate across unused days, and is consumed before saved time. Reconnecting or changing servers must not reset it.
  • Cap combined round, kill, and headshot bonuses at eight minutes per active hour. Active-play earnings are separate.
  • Every successful revive earns time, including repeated revives of the same teammate. Revives have no per-match, per-teammate, or hourly reward limit and are excluded from the performance-bonus cap. The overall reserve capacity still applies. Supporting teammates who frequently go down is intended behavior.
  • Headshot bonuses may stack with kill bonuses.
  • Do not award time while AFK, spectating, or merely connected. Round rewards require participation during that round.
  • Active-play detection must accommodate legitimate support and zombie-holding without relying solely on movement or a minimum kill rate.

Commands and player experience

.afk           Enter protected AFK
.back          Return to play
.afk balance   Show free allowance and saved time
.afk buy 10    Purchase 10 minutes of reserve time
  • Display the price and require confirmation before purchasing.
  • Never spend bank points automatically.
  • Reject purchases exceeding reserve capacity without deducting points.
  • Consume actual elapsed seconds while protected AFK is active.
  • Stop consumption immediately on return, disconnect, death, or match end.
  • Repeating .afk while already AFK must not duplicate deductions or restart allowances.
  • Entering AFK with no available time is rejected with a clear explanation.

Countdown and expiration

While AFK, show a large, prominent countdown in the center of the screen. At zero, automatically end AFK and remove its protection. Restore controls and weapons and release AFK-owned zombie-targeting suppression. There is no spectator transition, automatic purchase, or additional invulnerability grace period on expiration.

  • Display total usable time remaining, including free allowance and saved reserve.
  • Clearly state: “Protection ends when this timer reaches zero.”
  • Increase visual urgency during the final 60 seconds, with audible warnings during the final countdown.
  • Show an explicit expiration message when protection ends.
  • Ensure expiration cannot leave the player frozen, unable to fire, or incorrectly ignored by zombies.
  • Release only state owned by AFK; preserve protection or control restrictions belonging to stock game mechanics.
  • Keep the existing manual .back return behavior separate from automatic expiration.

Gameplay and accounting requirements

  • Resolve the activation and protection-abuse issues tracked in scripts #6, including T5 downed-state handling and repeated combat activation.
  • Build on the identity, persistence, and transaction guarantees planned in EC #146 and scripts #3.
  • Maintain a separate time ledger recording grants, gameplay rewards, purchases, consumption, and corrections.
  • Record accepted AFK state transitions rather than inferring usage from chat commands.
  • Make transactions idempotent and prevent simultaneous sessions from spending the same balance.
  • Reserve authorized time locally so an EC outage does not prematurely terminate protection. The local countdown must still expire at zero.
  • Reconcile interrupted sessions without duplicate charges or losing unused reserved time.
  • Verify zombie-count scaling and define match-ending behavior when everyone is AFK or the last active player dies. AFK must not unintentionally prevent normal match completion.

Fix / acceptance criteria

  • Both engines support earning, purchasing, spending, and persistent balances with the configurable rates, limits, and commands above.
  • Every legitimate revive rewards time, including repeated revives of the same teammate, without per-match, per-teammate, or hourly reward limits.
  • Free allowances cannot be renewed through reconnects or server changes.
  • Countdown display agrees with actual remaining protection and provides the specified warnings.
  • Expiration reliably restores normal vulnerability and player control at zero, without extra grace or a spectator transition.
  • Duplicate commands, retries, concurrent sessions, disconnects, restarts, and backend outages cannot duplicate spending or rewards.
  • T5/T6 in-game validation covers manual return, automatic expiration, downed/dead states, map transitions, and all-player AFK scenarios.
  • EC records active playtime, AFK duration, expirations, purchases, and return-to-play events so the effect on repeat visits and actual usage can be evaluated.
Implement a shared AFK reserve across T5 and T6. Players receive a free allowance, earn additional time through active play and contribution, and optionally purchase time using bank points. This replaces unlimited protected AFK. **When available time reaches zero, AFK ends and the player immediately becomes vulnerable again.** **Earning and storage** Initial rates should be configurable: | Source | Reward | |---|---:| | Free allowance | 30 minutes per rolling 24 hours | | Active play | 1 minute per 5 active minutes | | Round completion with meaningful participation | 15 seconds | | Every 100 kills | 30 seconds | | Every 25 headshot kills | 15 seconds | | Every successful teammate revive | 30 seconds | | Bank purchase | 10,000 points for 10 minutes | - Store balances against the same persistent player identity used by the bank, shared across servers, maps, T5, and T6. - Earned and purchased time persists without expiration, with an initial reserve capacity of six hours. - Free allowance is separate, does not accumulate across unused days, and is consumed before saved time. Reconnecting or changing servers must not reset it. - Cap combined round, kill, and headshot bonuses at eight minutes per active hour. Active-play earnings are separate. - **Every successful revive earns time, including repeated revives of the same teammate. Revives have no per-match, per-teammate, or hourly reward limit and are excluded from the performance-bonus cap.** The overall reserve capacity still applies. Supporting teammates who frequently go down is intended behavior. - Headshot bonuses may stack with kill bonuses. - Do not award time while AFK, spectating, or merely connected. Round rewards require participation during that round. - Active-play detection must accommodate legitimate support and zombie-holding without relying solely on movement or a minimum kill rate. **Commands and player experience** ```text .afk Enter protected AFK .back Return to play .afk balance Show free allowance and saved time .afk buy 10 Purchase 10 minutes of reserve time ``` - Display the price and require confirmation before purchasing. - Never spend bank points automatically. - Reject purchases exceeding reserve capacity without deducting points. - Consume actual elapsed seconds while protected AFK is active. - Stop consumption immediately on return, disconnect, death, or match end. - Repeating `.afk` while already AFK must not duplicate deductions or restart allowances. - Entering AFK with no available time is rejected with a clear explanation. **Countdown and expiration** **While AFK, show a large, prominent countdown in the center of the screen. At zero, automatically end AFK and remove its protection.** Restore controls and weapons and release AFK-owned zombie-targeting suppression. There is no spectator transition, automatic purchase, or additional invulnerability grace period on expiration. - Display total usable time remaining, including free allowance and saved reserve. - Clearly state: **“Protection ends when this timer reaches zero.”** - Increase visual urgency during the final 60 seconds, with audible warnings during the final countdown. - Show an explicit expiration message when protection ends. - Ensure expiration cannot leave the player frozen, unable to fire, or incorrectly ignored by zombies. - Release only state owned by AFK; preserve protection or control restrictions belonging to stock game mechanics. - Keep the existing manual `.back` return behavior separate from automatic expiration. **Gameplay and accounting requirements** - Resolve the activation and protection-abuse issues tracked in [scripts #6](https://gitea.thewrightserver.net/josh/tws-zombies-scripts/issues/6), including T5 downed-state handling and repeated combat activation. - Build on the identity, persistence, and transaction guarantees planned in [EC #146](https://gitea.thewrightserver.net/josh/electric-cherry/issues/146) and [scripts #3](https://gitea.thewrightserver.net/josh/tws-zombies-scripts/issues/3). - Maintain a separate time ledger recording grants, gameplay rewards, purchases, consumption, and corrections. - Record accepted AFK state transitions rather than inferring usage from chat commands. - Make transactions idempotent and prevent simultaneous sessions from spending the same balance. - Reserve authorized time locally so an EC outage does not prematurely terminate protection. The local countdown must still expire at zero. - Reconcile interrupted sessions without duplicate charges or losing unused reserved time. - Verify zombie-count scaling and define match-ending behavior when everyone is AFK or the last active player dies. AFK must not unintentionally prevent normal match completion. **Fix / acceptance criteria** - [ ] Both engines support earning, purchasing, spending, and persistent balances with the configurable rates, limits, and commands above. - [ ] Every legitimate revive rewards time, including repeated revives of the same teammate, without per-match, per-teammate, or hourly reward limits. - [ ] Free allowances cannot be renewed through reconnects or server changes. - [ ] Countdown display agrees with actual remaining protection and provides the specified warnings. - [ ] Expiration reliably restores normal vulnerability and player control at zero, without extra grace or a spectator transition. - [ ] Duplicate commands, retries, concurrent sessions, disconnects, restarts, and backend outages cannot duplicate spending or rewards. - [ ] T5/T6 in-game validation covers manual return, automatic expiration, downed/dead states, map transitions, and all-player AFK scenarios. - [ ] EC records active playtime, AFK duration, expirations, purchases, and return-to-play events so the effect on repeat visits and actual usage can be evaluated.
goddard added the
priority
medium
type/featuregame/t5game/t6needs/ec
labels 2026-10-12 19:58:04 -04:00
josh was assigned by goddard 2026-10-12 19:58:05 -04:00
Author
Collaborator

Reviewed 3bb0b5178e. Not implemented; leaving open.

This review checks the current implementation against every acceptance criterion, regardless of commit references.

Checklist

  • Reserve and commands. Both AFK modules remain unlimited .afk/.back toggles; no balances, earning, purchases, elapsed-time spending or .afk balance/buy parsing exist.
  • Unlimited revive rewards. No revive-based time reward handler exists.
  • Persistent allowance. No free-allowance identity/accounting exists across reconnects or servers.
  • Countdown and warnings. The HUD remains an AFK indicator, without the central protection countdown or final-minute warnings.
  • Immediate expiration. There is no reserve-expiration path. Existing manual .back has a two-second grace tail; it cannot stand in for the requested zero-grace automatic expiry.
  • Accounting safety. The bank infrastructure exists, but there is no AFK time ledger, authorization/reservation, reconciliation or concurrent-session accounting.
  • T5/T6 validation. There is no implemented reserve to validate; the T5 downed guard in #6 also remains absent.
  • EC measurements. No AFK reserve telemetry records active time, consumed time, expirations, purchases or accepted return events.

Review notes

  • Read both AFK scripts and searched the script/plugin trees for reserve commands, countdown/reward handlers and associated API/accounting implementation.
  • The existing bank is a prerequisite, not an implementation of time reserves. Preserve the specified unlimited repeat-revive rewards and immediate vulnerability at zero.
  • The descriptive dependency sentence still mentions repeated combat activation under #6, but #6 was explicitly narrowed to T5 downed activation; this review does not re-expand #6.

Next steps

  • Implement the reserve and EC integration with the documented economics, countdown/expiry behavior and transaction guarantees, then perform the required gameplay scenarios.
Reviewed 3bb0b5178e40ea6d322093283edb39f160542a07. Not implemented; leaving open. This review checks the current implementation against every acceptance criterion, regardless of commit references. **Checklist** - [ ] **Reserve and commands.** Both AFK modules remain unlimited .afk/.back toggles; no balances, earning, purchases, elapsed-time spending or .afk balance/buy parsing exist. - [ ] **Unlimited revive rewards.** No revive-based time reward handler exists. - [ ] **Persistent allowance.** No free-allowance identity/accounting exists across reconnects or servers. - [ ] **Countdown and warnings.** The HUD remains an AFK indicator, without the central protection countdown or final-minute warnings. - [ ] **Immediate expiration.** There is no reserve-expiration path. Existing manual .back has a two-second grace tail; it cannot stand in for the requested zero-grace automatic expiry. - [ ] **Accounting safety.** The bank infrastructure exists, but there is no AFK time ledger, authorization/reservation, reconciliation or concurrent-session accounting. - [ ] **T5/T6 validation.** There is no implemented reserve to validate; the T5 downed guard in #6 also remains absent. - [ ] **EC measurements.** No AFK reserve telemetry records active time, consumed time, expirations, purchases or accepted return events. **Review notes** - Read both AFK scripts and searched the script/plugin trees for reserve commands, countdown/reward handlers and associated API/accounting implementation. - The existing bank is a prerequisite, not an implementation of time reserves. Preserve the specified unlimited repeat-revive rewards and immediate vulnerability at zero. - The descriptive dependency sentence still mentions repeated combat activation under #6, but #6 was explicitly narrowed to T5 downed activation; this review does not re-expand #6. **Next steps** - Implement the reserve and EC integration with the documented economics, countdown/expiry behavior and transaction guarantees, then perform the required gameplay scenarios.
Sign in to join this conversation.