Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
ValheimBattleRoyale
Server-authoritative Battle Royale safe zones for Valheim with shrinking circles, synchronized timers, map overlays and configurable zone damage.
By Xtasy
| Date uploaded | 2 weeks ago |
| Version | 1.0.4 |
| Download link | Xtasy-ValheimBattleRoyale-1.0.4.zip |
| Downloads | 29 |
| Dependency string | Xtasy-ValheimBattleRoyale-1.0.4 |
This mod requires the following mods to function
denikson-BepInExPack_Valheim
BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.
Preferred version: 5.4.2350README
Valheim Battle Royale
Battle Royale system for Valheim with server-controlled matches, shrinking safe zones, synchronized map circles, outside-zone damage, automatic PvP and an in-game HUD.
Requirements
- BepInEx for Valheim
- The mod must be installed on the server and on every participating client.
- The server and every participating client must run 1.0.4. The new RPC protocol is incompatible with 1.0.3.
Install ValheimBattleRoyale.dll into:
BepInEx/plugins/
Replace the previous DLL rather than keeping multiple versions installed. The configuration file is generated at BepInEx/config/com.xtasy.ValheimBattleRoyale.cfg.
The server waits for each client's 1.0.4 state acknowledgement before sending zone damage to that client. Clients with an incompatible or missing mod cannot participate correctly.
Main Features
- Server-controlled Battle Royale state
- Match start countdown
- Automatic PvP during the match
- Restoration of the previous PvP setting when the match ends
- Current and next safe zones
- Smooth zone shrinking
- Safe-zone circles on the large map and minimap
- Server-authorized outside-zone damage
- Damage that bypasses armor, blocking and elemental resistance
- Cosmetic fire effect outside the zone
- Valheim TextMeshPro / Norse Bold HUD
- English and Russian localization
- Administrator hotkey and console commands
- Runtime configuration reload
- Snapshot retries and reconnect recovery
- Rate-limited RPC, zone, HUD and damage diagnostics
Match Flow
- Create the initial safe zone.
- Press
F7or usebr start. - The configured start countdown begins.
- When the countdown finishes, the match becomes active and PvP is forced ON for every player.
- Assign the NEXT safe zone.
- After
WaitBeforeShrink, the current zone begins shrinking toward NEXT. - Players outside the effective current zone receive
OutsideDamage. - When shrinking finishes, NEXT becomes CURRENT.
- Assign another NEXT zone and repeat.
- Press
F7again or usebr stopto stop the match. - Each client restores the player's PvP setting from before the match.
NEXT may also be assigned before the match starts. In that case, its waiting timer starts when the match becomes active. Stopping during a shrink freezes CURRENT at its effective center and radius and retains NEXT for a later restart.
PvP
PvP is not forced during the start countdown.
When the Battle Royale becomes active, the mod captures the local player's current PvP setting and enables PvP if necessary. Attempts to disable PvP through SetPVP are blocked while the match is running. Repeated PvP notifications are suppressed.
Players who join an already active match also receive PvP after synchronizing the Battle Royale state.
When the match stops, the captured PvP setting is restored: players who already had PvP enabled keep it enabled; players who had it disabled return to that setting.
Safe Zones
The system uses two zones:
CURRENT— active safe zone.NEXT— destination of the next shrink.
The current zone is shown in green and the next zone in yellow.
Both are rendered on the world map and minimap.
Initial Zone
On the large map:
Shift + Left Click
If no CURRENT zone exists, this creates the initial zone using InitialRadius.
Console alternatives:
br zone <x> <z> [radius]
br here [radius]
Next Zone
If CURRENT already exists:
Shift + Left Click
creates NEXT.
Without an explicit radius:
NextRadius = CurrentRadius × NextRadiusMultiplier
The automatic radius is bounded by MinimumRadius, with that minimum capped at the current radius to avoid enlarging a zone. Explicit radii are handled separately; when RequireNextZoneInsideCurrent is enabled, the complete NEXT circle must fit inside CURRENT.
Console alternatives:
br next <x> <z> [radius]
br nexthere [radius]
Move NEXT
During the waiting phase, PlaceZoneHotkey (default: Shift + Left Click) moves an existing NEXT zone while preserving its radius and restarting the waiting timer.
NEXT cannot be moved while shrinking is in progress.
Cancel
Ctrl + Left Click
cancels NEXT when one exists. If there is no NEXT zone, it cancels the current/start zone.
Console:
br cancelnext
Cancellation is blocked during active shrinking.
Zone Shrinking
After NEXT is assigned, the mod waits for:
WaitBeforeShrink = 300
Then CURRENT smoothly interpolates toward NEXT over:
ShrinkDuration = 180
Both the center and radius change during the shrink.
Clients use the server-provided waiting and shrink durations rather than their local timing settings. Match timers use real elapsed time, independently of changes to world time. Clients estimate server time from received snapshots; timing can differ slightly due to network delivery latency.
When the transition completes, NEXT becomes CURRENT.
Outside-Zone Damage
Default configuration:
OutsideDamage = 10
DamageInterval = 2
With these values, an outside player loses 10 HP every 2 seconds.
The server checks connected peers and their character ZDOs, including players outside its loaded scene, to determine who is outside the effective CURRENT zone. It sends the authorized damage to the owning client, which applies the health change according to Valheim's ownership model.
Damage commands identify the character, match, zone revision and tick. Duplicate, expired and outdated commands are rejected. The client acknowledges the execution result and health before/after the tick. A character whose ZDO or ownership is not ready is skipped with a diagnostic message rather than receiving damage based on an approximate position.
No zone damage is applied during the match start countdown or after the match has stopped.
Battle Royale zone damage bypasses:
- armor
- blocking
- fire resistance
- elemental resistance
The visible burning effect is cosmetic and is not the source of the damage.
Both nonlethal and lethal ticks directly reduce HP, bypassing ordinary damage filters, including armor, blocking, dodge and resistance. A lethal tick sets HP to zero and invokes the standard CheckDeath / Player.OnDeath pipeline for death, tombstone and respawn handling. The direct HP change also bypasses god-mode damage filtering. Mods that intercept only ordinary Character.Damage hits will not see these ticks as normal hits.
HUD
The HUD uses Valheim's native TextMeshPro font asset:
Valheim-Norsebold
It displays:
- match start countdown
- time until shrinking
- active shrink countdown
- outside-safe-zone warning
The main status block is positioned below the minimap, with a fallback position and bounds that keep it on screen. If Norse Bold is not yet available, the HUD uses the default TMP font where available and retries loading the native font. Missing HUD elements are recreated.
Before the first snapshot arrives, the HUD displays a synchronization indicator. An active match with no pending NEXT zone is in Idle: it shows match status but no zone countdown. Set ShowHud = true in the local client's configuration to display the HUD.
Localization
Supported automatically:
- English
- Russian
English is used as the fallback for unsupported languages.
Controls
All administrator shortcuts are configurable in the BepInEx configuration file. The defaults are shown below.
| Control | Action |
|---|---|
F7 |
Start/stop Battle Royale |
PlaceZoneHotkey (default: Shift + Left Click) on map |
Create initial/NEXT zone or move NEXT |
CancelZoneHotkey (default: Ctrl + Left Click) on map |
Cancel NEXT/current zone |
Administrative actions are validated by the server.
Customizing Map Shortcuts
Edit the [Controls] section in the BepInEx configuration file:
[Controls]
StartHotkey = F7
PlaceZoneHotkey = Mouse0 + LeftShift
CancelZoneHotkey = Mouse0 + LeftControl
StartHotkey starts or stops the match. PlaceZoneHotkey creates or moves zones on the large map. CancelZoneHotkey cancels the pending NEXT zone or, when no NEXT exists, the current/start zone.
The bindings use BepInEx KeyboardShortcut syntax. The order and formatting of the serialized keys may differ from the examples. Use the values generated by BepInEx as a reference.
Mouse button names:
| Key | Mouse button |
|---|---|
Mouse0 |
Left mouse button |
Mouse1 |
Right mouse button |
Mouse2 |
Middle mouse button (wheel click) |
Mouse3 |
Additional mouse button (if available) |
Mouse4 |
Additional mouse button (if available) |
For example, Mouse0 + LeftShift means holding the left Shift key while clicking the left mouse button. Mouse1 + LeftControl means holding left Ctrl while clicking the right mouse button.
Shortcut settings can be reloaded at runtime through the mod's configuration reload mechanism. Map shortcuts are intended for the large world map, not the minimap.
Console Commands
br start
br stop
br toggle
br status
br zone <x> <z> [radius]
br next <x> <z> [radius]
br here [radius]
br nexthere [radius]
br cancelnext
br start
Starts the match countdown. A current safe zone must already exist.
br stop
Stops the Battle Royale and restores each local player's previous PvP setting. CURRENT is frozen at its effective center/radius if shrinking was active.
br toggle
Starts or stops the match depending on the current state.
br status
Displays match/zone state, synchronized timing and damage values, snapshot availability, state revision and time since the last received client snapshot.
br zone <x> <z> [radius]
Creates or changes CURRENT.
br here [radius]
Creates CURRENT centered on the administrator.
br next <x> <z> [radius]
Creates NEXT.
br nexthere [radius]
Creates NEXT centered on the administrator.
br cancelnext
Cancels the pending NEXT zone. Cancellation is rejected while shrinking is active.
Default Configuration
[Controls]
StartHotkey = F7
PlaceZoneHotkey = Mouse0 + LeftShift
CancelZoneHotkey = Mouse0 + LeftControl
[Match]
StartCountdown = 10
[Zone]
InitialRadius = 3000
NextRadiusMultiplier = 0.5
MinimumRadius = 25
WaitBeforeShrink = 300
ShrinkDuration = 180
RequireNextZoneInsideCurrent = true
[Damage]
OutsideDamage = 10
DamageInterval = 2
[UI]
ShowHud = true
[Diagnostics]
Enabled = true
SummaryInterval = 30
Configuration
StartHotkey
Administrator hotkey used to start or stop the match.
PlaceZoneHotkey
Configurable keyboard/mouse shortcut for creating or moving zones on the large map. Default: left Shift + left click.
CancelZoneHotkey
Configurable keyboard/mouse shortcut for cancelling the NEXT or current/start zone on the large map. Default: left Ctrl + left click.
StartCountdown
Seconds between starting the Battle Royale and the match becoming active.
InitialRadius
Radius used for the initial safe zone.
NextRadiusMultiplier
Multiplier used to calculate NEXT when no explicit radius is supplied.
MinimumRadius
Minimum automatically calculated safe-zone radius.
WaitBeforeShrink
Seconds between assigning NEXT and beginning the shrink.
ShrinkDuration
Duration of the CURRENT → NEXT transition.
RequireNextZoneInsideCurrent
When enabled, the complete NEXT zone must fit inside CURRENT.
OutsideDamage
HP removed per outside-zone damage tick.
DamageInterval
Seconds between outside-zone damage ticks.
ShowHud
Enables or disables the Battle Royale HUD on the local client.
[Diagnostics] Enabled
Enables RPC, zone, HUD and damage summaries. Warnings remain enabled even when summaries are disabled.
[Diagnostics] SummaryInterval
Seconds between repeated diagnostic summaries. Default: 30; supported range: 5–300 seconds. Repeated warnings are limited separately, usually to once every 10 or 30 seconds.
Runtime Configuration Reload
The configuration file is monitored and reloaded while the game is running.
Reloads are applied on the Unity main thread. Gameplay timing and damage values must be changed on the server; clients receive the effective values through state snapshots.
WaitBeforeShrinkchanges apply to an existing waiting phase, measured from its original assignment time.ShrinkDurationis captured when a shrink begins. A reload changes the next shrink without changing an active transition.OutsideDamageandDamageIntervalupdate future damage ticks; a tick already scheduled may retain its previous deadline.StartCountdownaffects future match starts.- Radius calculation settings affect future zone assignments.
- Local controls, HUD visibility and diagnostic settings can be changed without restarting the game.
Server Authority
The server controls or authorizes:
- match state
- current and next zones
- zone phases
- synchronized timing
- administrator requests
- outside-zone detection
- outside-zone damage
Clients render synchronized UI/map information and apply server-authorized player-owned health changes. State and damage RPCs are accepted only from the server peer. Server state snapshots are sent every 5 seconds; clients retry snapshot requests every 3 seconds while waiting for initial state or resynchronization.
The server uses client-replicated ZDO positions, and the owning client executes HP changes. Damage acknowledgements provide diagnostics; they are not an independent anti-cheat guarantee.
Diagnostics and Troubleshooting
Keep [Diagnostics] Enabled = true during multiplayer testing. Logs are written through BepInEx to BepInEx/LogOutput.log and use the [BR104 server] or [BR104 client] prefix.
| Symptom | What to check |
|---|---|
| Missing HUD timer | Check ShowHud, HUD summaries, font availability and State RX. A countdown appears during Starting, Waiting or Shrinking, not Idle. |
| No outside-zone damage | Check server Damage TX, client Damage RX and server Damage ACK. Look for missing character ZDO/owner, state-mismatch, character-not-ready, health-unchanged or death-error. |
| Incompatible or disconnected client | Check State ACK, No recent state ACK, and Damage deferred. Confirm that both server and client run 1.0.4. |
| Repeated PvP changes | Check Prevented disabling PvP and Suppressed repeated PvP notification messages to identify repeated attempts. |
For a multiplayer issue, collect the full server log and the affected clients' logs from the same test. Compare peer IDs, character IDs, match IDs, zone revisions and damage sequence numbers.
Validation
The 1.0.4 Release build completed with zero errors and warnings using the available local Valheim, BepInEx and Harmony libraries. The compiled state serializer passed 210 checks covering roundtrips, server parameters, invalid values and truncated packets.
Live gameplay, HUD rendering, installation of Harmony patches in the running game, interactions with other mods and the 10-player multiplayer test have not been run as part of this validation.
Version
1.0.4
CHANGELOG
Changelog
1.1.0
-
Fixed host/server control commands reading a locally written packet at its end. Local command packets are rewound before processing.
-
Fixed outside-zone damage incorrectly skipping living characters whose health field is absent from their ZDO. Missing health now follows the game's default-health semantics; explicit dead, nonpositive or invalid health remains excluded.
-
Added a transport-level ingress check before routed BR messages are handled or forwarded. Claimed sender identity must match the actual connected peer, and message direction and destination must be valid. Client-originated BR state/damage messages and forwarding to other clients are rejected.
-
Added rate-limited diagnostics for rejected routed messages and missing explicit health values.
-
Updated plugin and assembly versions to 1.1.0 / 1.1.0.0 and the BR protocol to 110.
-
Fixed PvP notification filtering by patching the actual Player.Message override. Repeated enable notifications remain suppressed across respawns within a match.
-
Preserved the original PvP setting across player-object replacements. If a match ends while the player is dead or absent, restoration waits for a living local player; disconnect/unload clears session state.
-
Blocked map shortcuts while chat, text entry, menus, inventory or virtual keyboard are active. Map commands now require a pointer hit on the map rather than an overlapping control.
-
Corrected br status: server state age is reported as N/A(server), and clients without a snapshot show N/A(no snapshot).
-
Added HUD component recovery and diagnostics for active/enabled state, timer rectangle and canvas state. A missing canvas triggers recreation.
Upgrade
Install 1.1.0 on both the server and all clients. Versions 1.0.3 and 1.0.4 do not share this protocol. Restart the server and clients after replacing the plugin DLL.
Validation and scope
The source was compiled against the available local Valheim/BepInEx libraries. Automated checks cover the ingress authorization matrix, health semantics, command packet round trips, version metadata and zone-state serialization. No live multiplayer, HUD rendering or end-to-end network attack test was performed.
This release addresses all confirmed P1/P2 findings from the October 25 review. The additional PvP, map-input and HUD changes were compiled and reviewed against local game APIs; the 688 existing managed checks do not simulate these Unity lifecycle/UI paths. The original missing-HUD report still requires a live reproduction.
1.0.4
Fixed
- Fixed repeated PvP notifications and prevented disabling PvP during active matches. The previous PvP setting is restored afterward.
- Fixed outside-zone player detection by checking connected peers and character ZDOs, including players outside the server's loaded scene.
- Prevented duplicate, expired and outdated damage commands from affecting the wrong character or match.
- Made lethal zone damage use direct health reduction followed by the standard Valheim death pipeline.
- Fixed missed initial snapshots, reconnect recovery and duplicate RPC registration.
- Fixed administrator authorization, malformed-packet handling, zone cancellation, match restarts and configuration reload handling.
- Improved HUD recovery, font loading and screen positioning.
Added
- Added character, match, zone revision and tick identifiers to damage RPCs.
- Added damage acknowledgements with execution results and health values before and after each tick.
- Added snapshot retries and periodic state synchronization.
- Added a HUD synchronization indicator.
- Added rate-limited diagnostics for server/client RPCs, zone synchronization, HUD and damage application. Repeated summaries default to once every 30 seconds.
Changed
- Zone timers, shrink duration and damage settings now use server-provided values.
- Updated the RPC protocol. The server and all clients must run 1.0.4; the new protocol is incompatible with 1.0.3.
Validation
- Release build completed with zero errors and warnings.
- Passed 210 state-packet checks. Live gameplay and the 10-player multiplayer test have not been run.
1.0.3
Fixed
- Fixed a compilation error caused by a leftover reference to the removed
shiftvariable. - Removed the unused
_shiftWasDownfield after migrating map controls to configurable shortcuts.
1.0.2
Changed
- Added mouse button explanations to the configuration descriptions for zone placement and cancellation.
- Documented
Mouse0(left click),Mouse1(right click), andMouse2(middle/wheel click).
1.0.1
Added
- Added configurable
PlaceZoneHotkeyandCancelZoneHotkeyshortcuts. - Added support for changing the modifier and mouse button used for zone placement and cancellation.
- Zone control shortcuts now use BepInEx
KeyboardShortcutsettings and support runtime configuration reload.
Changed
- Replaced hardcoded Shift/Ctrl + left-click zone controls with configurable bindings.
1.0.0
Added
- Server-controlled Battle Royale match system.
- Configurable match start countdown.
- Automatic PvP for all players when the match starts.
- Automatic PvP disable when the match stops.
- PvP is continuously enforced while a Battle Royale match is active.
- Late joiners automatically enter PvP after receiving the active match state.
- Initial and next safe zones.
- Configurable initial radius, next-zone multiplier and minimum radius.
- Configurable delay before shrinking and shrink duration.
- Optional requirement that the next zone fits completely inside the current zone.
- Smooth synchronized interpolation of safe-zone center and radius.
- Current and next safe-zone circles on the world map and minimap.
- Administrator map controls for creating, moving and cancelling zones.
- Server-authorized outside-zone damage for remote players.
- Zone damage bypasses armor, blocking and elemental resistances.
- Normal Valheim death handling for lethal zone damage.
- Cosmetic burning effect outside the safe zone.
- TextMeshPro HUD using Valheim's native
Valheim-Norseboldfont asset. - Automatic English and Russian localization.
- HUD countdowns for match start, waiting phase and active shrinking.
- Outside-safe-zone warning.
- Runtime configuration reload.
- Server-side validation of administrator Battle Royale requests.
- Console commands for match and zone administration.
Fixed
- Fixed outside-zone damage not reducing health for remote/non-host players.
- Fixed lethal direct HP removal causing errors in Valheim's death pipeline.
- Fixed compatibility with Valheim builds where
GetServerPeerID()is private. - Fixed inconsistent Russian HUD glyphs caused by IMGUI font fallback.
- Fixed inconsistent title/timer font sizes.
- Removed deprecated TextMeshPro
enableWordWrappingusage.