Skip to content
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

Add overtime when round ends in a tie #292

Closed
wants to merge 2 commits into from

Conversation

GooberRF
Copy link
Contributor

@GooberRF GooberRF commented Oct 19, 2024

This PR adds sudden death overtime as an optional feature for server operators. If enabled, when the time limit is reached, if the score is a tie, some additional time (configurable) will be added and the game will end either when that additional time has elapsed, or the tie is broken (whichever comes first).

Configuration of the feature in dedicated_server.txt is as follows (default values shown):

    $DF Overtime Enabled: false
        +Duration: 5

"Ties" for the purpose of overtime are defined as:

  • DM: At least 2 players are tied for the highest score.
  • TDM: Red and blue have the same score.
  • CTF: Red and blue have the same number of captures OR the delta is 1, and a flag is currently stolen which, if captured, would tie the game.

(in the case of CTF, if the game is tied because a flag is stolen and would tie the game if captured, the tie is broken if that flag is returned)

A few other minor points:

  • I had to reimplement most of multi_check_for_round_end_hook to support overtime either way, but I also took the opportunity to restructure the code using modern C++ methods as opposed to the stock game implementation.
  • Unlike the stock code, my new code no longer continually attempts to initiate a level change every frame after the round ends. In theory this should be a performance improvement but I've not attempted to measure it or anything.

@GooberRF GooberRF closed this Feb 3, 2025
@GooberRF GooberRF deleted the overtime branch February 3, 2025 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant