Arena Settings
A Zone (server) contains many Arenas. An Arena = one Map (.lvl) + one settings bundle (the fragments its arena.groovy pulls in via includeFragment). This skill covers the settings half.
Where things live
zone/
├── zone.groovy # zone-wide config (autoLoad, enterSpawn) — see GroovyZoneLoader
├── arenas/
│ ├── (default)/arena.groovy # fallback when arena loaded by unknown name — mirrors testarena content
│ ├── testarena/arena.groovy # canonical "everything live" showcase + zone.groovy enterSpawn target
│ ├── trench/arena.groovy
│ └── deva/arena.groovy
└── conf/
├── base/ # PROJECT baseline — current Infinity tuning (Groovy, 7 ships)
│ ├── ship-warbird.groovy
│ ├── ship-javelin.groovy ... # (7 ships — no shark)
│ ├── prizeweights.groovy
│ ├── cost.groovy
│ └── misc.groovy
├── svs/ # CANONICAL Standard VIE Settings (Groovy, 8 ships)
│ ├── ship-warbird.groovy
│ ├── ship-javelin.groovy ... # (8 ships — includes shark)
│ ├── prizeweights.groovy
│ ├── cost.groovy
│ └── misc.groovy
├── svs-league/ # SVS league / duel variant
│ ├── svs-league.groovy # composite root: include directives + shipSections splat
│ ├── svs-dueling.groovy
│ ├── ship-warbird.groovy ... # per-ship overrides
│ └── misc.groovy, prizeweights.groovy, cost.groovy
├── svs-pb/ # PowerBall approximation
├── deva-04-2026/ # the deva preset (per-arena tuning)
└── trench-04-2026/ # the trench preset
All authoring is Groovy. The zone-scope, arena-scope, and preset fragment tiers are all .groovy files. Arenas list individual per-section fragment paths under includeFragment; composite .conf files, the IniLoader #include preprocessor, and the .ini/.cfg/.conf asset-loader registration are all gone (deleted in v1.0.10). SettingsSystem.loadFragmentIni now rejects non-.groovy paths.
Variant pick-up — an arena that wants PowerBall-style tuning lists per-section fragments:
arena {
map 'pb-map.lvl'
includeFragment '/conf/svs-pb/misc.groovy'
includeFragment '/conf/svs-pb/prizeweights.groovy'
includeFragment '/conf/svs-pb/cost.groovy'
}
A league arena that uses the composite root (which includes its section files internally):
arena {
map 'duel-map.lvl'
includeFragment '/conf/svs-league/svs-league.groovy'
}
zone/ is added as a resource source dir by buildSrc/.../infinity.app-with-assets.gradle:16, so JME's AssetManager and Groovy-classpath reads see everything under zone/ on the classpath. Asset keys are relative to that root: arenas/{name}/arena.groovy, conf/svs/cost.groovy.
Supporting Java in infinity-server/src/main/java/infinity/settings/:
| File | Purpose |
|---|---|
| GroovySettingsHost | Stateless pipeline that evaluates a Groovy settings file end to end: filesystem-first source resolution, sandboxed GroovyShell build, eval, error classification. Shared by every loader below. |
| GroovySettingsAdapter | Per-file DSL contract: each loader implements this to declare allowed imports, bind script variables, and extract its typed result from the accumulator. |
| GroovyZoneLoader | Loads zone.groovy → ZoneConfig. |
| GroovyArenaLoader | Loads arenas/<name>/arena.groovy → ArenaConfig. |
| GroovyShipLoader | Loads each arena's ships.groovy (referenced via arena { shipsScript ... }) → per-arena ConfigRegistry. |
| GroovyFragmentLoader | Evaluates .groovy preset fragments (section, shipSection, shipSections, include). Returns an Ini-shaped result for SettingsSystem. Dispatched from SettingsSystem.loadFragments; Groovy is the only fragment format supported (no .ini / .cfg / .conf ingest path remains). |
| BulletAdapter, BombAdapter, MineAdapter, BurstAdapter, RepelAdapter, PrizeAdapter | Typed-DSL adapters (B1). Each parses its named typed fragment (bullet.groovy, bomb.groovy, …) and writes the result directly into the matching ConfigRegistry slot via with*. Registered in ConfigRegistrySystem.DISPATCH keyed by basename. |
| ConfigRegistry | Immutable per-arena snapshot of typed *Config records. Direct slots: ShipConfig map (via GroovyShipLoader), plus per-section BulletConfig, BombConfig, GravBombConfig, MineConfig, BurstFireConfig, RepelConfig, ThorConfig, PrizeConfig (each populated by its typed adapter). Per-slot with* updaters return a new immutable copy. |
| ConfigRegistrySystem | Holds one ConfigRegistry per arena. Owns load orchestration via load(arenaId, arenaConfig): two-phase sequence — legacy fragment Ini load (still needed for unmigrated polish-bag sections) → typed dispatch (ship + six weapon/prize adapters via DISPATCH). Single entry point for both initial arena load and hot-reload. Atomic-swap installs ensure readers see either the old or new snapshot, never a torn state. |
Runtime entry point: infinity-server/src/main/java/infinity/systems/SettingsSystem.java.
Identity rule
An arena is identified by its folder name, not its map. arenas/trench/arena.groovy defines arena trench; its map directive decides which .lvl it loads. Two arenas can share a map file (different tuning, different settings bundle) but never the same folder name. Invariant: the <arenaName, map, conf-bundle> triple is always unique.
ArenaId.getArena() returns the arena name (e.g. trench, (default)). The map filename + ships script live on the typed ArenaConfig cached per-arena in ArenaSystem; spawn placement is owned by the arena-modules layer (SpawnPlacementModule); the per-arena Ini cached in SettingsSystem carries only the included-fragment data.
`arena.groovy` format
Typed Groovy DSL evaluated by GroovyArenaLoader. Every directive is optional; partial scripts are valid (omitted directives default to ArenaConfig.EMPTY values).
Conventional shape:
arena {
map '04-2026-trench/pub2025.lvl'
shipsScript '/conf/trench-04-2026/ships.groovy'
includeFragment '/conf/trench-04-2026/prizeweights.groovy' // multiple allowed; last-wins on key conflict
includeFragment '/conf/trench-04-2026/ship-warbird.groovy'
// …
includeFragment '/conf/trench-04-2026/misc.groovy'
wallFriction 0.1
spawnPlacement 'random-radius', center: [512, 512], radius: 0
spawners {
// Minimal: uses arena [PrizeWeight] defaults, global prize TTL
spawn x: 512, z: 512, radius: 100, maxCount: 5, intervalMs: 2000, ttlMs: 10000
// With per-spawner weight overrides (sparse — other types keep arena defaults)
spawn x: 900, z: 100, radius: 100, maxCount: 5, intervalMs: 2000, ttlMs: 10000,
weights: [Bomb: 100, Gun: 100, Rotation: 50]
}
}
spawners parameters:
| Parameter | Type | Effect |
|---|---|---|
| x, z | int (arena-local) | Spawner center; (0,0) = NW, (1024,1024) = SE |
| radius | double (world units) | Base spawn radius. Effective = radius + radiusPerPlayer × playersInArena |
| maxCount | int | Base prize cap. Effective = maxCount + countPerPlayer × playersInArena |
| intervalMs | double | Milliseconds between spawn attempts |
| ttlMs | long | Prize Decay duration; 0 falls back to PrizeConfig.defaultDecayMs |
| onRing | boolean (default false) | true = spawn on ring edge; false = uniform within disc |
| weights | Map (optional) | Per-type weight overrides merged atop arena [PrizeWeight] defaults; sparse |
| countPerPlayer | int (default 0) | Slice 8d: additive per-player count scaling. 0 = no scaling. Subspace [Prize] PrizeFactor analogue |
| radiusPerPlayer | double (default 0.0) | Slice 8d: additive per-player radius scaling, world units. 0 = no scaling. Subspace [Prize] UpgradeVirtual analogue |
| regenBatch | int (default 1) | Slice 8d: prizes spawned per intervalMs tick when below cap. Subspace [Prize] PrizeHideCount analogue |
| hidden | boolean (default false) | Slice 8d: spawned prizes carry an infinity.es.Hidden marker; client doesn't render them but server still owns collision / pickup. Reusable forward-compat marker for future cloak/decoy mechanics |
Each spawn entry materializes into a real spawner entity at arena-load. PrizeWeightsOverride is set on the entity only when weights is non-empty. Player-count for scaling is per-arena (filtered on ArenaId); spawners without an ArenaId (legacy BasicEnvironment, test modules) collapse to no-scaling.
Required for a playable arena: map. Without shipsScript the arena gets GroovyShipLoader.FALLBACK; without includeFragment no rule sections are loaded; without a spawnPlacement '…' declaration the player session falls back to world origin and ArenaSpatialIndex.getArenaSpawn logs a warn (per F2.6 / ADR-0008). spawners is optional; omitting it leaves prize spawning to any globally-configured spawners.
Where each directive lands
| Directive | Type | Stored on | Read by |
|---|---|---|---|
| map '...' | String | ArenaConfig.mapFile() | ArenaSystem (load / unload / swap / findArenaByMap) |
| shipsScript '...' | String | ArenaConfig.shipsScript() | GroovyShipLoader.apply() at arena-load |
| spawnPlacement 'id', kwargs… | Module declaration | ArenaConfig.modules().spawnPlacement() → ArenaModuleDeclarations | ArenaModuleSystem → RandomRadiusSpawnPlacement.resolveSpawn via ArenaSpatialIndex.getArenaSpawn (per-arena module, F2.6 / ADR-0008) |
| wallFriction N | double [0,1] | ArenaConfig.wallFriction() | ContactSystem (body-vs-static contacts: damps tangential velocity; friction=0 prevents torque from off-center contacts) |
| includeFragment '...' | String (repeatable) | ArenaConfig.fragmentIncludes() → forwarded to SettingsSystem.loadFragments | Anything that calls SettingsSystem.getInt/getString(arenaName, section, key, default) |
| teamSetup 'id', roster 'id', scoring 'id', …, roundStructure 'id', …, matchStructure 'id', winCondition 'id', …, mechanic 'id', … | Module declarations | ArenaConfig.modules() → ArenaModuleDeclarations | ArenaModuleSystem instantiates per ModuleCatalog; see