You are viewing a potentially older version of this package. View all versions.
Bubba1650-NineKingsPvP-0.2.0 icon

NineKingsPvP

1v1 Synchronous PvP over Steam P2P for 9 Kings! Native Root Menu lobby, simultaneous build & live clashes, 5 synced Hearts, crimson enemy foot rings, Clash auto-speed, version checks, and official server isolation shield.

Date uploaded 2 days ago
Version 0.2.0
Download link Bubba1650-NineKingsPvP-0.2.0.zip
Downloads 22
Dependency string Bubba1650-NineKingsPvP-0.2.0

This mod requires the following mods to function

BepInEx-BepInExPack_IL2CPP-6.0.788 icon
BepInEx-BepInExPack_IL2CPP

BepInEx pack for IL2CPP x64 Unity games. Preconfigured and ready to use.

Preferred version: 6.0.788

README

Nine Kings 1v1 PvP (NineKingsPvP)

A BepInEx 6 (IL2CPP) + Harmony mod for 9 Kings that adds 1v1 Synchronous PvP (Simultaneous Build & Live Clash) over Steam P2P, using 9 Kings' native Gameplay.GameSnapshot and Wave.SpawnWave() board systems.

Official Server Safety & Achievements: All 1v1 PvP lobby and match traffic added by this mod runs over Steamworks Lobbies & Steam P2P (steam_api64.dll). A 5-layer Always-On Isolation Shield blocks 9 Kings' official multiplayer backend hooks (TryGetAuthToken, SubmitMultiplayerRun, SaveMissionSettings, and UnityWebRequest official multiplayer routes) so modded runs never submit to official leaderboards. Steam achievements are also intentionally suppressed during modded 1v1 matches to keep singleplayer progression clean. Never use the official Multiplayer Hub while modded.


How 1v1 Works

Both players build their kingdoms simultaneously through PvE waves, then sync up on every Clash year (every 3 years by default, or every year in Every-Year Duel) to fight each other's live kingdom snapshot head-to-head. Both players start with 5 synced PvP Hearts — first player to lose all 5 Hearts loses the match (with Year 33+ Overtime Clashes until a winner is decided).

Features

  • Native Root Main Menu (1v1 PvP): Adds a native 1v1 PvP button directly onto 9 Kings' Root Main Menu with a Royal Obsidian & Gold uGUI (TauSans Outlined Bold) lobby, 1-click Start 1v1 into King Selection, and an unobstructed in-match HUD placed cleanly between the Gold display and Match Timeline.
  • Steam P2P Lobby & Strict Version Verification: Host Lobby, Invite Friend, Copy/Join by Lobby ID, Find Friends, and automatic mod GUID + version verification (with hardened packet bounds & pre-handshake gating) so mismatched clients never start a desynced match.
  • Host-Authoritative Synced Settings:
    • Clash Format: Every 3 Years (simultaneous PvE build waves between Clashes) or Every Year (Clash every single wave)
    • Difficulty: Synced PvE wave difficulty (Peasant through King, default Knight)
    • Tiebreaker (Double-Win): When both players successfully defend against each other's army on the same Clash year:
      • Draw — neither player loses a Heart
      • Faster Wins — the player who cleared faster wins and the slower player loses 1 Heart (clears within 0.5s count as a Draw)
    • Shop Seed: Random (Independent, default) or Shared (with New reroll)
  • Local QoL & Clash Readability:
    • Clash Speed: Local Auto 1x / Auto 2x / Manual toggle that syncs 9 Kings' native speed buttons during Clashes and restores your saved PvE speed afterward
    • Enemy Foot Rings: Crisp hollow pixel-art crimson foot rings under opponent troops during Clashes (preserves unit pixel art and makes mirror matchups immediately readable)
  • Match Over & Rematch Modal: Non-blocking Clash Result Toasts, Victory confetti/SFX, Clash-by-Clash history, Keep-Lobby Rematch, and clean forfeit detection.
  • Balanced PvE Defeat Penalty: Losing a PvE battle between Clashes restricts that wave's reward shop to 1 random card with no rerolls.
  • Symmetric Clash Castle Auto-Aim: Forced symmetric Auto-Attack during Clashes, 1.5s opening-shot hold, and Smart Cluster + Lead targeting for AoE Castles.

Compatibility & Requirements

  • Game: 9 Kings (Steam, Unity 6000.3.8f1 IL2CPP)
  • Mod Loader: BepInExPack_IL2CPP 6.0.788 (installed automatically via Thunderstore)
  • Multiplayer Version Match: Both players must be running the exact same version of NineKingsPvP (verified automatically on lobby join and handshake).

