custom-king-of-the-hill-template

Share

Report
Custom King of The Hill Template

Prefab

KING OF THE HILL

An open-source Battlefield 6 Portal King of the Hill game mode by Enoc Bernal / mindflexor.

This is a Hardpoint-style KOTH mode where both teams fight over one active hill at a time. Hold the hill to score, contest it to deny points, and rotate through the full objective sequence until one team reaches the target score.

Play now:

KOTH Experience Code: 1XPDC

Source Code / Package

GitHub Repository: https://github.com/mindflexor/bf6-koth-mod

This package includes:

  • TypeScript source code
  • Portal-ready build workflow
  • Strings file
  • Deployment scripts
  • Optional spatial reference files
  • Godot spatial project reference
  • Siege of Cairo KOTH spatial reference
  • Documentation for rules, object IDs, spawning, and publishing

Mode Overview

King of the Hill - is built around a rotating active objective system.

Teams fight over one active hill at a time. The team holding the active hill earns score every second. If both teams are inside the active hill, the hill becomes contested and no team scores. Empty hills and locked-preview hills do not score.

The mode rotates through five objectives:

A -> B -> C -> D -> E

Core Rules

  • One active hill at a time
  • Hills rotate in fixed order: A -> B -> C -> D -> E
  • Each hill lasts 85 seconds
  • Next hill appears as a locked preview before it activates
  • Team 1 alone on the active hill scores +1 per second
  • Team 2 alone on the active hill scores +1 per second
  • Enemy presence contests the hill
  • Contested hills do not score
  • Empty hills do not score
  • First team to 250 points wins
  • Default match time limit: 60000 seconds
  • Post-match delay: 12 seconds
  • Victory/defeat imminent warning starts at 225 points

Current Included Map Reference

Siege of Cairo KOTH

Included spatial files:

  • spatials/MF_Siege_of_CairoKOTH.spatial.json
  • Godot Project/MF_Siege_of_CairoKOTH.tscn

These files are included as optional spatial references for map authoring and are not imported directly by the TypeScript bundle.

Features

  • Fully scripted King of the Hill game logic
  • Five rotating hill objectives
  • Active objective HUD
  • Objective status UI
  • Live score display
  • Objective timer display
  • Runtime world icons
  • Locked next-objective preview
  • Contested hill state
  • Victory and defeat imminent banners
  • Native custom scoreboard columns
  • Hill time tracking
  • Kills, deaths, and assists scoreboard support
  • HQ deploy setup
  • Runtime spawn routing near active objectives
  • Spawn safety checks
  • Enemy-pressure-aware spawn selection
  • Fallback behavior if configured spawn anchors are missing
  • Prematch, ready-up, prelive, live, and postmatch flow
  • Portal deployment workflow through npm scripts

Scoreboard

The custom scoreboard supports:

  • Score
  • Kills
  • Deaths
  • Assists
  • Hill Time

Object ID Assignment

Active Hill Area Triggers

501 - Hill A 502 - Hill B 503 - Hill C 504 - Hill D 505 - Hill E

Objective Visibility Sector Layers

200 - Team 1 owned hill sector 300 - Team 2 owned hill sector 400 - Neutral / locked / empty / contested sector

Capture Point Display Objects

201-205 - Team 1 hill capture point display objects 301-305 - Team 2 hill capture point display objects 401-405 - Neutral hill capture point display objects

HQ Spawners

1 - Team 1 HQ 2 - Team 2 HQ

Spawn Presence / Pressure Zones

901 - North West presence zone 902 - North East presence zone 903 - South West presence zone 904 - South East presence zone

Runtime Spawn Anchor Groups

Hill A anchors:

  • 1311-1315
  • 1321-1325
  • 1411-1415
  • 1421-1425

Hill B anchors:

  • 2311-2315
  • 2321-2325
  • 2411-2415
  • 2421-2425

Hill C anchors:

  • 3311-3315
  • 3321-3325
  • 3411-3415
  • 3421-3425

Hill D anchors:

  • 4311-4315
  • 4321-4325
  • 4411-4415
  • 4421-4425

Hill E anchors:

  • 5311-5315
  • 5321-5325
  • 5411-5415
  • 5421-5425

Disabled Legacy HQ IDs

The mode disables legacy HQ IDs:

3-20 8888 8889

Spawn System Notes

The deploy screen keeps Team 1 HQ and Team 2 HQ available.

After deployment, the KOTH runtime queues players to spawn anchors near the active objective. The spawn system evaluates distance, enemy pressure, friendly presence, and safety before choosing a runtime spawn location.

Default spawn tuning:

  • Ideal objective distance: 60m
  • Minimum objective distance: 45m
  • Maximum preferred objective distance: 80m
  • Hard maximum objective distance: 120m
  • Enemy safety radius: 25m
  • Queued anchor enemy safety radius: 40m
  • Teammate teleport enemy safety radius: 40m

If a configured anchor is missing, the system logs a one-time warning and falls back to the HQ deployment path instead of breaking the match.

Runtime Systems

The mode is organized into live runtime services:

  • KothHillService Handles hill membership, control state, objective visibility, and rotation.

  • KothScoreService Handles team score, hill time, win detection, and imminent victory/defeat banners.

  • KothWorldIconService Handles runtime world icons at hill capture point positions.

  • KothSpawnService Handles HQ deployment, spawn routing, spawn cluster ownership, queued teleport jobs, and safety checks.

  • KothScoreboardService Handles native custom scoreboard columns for score, kills, deaths, assists, and hill time.

  • KothUiService Handles live HUD widgets, objective status, score display, and timers.

The phase runtime handles:

  • Prematch
  • Ready-up
  • Prelive
  • Live handoff
  • Postmatch

Map Authoring Notes

To build another map for this mode:

  1. Place hill area triggers using IDs 501-505.
  2. Place capture point display objects using the Team 1, Team 2, and Neutral ID ranges.
  3. Keep sector layers 200, 300, and 400 available for ownership visibility.
  4. Keep HQ spawners 1 and 2 available for deployment.
  5. Place runtime spawn anchor common objects for the configured anchor IDs.
  6. Keep the live KOTH config files synced with your authored object IDs.
  7. Use the included spatial files as a reference for layout and object placement.

Build Requirements

  • Node.js 24 or newer
  • Editable Battlefield Portal experience
  • Portal deployment credentials in .env when deploying

The Portal SDK typing surface is vendored under:

src/vendor/portal-sdk/

This prevents the project from depending on stale public mod type packages.

Build Commands

Install dependencies:

bash npm install

1XPDC
Edit

Created by

pfp

mindflexor

on

June 14, 2026, 8:49 p.m.

last updated at

June 14, 2026, 8:50 p.m.

16