Playing a 2-Player 1v1 Match

  1. Install NineKingsPvP via Thunderstore Mod Manager / r2modman (recommended), or place NineKingsPvP.dll into BepInEx\plugins\NineKingsPvP\NineKingsPvP.dll alongside BepInEx 6 IL2CPP on both PCs.
  2. Launch 9 Kings via Steam.
  3. Click 1v1 PvP on the Root Main Menu.
  4. Host: Click Host Lobby → Invite Friend (or Copy ID).
  5. Friend: Accept the Steam invite (or click 1v1 PvP → Join by ID / Find Friends).
  6. Host configures Match Settings (syncs automatically to Guest). Both players can set their own Clash Speed.
  7. Click Start 1v1 once connected & verified → pick any King → Start.
  8. During a match, click F9 on the compact top HUD bar (or press F9) anytime to check ping, change Clash Speed, or view > Advanced logs.

Troubleshooting

  • Steam Invite Overlay won't open: Make sure the Steam Overlay is enabled for 9 Kings, or click Copy ID as Host and send the number to your friend to paste via Join by ID.
  • Version Mismatch banner on join: Both players must have the exact same NineKingsPvP version installed (check the version shown in the top-left of the 1v1 PvP menu header).
  • Friend's lobby doesn't appear in Find Friends: Ensure you are Steam Friends and both appear Online (not Invisible), or use Copy ID / Join by ID directly.
  • Reporting a bug: Attach BepInEx\LogOutput.log from your 9 Kings profile folder when opening a GitHub Issue.

Building from Source & Branches

By default, GameDir points to %APPDATA%\Thunderstore Mod Manager\DataFolder\9Kings\profiles\Default. Pass -p:GameDir="C:\path\to\9Kings" if your BepInEx 6 IL2CPP install lives elsewhere.

dotnet build "9 Kings Mod\9 Kings Mod.csproj" -c Release
  • Package GitHub Release ZIP: powershell -ExecutionPolicy Bypass -File .\scripts\release.ps1
  • Package Thunderstore Release ZIP: powershell -ExecutionPolicy Bypass -File .\scripts\package-thunderstore.ps1
  • Branches:
    • main — Public 1v1 Steam P2P release branch only.
    • solo-test — Internal development branch kept in lockstep with main hosting the F10 Solo Bot Test Suite.

License

Released under the MIT License. Not affiliated with or endorsed by the creators of 9 Kings.

CHANGELOG

Changelog

All notable changes to Nine Kings 1v1 PvP (NineKingsPvP) are documented here.

[0.2.1] - Rematch & Restart Year 1 Soft-Lock Hotfix

Fixed

  • Year 1 Soft-Lock on Rematch / Restart: Sanitizes 9 Kings' static Wave and GameplayUI modal/progression flags (Wave._goToNextWaveBlocks, Wave._pendingPlacedCardResolution, GameplayUI.ShowingUI, ShowingEndUIEvents, m_NextUIs, and view OnScreen flags) on match end, before StartNewGame, and on Year 1 entry — fixing the bug where restarting or rematching after a run got stuck on Year 1 until restarting the game.
  • Pause Menu Quick Restart in 1v1: Intercepts PauseMenu → Quit → Quick Restart during an active 1v1 match and routes cleanly through match forfeit/cleanup into King Selection instead of launching a broken half-reset run or attempting to enter the official Multiplayer Hub.
  • Post-Match UI & Rematch Buffer Hygiene: Suppresses post-wave GameplayUI.CallEndWaveUIs() once Match Over is active, detects non-Gameplay scene exits safely, and uses KingSelected-delimited pre-match buffering so late packets from a finished match never contaminate Run #2 while fast-rematching friends stay cleanly in sync.

[0.2.0] - Public Beta: Native Royal UI, Enemy Highlighting & Version Verification

Added

  • Native Root Main Menu Integration (1v1 PvP): Adds a native 1v1 PvP menu button directly onto 9 Kings' Root Main Menu (right below Play), opening a clean Royal Obsidian & Gold uGUI lobby & match setup screen using 9 Kings' native TauSans Outlined Bold font, pixel-art 9-slice frames, and native menu SFX — with 1-click Start 1v1 directly into King Selection.
  • Strict Mod GUID, Version & Packet Validation: Enforces matching com.bubba1650.ninekings.pvp mod GUID and exact plugin version across Steam Lobby metadata, P2P Handshake, and a 10-second verification timeout, plus bounded GZip/chunk reassembly caps, pre-handshake packet gating, Host-only MatchConfig authority, and pre-match snapshot validation.
  • Clash Enemy Highlighting: Attaches crisp hollow pixel-art crimson foot rings beneath opponent troops (including mid-battle summons) during 1v1 Clashes so armies stand out cleanly in mirror matchups without distorting unit pixel art.
  • Clash Auto-Speed Options (Auto 1x / Auto 2x / Manual): Syncs native 9 Kings SpeedControlButton selection visuals during Clashes and restores your saved PvE speed afterward.
  • Native Match Over Fanfare & Confetti: Plays 9 Kings' native GameplayUI.EndUI Victory confetti + win/lose SFX alongside the Royal Match Over & Rematch modal.

Changed

  • Unobstructed Gameplay Layout: No floating UI or corner pill appears on the Main Menu or King Selection; in-match, the compact 1v1 HUD bar and docked [F9] quick drawer sit cleanly in the top gap between the Gold display and the Match Timeline, with Clash Toasts positioned below the timeline.
  • Plain-English Settings & Collapsible Advanced Drawer: Simplified settings labels (Clash, Difficulty, Tiebreaker, Shop Seed, Clash Speed) and tucked P2P diagnostics/event logs under > Advanced.
  • Modular Codebase & Clean Public main Branch: Refactored Gameplay/, Patches/, and UI/ into focused subsystems, and moved the F10 Solo Bot Test Suite exclusively to the solo-test branch so main contains public release source only.

[0.1.3] - True Clash Auto-1x Speed Timing Fix

Fixed

  • Clash Auto-1x Speed (Time.timeScale): Moved the 1x speed drop to fire in GameplayUI_ChangeSpeedView.Show / ApplyInitialState (and CombatOn fallback) after 9 Kings initializes its speed bar, instead of before BeginNextWaveFromPlacedCard() (where m_PreferredFastingForward immediately re-applied 3x). Now truly drops Time.timeScale to 1.00 for Clashes while still allowing manual speed-up mid-Clash, and restores both FastingForward and m_PreferredFastingForward cleanly afterward.

[0.1.2] - Clash Auto-1x Speed QoL

Added

  • Clash Auto-1x Speed (Restores Saved PvE Speed): Automatically drops game speed to 1x via 9 Kings' native GameplayUI.ChangeSpeedView when a PvP Clash launches (still allowing manual speed-up mid-Clash if desired) and snaps right back to your previous PvE speed (2x/3x/1x) as soon as the Clash ends.
  • Local F9 Toggle (Clash Auto-1x Speed: ON/OFF): Independently configurable by both Host and Guest in the F9 panel.

[0.1.1] - Post-Playtest Bugfix & Polish

Fixed

  • Leftover PvE Enemies After PvE Defeat: Explicitly calls 9 Kings' native Wave.Instance.DespawnWaveEnemies() + Wave.ProcessDespawn() after lost PvE Build waves (and before flipping IsMultiplayer = true for upcoming Clash waves), preventing surviving PvE enemies from idling on the battlefield or carrying over into a Clash.
  • Synced PvE Difficulty Range: Expanded the F9 PvE Diff selector to dynamically include all core difficulties through King (Peasant → Squire → Knight → Lord → Baron → Count → Duke → Prince → King) instead of wrapping after Duke.
  • Log Hygiene: Throttled modded Steam achievement suppression logs to once per wave instead of repeating per unit.

[0.1.0] - Initial 2-Player Playtest Build

Added

  • Steam P2P 1v1 Lobby & Networking: Host/Join/Invite Friend via Steamworks (F9 panel), Lobby ID clipboard copy/join, Friend lobby scanner, GZip-compressed chunked reliable P2P packet framing (48 KB chunks), ping/handshake, and disconnect handling.
  • Build & Clash (Every 3 Years) + Every-Year Duel Modes: Live turn-by-turn PvP via 9 Kings' native Gameplay.GameSnapshot and Wave.SpawnWave() board rebuilds.
  • Synced Match Rules (MatchConfig): Host-authoritative rules (read-only on Guest) for Game Mode, Independent vs. Shared Seed (with Reroll), Synced PvE Difficulty (Peasant–King, default Knight), and Double-Win Tie-Breaker (Draw (0 HP) vs. Faster Wins).
  • 5 Synced PvP Hearts & Deterministic Round Arbiter: Wave-keyed sync and arbiter with non-blocking Clash result toasts, full Match Over & Rematch modal (with Clash history + Keep Lobby Rematch), forfeit detection, and Year 33+ Overtime Clashes (DisableWin33 = true).
  • Balanced PvE Defeat Penalty: Losing a PvE battle between Clashes trims that wave's card reward shop to 1 random card and disables rerolls (no empty-hand death spiral; Treasure Chests and Clash shops unaffected).
  • Symmetric Clash Castle Auto-Aim & Stalemate Protection: Forced symmetric Auto-Attack during Clashes, 1.5s opening-shot hold, Smart Cluster + Lead targeting for AoE Castles (Castle, Ent, Stronghold, Bastion), and extended Clash stalemate guard (120s with troops / 45s castle-only).
  • Always-On Official Server Isolation Shield: 5-layer unconditional protection blocking Multiplayer.TryGetAuthToken, UnityWebRequest.SendWebRequest to official backend routes, SubmitMultiplayerRun, SaveMissionSettings, and modded Steam achievements.
  • Release/Debug Build Split: Testing/ Solo Test Suite (F10) compiles in Debug builds only and is automatically stripped from Release builds.