diff --git a/GAME_PLAN.md b/GAME_PLAN.md index d314128..0266c4f 100644 --- a/GAME_PLAN.md +++ b/GAME_PLAN.md @@ -1708,6 +1708,33 @@ construction views and Godot captures live in `korrath-review/README.md` in the art archive. Fine details and hidden surfaces interpret the concepts for game geometry. All values remain provisional until playtested. +#### Galaxy gates: the Sylith Gate + +The third gate continues the hidden alien relay thread in M4. The **Sylith** are +a phase-shifting choir that speaks through alien relays; the occupiers route +Sylith gate cores through the Frontier relay network. The gate leads into the +*Sylith Hollow*, where the Ascendant, a relay-ark, gathers the choir. + +- **Parts:** 28. *Relay Intercept* (Commander Vance) guarantees a part for each + contributed M4 kill; 12 parts complete it for +6 parts, 50,000 CR and 4 RP. + Random drops come only from M4 (Ravager 10%, Overlord 14%). +- **Waves:** nine, with Wisps (fast) and Veilcasters (heavy). The final wave adds + the nearly stationary Ascendant, which launches two Wisps every 25 s. + +| Type | Hull / shield | Damage / interval | Credit pool | +| --- | --- | --- | --- | +| Wisp | 14,000 / 9,000 | 7,000 / 0.7 s | 6,000 | +| Veilcaster | 70,000 / 40,000 | 24,000 / 0.85 s | 30,000 | +| Ascendant | 1,000,000 / 500,000 | 50,000 / 0.5 s, 270 m | 600,000 | + +- **Rewards:** 500,000 CR, 15 research points and 40,000 x4 shots per + participant, with a 35% chance of an LF-4 laser. +- Shared gate rules apply, including the escort reserve in boss waves (pool: + 14 Wisps, 5 Veilcasters). The arena is map 6 with a cold teal nebula backdrop, + and its portal sits beyond Outpost 01 toward the defense ring wreck. Network + schema 23 adds the Sylith arena and aliens. Sylith aliens use colored + placeholder models; art is deferred. All values are provisional. + #### First campaign implementation scope Begin with the pilot prologue and the clearance operation that establishes diff --git a/README.md b/README.md index aca60c1..de836c1 100644 --- a/README.md +++ b/README.md @@ -262,7 +262,7 @@ equip it, **Quests** to accept hunting contracts, or **Cargo trade** to sell sav resources. **Skylab** manages persistent collectors, refining, upgrades, robots and shipments to ship cargo; see [Skylab rules and balance](docs/skylab.md). **Settings** and **Connection** are also available. **Galaxy Gates** shows your -parts and operations for the Vashar and Korrath gates; see +parts and operations for the Vashar, Korrath and Sylith gates; see [Galaxy gates](GAME_PLAN.md#galaxy-gates-the-vashar-gate). Choose the amber **START** button on Overview to spawn at Outpost 01 with your selected ship and fitting. Esc or Back returns to the overview; these actions do not launch. Docked ships are hidden from other diff --git a/scripts/alien.gd b/scripts/alien.gd index 3acb452..da3c32c 100644 --- a/scripts/alien.gd +++ b/scripts/alien.gd @@ -40,6 +40,9 @@ const VISUAL_SCALE := { "Husk": 1.3, "Bulwark": 2.4, "Siegebreaker": 9.0, + "Wisp": 1.1, + "Veilcaster": 2.6, + "Ascendant": 11.0, } const TYPES := { "Scout": {"hull": 1000.0, "shield": 500.0, "damage": 1500.0, "interval": 0.85, "range": 205.0, "speed": 29.0, "detection": 230.0, "leash": 210.0, "reward": 300, "respawn": 10.0, "scale": Vector3(0.7, 0.7, 0.85), "color": Color("ffc875")}, @@ -59,6 +62,10 @@ const TYPES := { "Husk": {"hull": 8000.0, "shield": 4000.0, "damage": 4000.0, "interval": 0.8, "range": 230.0, "speed": 34.0, "detection": 2400.0, "leash": 5000.0, "reward": 3000, "respawn": 0.0, "scale": Vector3(0.9, 0.7, 1.2), "color": Color("ff8a3d")}, "Bulwark": {"hull": 36000.0, "shield": 18000.0, "damage": 14000.0, "interval": 0.85, "range": 260.0, "speed": 15.0, "detection": 2400.0, "leash": 5000.0, "reward": 15000, "respawn": 0.0, "scale": Vector3(1.4, 1.2, 1.3), "color": Color("d0562a")}, "Siegebreaker": {"hull": 500000.0, "shield": 250000.0, "damage": 30000.0, "interval": 0.5, "range": 270.0, "speed": 3.0, "detection": 2400.0, "leash": 5000.0, "reward": 300000, "respawn": 0.0, "scale": Vector3(1.6, 0.8, 1.6), "color": Color("ffb35c"), "radius": 22.0}, + # Sylith Gate arena only, with placeholder models until authored art exists. + "Wisp": {"hull": 14000.0, "shield": 9000.0, "damage": 7000.0, "interval": 0.7, "range": 240.0, "speed": 40.0, "detection": 2400.0, "leash": 5000.0, "reward": 6000, "respawn": 0.0, "scale": Vector3(0.8, 0.5, 1.3), "color": Color("4fe3d2")}, + "Veilcaster": {"hull": 70000.0, "shield": 40000.0, "damage": 24000.0, "interval": 0.85, "range": 270.0, "speed": 14.0, "detection": 2400.0, "leash": 5000.0, "reward": 30000, "respawn": 0.0, "scale": Vector3(1.1, 1.6, 1.1), "color": Color("2fa8c9")}, + "Ascendant": {"hull": 1000000.0, "shield": 500000.0, "damage": 50000.0, "interval": 0.5, "range": 270.0, "speed": 2.0, "detection": 2400.0, "leash": 5000.0, "reward": 600000, "respawn": 0.0, "scale": Vector3(1.0, 1.8, 1.0), "color": Color("a6fff2"), "radius": 26.0}, } var alien_id: int = 0 diff --git a/scripts/cargo_resources.gd b/scripts/cargo_resources.gd index e3136a4..9394f8a 100644 --- a/scripts/cargo_resources.gd +++ b/scripts/cargo_resources.gd @@ -27,6 +27,9 @@ const LOOT := { "Husk": {"duranium": Vector2i(6, 10), "xenomit": Vector2i(2, 4), "promerium": Vector2i(2, 4)}, "Bulwark": {"xenomit": Vector2i(6, 10), "promerium": Vector2i(10, 14), "seprom": Vector2i(4, 6)}, "Siegebreaker": {"xenomit": Vector2i(30, 40), "promerium": Vector2i(40, 50), "seprom": Vector2i(25, 35)}, + "Wisp": {"xenomit": Vector2i(4, 6), "promerium": Vector2i(4, 8), "seprom": Vector2i(1, 3)}, + "Veilcaster": {"xenomit": Vector2i(10, 14), "promerium": Vector2i(14, 20), "seprom": Vector2i(8, 12)}, + "Ascendant": {"xenomit": Vector2i(40, 60), "promerium": Vector2i(60, 80), "seprom": Vector2i(40, 50)}, "Heavy": {"prometium": Vector2i(18, 24), "endurium": Vector2i(12, 18), "terbium": Vector2i(8, 12), "prometid": Vector2i(6, 10), "duranium": Vector2i(4, 6), "xenomit": Vector2i(1, 3), "promerium": Vector2i(2, 4), "seprom": Vector2i(1, 2)}, } diff --git a/scripts/contract_preview.gd b/scripts/contract_preview.gd index b586aa6..ffa01f3 100644 --- a/scripts/contract_preview.gd +++ b/scripts/contract_preview.gd @@ -2,6 +2,7 @@ class_name ContractPreview extends SubViewportContainer ## Isolated preview sharing the textured encounter model. +const PLACEHOLDER_DIAMETER := 10.0 var viewport: SubViewport var model: Node3D var camera: Camera3D @@ -43,8 +44,10 @@ func show_kind(kind: String) -> void: if kind == selected_kind: return selected_kind = kind - var diameter := float(Alien.VISUAL_DIAMETERS[kind]) * float(Alien.VISUAL_SCALE[kind]) - var framing := float({"Scout": 5.5, "Sentinel": 7.0, "Heavy": 10.0}.get(kind, float(Alien.VISUAL_DIAMETERS[kind]) * 0.75)) + # Placeholder-model aliens have no measured diameter; frame them like a mid-size hull. + var measured := float(Alien.VISUAL_DIAMETERS.get(kind, PLACEHOLDER_DIAMETER)) + var diameter := measured * float(Alien.VISUAL_SCALE[kind]) + var framing := float({"Scout": 5.5, "Sentinel": 7.0, "Heavy": 10.0}.get(kind, measured * 0.75)) camera.size = framing * float(Alien.VISUAL_SCALE[kind]) camera.position = Vector3(8, 7, -10).normalized() * maxf(15.0, diameter * 1.5) camera.look_at(Vector3.ZERO) diff --git a/scripts/equipment.gd b/scripts/equipment.gd index d3101b6..756ba83 100644 --- a/scripts/equipment.gd +++ b/scripts/equipment.gd @@ -11,7 +11,7 @@ const MODELS := { "mp-1": {"name": "MP-1", "kind": "laser", "price": 40000, "damage": 70.0, "shield": 0.0, "speed": 0.0}, "lf-2": {"name": "LF-2", "kind": "laser", "price": 5000 * URIDIUM_TO_CREDITS, "damage": 140.0, "shield": 0.0, "speed": 0.0}, "lf-3": {"name": "LF-3", "kind": "laser", "price": 10000 * URIDIUM_TO_CREDITS, "damage": 175.0, "npc_bonus": 0.15, "shield": 0.0, "speed": 0.0}, - "lf-4": {"name": "LF-4", "kind": "laser", "price": 0, "unavailable": "Unavailable in the shop. Vashar Gate victories can award one.", "damage": 200.0, "shield": 0.0, "speed": 0.0}, + "lf-4": {"name": "LF-4", "kind": "laser", "price": 0, "unavailable": "Unavailable in the shop. Vashar and Sylith Gate victories can award one.", "damage": 200.0, "shield": 0.0, "speed": 0.0}, "shield": {"name": "SG3N-A01", "kind": "generator", "price": 8000, "damage": 0.0, "shield": 1000.0, "absorption": 0.4, "speed": 0.0}, "sg3n-a02": {"name": "SG3N-A02", "kind": "generator", "price": 16000, "damage": 0.0, "shield": 2000.0, "absorption": 0.5, "speed": 0.0}, "fs-01": {"name": "FS-01", "kind": "generator", "price": 256000, "damage": 0.0, "shield": 3200.0, "absorption": 0.7, "regen_bonus": 0.0625, "speed": 0.0}, diff --git a/scripts/flight_session.gd b/scripts/flight_session.gd index 6c3b712..efa2e1c 100644 --- a/scripts/flight_session.gd +++ b/scripts/flight_session.gd @@ -7,7 +7,7 @@ const MAX_PLAYERS: int = 10 const COMMAND_TIMEOUT: float = 0.5 const CONNECT_TIMEOUT: float = 10.0 # Bump when packet contents or shared physics change without an RPC signature change. -const NETWORK_SCHEMA: int = 22 +const NETWORK_SCHEMA: int = 23 const BUILD_MISMATCH := "Client and server builds are incompatible. Use the matching client and server from the same release or PR preview." var sector: Sector diff --git a/scripts/galaxy_gates.gd b/scripts/galaxy_gates.gd index dfbd693..29d0048 100644 --- a/scripts/galaxy_gates.gd +++ b/scripts/galaxy_gates.gd @@ -20,7 +20,7 @@ const ESCORTS := 2 const SIGNAL_STATES := ["available", "active", "done"] # Display and lookup order. Each gate has its own arena map, entry portal near # Outpost 01, parts, operation, alien pool, waves and rewards. -const ORDER := ["vashar", "korrath"] +const ORDER := ["vashar", "korrath", "sylith"] const GATES := { "vashar": { "name": "Vashar Gate", "faction": "Vashar", "arena": "Vashar Rift", "map": 4, "glow": Color("c86bff"), @@ -77,6 +77,33 @@ const GATES := { {"Siegebreaker": 1, "Husk": 4, "Bulwark": 2}, ], }, + "sylith": { + "name": "Sylith Gate", "faction": "Sylith", "arena": "Sylith Hollow", "map": 6, "glow": Color("4fe3d2"), + "portal": Vector3(250, -50, 400), "parts_required": 28, "lives": 3, + "summary": "The Sylith are a phase-shifting choir that speaks through alien relays. The occupiers are routing Sylith gate cores through the Frontier relay network. Assemble the gate, enter the hollow where their choir gathers and silence the Ascendant before the Sylith can cross over.", + "part_chance": {"Ravager": 0.1, "Overlord": 0.14}, + "signal": { + "title": "Relay Intercept", "contact": "vance", "map": 3, "required": 12, "parts": 6, "credits": 50000, "research": 4, + "objective": "Recover Sylith gate cores from aliens in M4 / Frontier", + "briefing": "Vance here. Sato finally cracked the Frontier relay traffic. The aliens are not just talking to each other; they are routing gate cores for a third ally, the Sylith. Command wants those cores before they reach a gate. Hunt the relay escorts in M4 and bring the cores home.", + "done": "Good hunting, pilot. The escorts were carrying a full manifest; we pulled the remaining cores from their drop point and added them to your stock. Build that gate and take the fight to the Sylith.", + }, + "reward": {"credits": 500000, "research": 15, "x4": 40000, "item": "lf-4", "item_chance": 0.35}, + "boss": "Ascendant", "boss_title": "SYLITH ASCENDANT", "escort": "Wisp", + "victory": "The Sylith Ascendant is silenced. Their choir falls quiet for now.", + "pool": {"Wisp": 14, "Veilcaster": 5, "Ascendant": 1}, + "waves": [ + {"Wisp": 5}, + {"Wisp": 8}, + {"Wisp": 5, "Veilcaster": 1}, + {"Wisp": 8, "Veilcaster": 2}, + {"Veilcaster": 3}, + {"Wisp": 8, "Veilcaster": 2}, + {"Wisp": 8, "Veilcaster": 3}, + {"Wisp": 8, "Veilcaster": 4}, + {"Ascendant": 1, "Wisp": 6, "Veilcaster": 2}, + ], + }, } diff --git a/scripts/sector_backdrop.gd b/scripts/sector_backdrop.gd index 5895f2d..aae6bed 100644 --- a/scripts/sector_backdrop.gd +++ b/scripts/sector_backdrop.gd @@ -11,6 +11,8 @@ const THEMES := [ {"planet": Vector3(-1700, 900, -3600), "radius": 1500.0, "ocean": Color("1a0f24"), "land": Color("3b2346"), "atmosphere": Color("b04cff"), "water": 0.0, "clouds": 0.0, "mining": 1.0, "cool": Color("3a1752"), "warm": Color("b0367f"), "light": Color("c86bff")}, # Korrath Bastion: a scorched forge world behind the siege fleet. {"planet": Vector3(1900, 1000, -3500), "radius": 1600.0, "ocean": Color("2a1208"), "land": Color("5a2a14"), "atmosphere": Color("ff7a2e"), "water": 0.0, "clouds": 0.02, "mining": 1.0, "cool": Color("3d1a10"), "warm": Color("c2541f"), "light": Color("ff9a52")}, + # Sylith Hollow: a cold teal nebula around a pale mineral world. + {"planet": Vector3(-1800, 1100, -3600), "radius": 1450.0, "ocean": Color("0d2a33"), "land": Color("3e6b70"), "atmosphere": Color("5ff0e0"), "water": 0.3, "clouds": 0.3, "mining": 0.6, "cool": Color("0f3540"), "warm": Color("2a8f8a"), "light": Color("8ff5e8")}, ] @@ -127,6 +129,12 @@ static func build(parent: Node3D, map: int) -> Node3D: carrier(root, wreck, Vector3(0.15, -1.3, 0.22)) human_relay(root, Vector3(-1450, -280, -1500), 1.5) human_ring(root, Vector3(-1800, 500, 1800), 330.0, Vector3(0.3, -0.7, 0.4), false) + elif map == 6: + # Choir relays ring the hollow; no human structures. + alien_relay(root, Vector3(1500, 300, -2300), 1.8) + alien_relay(root, Vector3(-1600, -200, 2000), 1.2) + alien_relay(root, Vector3(1900, -260, 1500), 0.8) + planet_collectors(root, planet_position, radius, 3) elif map == 5: # Siege staging: heavy alien relays and extraction collars around the forge world. planet_collectors(root, planet_position, radius, 5) diff --git a/scripts/sector_maps.gd b/scripts/sector_maps.gd index a2ef2e6..8744482 100644 --- a/scripts/sector_maps.gd +++ b/scripts/sector_maps.gd @@ -19,6 +19,9 @@ const MAPS := { 5: {"name": "KG / Korrath Bastion", "color": Color("ff8a3d"), "instance": true, "aliens": ["Husk", "Husk", "Husk", "Husk", "Husk", "Husk", "Husk", "Husk", "Husk", "Husk", "Bulwark", "Bulwark", "Bulwark", "Bulwark", "Bulwark", "Siegebreaker"], "description": "Korrath Gate / siege bastion / waves end with the Siegebreaker"}, + 6: {"name": "SG / Sylith Hollow", "color": Color("4fe3d2"), "instance": true, + "aliens": ["Wisp", "Wisp", "Wisp", "Wisp", "Wisp", "Wisp", "Wisp", "Wisp", "Wisp", "Wisp", "Wisp", "Wisp", "Wisp", "Wisp", "Veilcaster", "Veilcaster", "Veilcaster", "Veilcaster", "Veilcaster", "Ascendant"], + "description": "Sylith Gate / choir hollow / waves end with the Ascendant"}, } const GATES := { 0: {1: Vector3(0, 120, -900)}, @@ -29,9 +32,10 @@ const GATES := { # Galaxy gate endpoints: each gate's portal near Outpost 01 (see GalaxyGates # "portal") and every arena's return gate. const SPECIAL_GATES := { - 0: {4: Vector3(320, 40, -300), 5: Vector3(-340, -30, -330)}, + 0: {4: Vector3(320, 40, -300), 5: Vector3(-340, -30, -330), 6: Vector3(250, -50, 400)}, 4: {0: Vector3(0, 0, 700)}, 5: {0: Vector3(0, 0, 700)}, + 6: {0: Vector3(0, 0, 700)}, } # Replicated from the server's gate run: the arena map whose Outpost 01 portal is # open, or -1. Only one gate run is open at a time. diff --git a/tests/alien_assets_test.gd b/tests/alien_assets_test.gd index 2d01b43..348ff2c 100644 --- a/tests/alien_assets_test.gd +++ b/tests/alien_assets_test.gd @@ -78,12 +78,19 @@ func run() -> void: check(alien.alive and alien.visible and alien.collision_layer == 2, kind + " respawn restores visibility and collision") alien.free() - check(sizes.size() == Alien.TYPES.size() and sizes[0] < sizes[1] and sizes[1] < sizes[2], + # Gate aliens without authored art use colored placeholder models. + var placeholders: Array = Alien.TYPES.keys().filter(func(kind: String): return not Alien.VISUAL_DIAMETERS.has(kind)) + check(sizes.size() == Alien.TYPES.size() - placeholders.size() and sizes[0] < sizes[1] and sizes[1] < sizes[2], "Scout, Sentinel and Heavy retain increasing visual size") - check(Alien.VISUAL_DIAMETERS.size() == Alien.TYPES.size(), + check(Alien.VISUAL_DIAMETERS.size() == Alien.TYPES.size() - placeholders.size(), "Every authored encounter type has an imported model and a mesh-free server diameter") - check_gate_models("vashar") - check_gate_models("korrath") + # Gates with authored art get full model checks; the rest use placeholders. + for gate_id: String in GalaxyGates.ORDER: + var faction: Array = GalaxyGates.info(gate_id)["pool"].keys() + if faction.all(func(kind: String): return kind in placeholders): + check_placeholders(faction) + else: + check_gate_models(gate_id) # Gate rosters are their own faction progressions, checked separately. var roster: Array = Alien.TYPES.keys().filter(func(kind: String): return not kind in GalaxyGates.arena_kinds()) roster.sort_custom(func(a: String, b: String): return Alien.TYPES[a]["hull"] < Alien.TYPES[b]["hull"]) @@ -183,3 +190,17 @@ func check_gate_models(gate_id: String) -> void: previous = diameter print("ALIEN_SIZE %s diameter=%.2f m" % [kind, diameter]) alien.free() + + +func check_placeholders(kinds: Array) -> void: + var previous := 0.0 + for kind: String in kinds: + var alien := Alien.new() + alien.kind = kind + root.add_child(alien) + var diameter := SectorVisuals.destruction_size(alien) + check(not alien.model.find_children("*", "MeshInstance3D", true, false).is_empty(), kind + " has a placeholder model") + check(diameter > previous, kind + " placeholder is larger than the previous tier of its faction") + check(is_equal_approx((alien.get_child(0) as CollisionShape3D).shape.radius, float(Alien.TYPES[kind].get("radius", 2.2))), kind + " uses its configured collider") + previous = diameter + alien.free() diff --git a/tests/galaxy_gates_test.gd b/tests/galaxy_gates_test.gd index 8fea48e..27e17e9 100644 --- a/tests/galaxy_gates_test.gd +++ b/tests/galaxy_gates_test.gd @@ -1,10 +1,12 @@ extends "res://tests/hunting_contracts_test.gd" -## Gate part rules, the Signal Anomaly operation, assembly, preview gates and a -## full Vashar Gate run with lives, waves, escorts, victory and collapse. +## Gate part rules for every gate, the Vashar operation, assembly, preview gates, +## a full Vashar run with lives, waves, escorts, victory and collapse, and full +## runs of every further gate. const VASHAR := "vashar" const KORRATH := "korrath" +const SYLITH := "sylith" const VMAP := 4 const KMAP := 5 @@ -265,6 +267,32 @@ func run() -> void: # M3 has no gate to Outpost 01; return through M2 like a pilot would. await move_to(server, pilot, 1) await move_to(server, partner, 1) + # An M4 box: the guaranteed Sylith part reaches the pilot running Relay + # Intercept, while the closer pilot takes the random Vashar and Korrath parts. + await move_to(server, pilot, 3) + await move_to(server, partner, 3) + next = store.pilots.duplicate(true) + partner_gates = next[partner_key]["equipment"].get("gates", {}).duplicate(true) + next[partner_key]["equipment"]["gates"] = partner_gates.merged({SYLITH: {"parts": 0, "signal": "active", "progress": 0}}, true) + check(store.persist(next), "Start the partner's Sylith operation") + spot = server.session.ships[id].position + server.session.ships[partner_id].position = spot + Vector3(4, 0, 0) + vashar_before = saved(server, pilot)["parts"] + var korrath_before: int = saved(server, pilot, KORRATH)["parts"] + mixed = place_box(server, 3, spot, {VASHAR: 1, KORRATH: 1, SYLITH: 1}) + combat.collect_loot() + await settle(0.05) + check(not server.loot.drops.has(mixed) and saved(server, partner, SYLITH)["parts"] == 1 and saved(server, partner, SYLITH)["progress"] == 1 + and saved(server, pilot, SYLITH)["parts"] == 0 and saved(server, pilot)["parts"] == vashar_before + 1 and saved(server, pilot, KORRATH)["parts"] == korrath_before + 1, + "An M4 box sends its Sylith part to the Relay Intercept pilot and the rest to the nearest pilot") + next = store.pilots.duplicate(true) + if partner_gates.is_empty(): + next[partner_key]["equipment"].erase("gates") + else: + next[partner_key]["equipment"]["gates"] = partner_gates + check(store.persist(next), "Restore the partner's operations") + await move_to(server, pilot, 1) + await move_to(server, partner, 1) for attempt in range(GalaxyGates.info(VASHAR)["signal"]["required"]): if saved(server, pilot)["signal"] != "active": break @@ -361,8 +389,11 @@ func run() -> void: var lasers := func(pilot: String) -> Array: return store.pilots[pilot]["equipment"]["items"].values().filter(func(item: Dictionary): return item["model"] == "lf-4") check(lasers.call(pilot_id).size() == 1 and lasers.call(pilot_id)[0]["ship"] == "" and lasers.call(partner_pilot).is_empty(), "A won LF-4 roll places one LF-4 in storage") check(Equipment.fitting_blocker(store.pilots[pilot_id]["equipment"], store.pilots[pilot_id]["equipment"]["items"].find_key(lasers.call(pilot_id)[0]), "starter", "laser2").is_empty(), "The rewarded LF-4 can be fitted") - await settle(0.1) - check(pilot.session.combat.inventory["items"].values().any(func(item: Dictionary): return item["model"] == "lf-4"), "The pilot's client receives the LF-4") + var awarded_id: String = store.pilots[pilot_id]["equipment"]["items"].find_key(lasers.call(pilot_id)[0]) + var deadline := Time.get_ticks_msec() + 5000 + while not pilot.session.combat.inventory["items"].has(awarded_id) and Time.get_ticks_msec() < deadline: + await process_frame + check(pilot.session.combat.inventory["items"].get(awarded_id, {}).get("model") == "lf-4", "The pilot's client receives the LF-4") var closed: String = await enter(server, pilot) check(not closed.is_empty(), "A won gate cannot be re-entered") gate.tick(GalaxyGates.VICTORY_TIME + 0.1) @@ -403,61 +434,68 @@ func run() -> void: gate.tick(GalaxyGates.ABANDON_TIME + 0.1) check(not gate.active and SectorMaps.open_rift != VMAP, "A gate nobody holds collapses") check(not server.loot.drops.has(leftover) and server.loot.drops.values().all(func(box: Dictionary): return int(box.get("map", 0)) != VMAP), "A closing run clears the arena's loot") - await run_korrath(server, pilot) + await run_gate(server, pilot, KORRATH) + await run_gate(server, pilot, SYLITH) finish() -# The second gate: its own operation map, portal, arena, boss and rewards. -func run_korrath(server: Sector, pilot: Sector) -> void: +# Further gates: their own operation map, portal, arena, boss and rewards. +func run_gate(server: Sector, pilot: Sector, gate_id: String) -> void: var store := server.session.store var combat := server.session.combat var gate := combat.gate var id := pilot.multiplayer.get_unique_id() var pilot_id: String = server.session.pilot_ids[id] - var korrath := GalaxyGates.info(KORRATH) - await request(server, pilot, "gate_signal", KORRATH) - check(saved(server, pilot, KORRATH)["signal"] == "active" and saved(server, pilot)["signal"] == "available", "The Korrath operation is tracked separately from the Vashar one") - var drop: int = await kill_on_map(server, int(korrath["signal"]["map"]), [pilot]) - check(drop >= 0 and int(server.loot.drops[drop].get("parts", {}).get(KORRATH, 0)) >= 1, "An M3 kill during the Korrath operation carries a Korrath part") + var definition := GalaxyGates.info(gate_id) + var arena: int = definition["map"] + var label: String = definition["name"] + var operation_map: int = definition["signal"]["map"] + await request(server, pilot, "gate_signal", gate_id) + check(saved(server, pilot, gate_id)["signal"] == "active" and saved(server, pilot)["signal"] == "available", "%s operation is tracked separately from the Vashar one" % label) + var drop: int = await kill_on_map(server, operation_map, [pilot]) + check(drop >= 0 and int(server.loot.drops[drop].get("parts", {}).get(gate_id, 0)) >= 1, "%s kills during the %s operation carry its parts" % [SectorMaps.code(operation_map), label]) await pick_up(server, pilot, drop) - check(saved(server, pilot, KORRATH)["parts"] >= 1 and saved(server, pilot, KORRATH)["progress"] >= 1, "Korrath parts are saved under their own gate") - await request(server, pilot, "gate_preview", KORRATH) - check(gate.active and gate.gate == KORRATH and SectorMaps.open_rift == KMAP, "A preview pilot opens the Korrath Gate") - check(SectorMaps.links(0).has(KMAP) and not SectorMaps.links(0).has(VMAP), "Only the open gate's portal is usable at Outpost 01") + check(saved(server, pilot, gate_id)["parts"] >= 1 and saved(server, pilot, gate_id)["progress"] >= 1, "%s parts are saved under their own gate" % label) + await request(server, pilot, "gate_preview", gate_id) + check(gate.active and gate.gate == gate_id and SectorMaps.open_rift == arena, "A preview pilot opens the %s" % label) + var others := GalaxyGates.ORDER.filter(func(other: String): return other != gate_id and SectorMaps.links(0).has(int(GalaxyGates.info(other)["map"]))) + check(SectorMaps.links(0).has(arena) and others.is_empty(), "Only the open gate's portal is usable at Outpost 01") await sync(server) - check(pilot.hud.navigation.has_contact("gate%d" % KMAP) and pilot.session.combat.gate_summary["gate"] == KORRATH, "Clients see the open Korrath Gate") + check(pilot.hud.navigation.has_contact("gate%d" % arena) and pilot.session.combat.gate_summary["gate"] == gate_id, "Clients see the open %s" % label) var blocked := server.session.jump(id, combat.records[id]["life"], VMAP) check(not blocked.is_empty(), "A closed gate cannot be entered while another is open") - var entered: String = await enter(server, pilot, KMAP) - check(entered.is_empty() and server.session.ships[id].map_id == KMAP, "Pilots fly into the Korrath Bastion") + var entered: String = await enter(server, pilot, arena) + check(entered.is_empty() and server.session.ships[id].map_id == arena, "Pilots fly into the %s" % definition["arena"]) await settle(0.1) - check(pilot.hud.gate_status().begins_with("KORRATH GATE / WAVE 1 IN"), "The HUD names the Korrath Gate and its countdown") + check(pilot.hud.gate_status().begins_with("%s / WAVE 1 IN" % label.to_upper()), "The HUD names the %s and its countdown" % label) var credits: int = store.pilots[pilot_id]["credits"] - var shields := func() -> int: return store.pilots[pilot_id]["equipment"]["items"].values().filter(func(item: Dictionary): return item["model"] == "sg3n-b00").size() - var shields_before: int = shields.call() + var item: String = definition["reward"]["item"] + var items := func() -> int: return store.pilots[pilot_id]["equipment"]["items"].values().filter(func(entry: Dictionary): return entry["model"] == item).size() + var items_before: int = items.call() gate.tick(GalaxyGates.FIRST_WAVE_DELAY + 0.1) - check(gate.wave_aliens.size() == GalaxyGates.wave_counts(KORRATH, 0, 1)["Husk"] and gate.wave_aliens.all(func(alien: Alien): return alien.kind == "Husk" and alien.map_id == KMAP), - "The first Korrath wave sends Husks into the bastion") + var first_kind: String = definition["waves"][0].keys()[0] + check(gate.wave_aliens.size() == GalaxyGates.wave_counts(gate_id, 0, 1)[first_kind] and gate.wave_aliens.all(func(alien: Alien): return alien.kind == first_kind and alien.map_id == arena), + "The first %s wave sends %ss into the arena" % [definition["faction"], first_kind]) var seed := 0 while true: var probe := RandomNumberGenerator.new() probe.seed = seed - if probe.randf() < korrath["reward"]["item_chance"]: + if probe.randf() < definition["reward"]["item_chance"]: break seed += 1 - for wave in range(korrath["waves"].size()): + for wave in range(definition["waves"].size()): if wave > 0: gate.tick(GalaxyGates.WAVE_DELAY + 0.1) - if wave == korrath["waves"].size() - 1: - check(gate.wave_aliens.any(func(alien: Alien): return alien.kind == "Siegebreaker" and alien.alive), "The final wave brings the Siegebreaker") + if wave == definition["waves"].size() - 1: + check(gate.wave_aliens.any(func(alien: Alien): return alien.kind == definition["boss"] and alien.alive), "The final wave brings the %s" % definition["boss"]) var before := gate.wave_aliens.filter(func(alien: Alien): return alien.alive).size() gate.tick(GalaxyGates.ESCORT_INTERVAL + 0.1) - check(gate.wave_aliens.filter(func(alien: Alien): return alien.alive).size() > before, "The Siegebreaker launches Husk escorts") + check(gate.wave_aliens.filter(func(alien: Alien): return alien.alive).size() > before, "The %s launches %s escorts" % [definition["boss"], definition["escort"]]) gate.rng.seed = seed clear_wave(server, pilot) gate.tick(0.1) - check(gate.phase == "victory" and store.pilots[pilot_id]["credits"] >= credits + int(korrath["reward"]["credits"]), "Destroying the Siegebreaker pays the Korrath reward") - check(shields.call() == shields_before + 1, "A won roll places an SG3N-B00 shield in storage") + check(gate.phase == "victory" and store.pilots[pilot_id]["credits"] >= credits + int(definition["reward"]["credits"]), "Destroying the %s pays the %s reward" % [definition["boss"], label]) + check(items.call() == items_before + 1, "A won roll places an %s in storage" % GalaxyGates.item_name(gate_id)) gate.tick(GalaxyGates.VICTORY_TIME + 0.1) await settle(0.1) - check(not gate.active and server.session.ships[id].map_id == 0, "The Korrath Bastion closes and returns pilots home") + check(not gate.active and server.session.ships[id].map_id == 0, "The %s closes and returns pilots home" % definition["arena"]) diff --git a/tests/pilots_test.py b/tests/pilots_test.py index 59bbce2..2ed94f5 100644 --- a/tests/pilots_test.py +++ b/tests/pilots_test.py @@ -389,10 +389,13 @@ def test_extra_fitting_and_cargo(self): del equipment["story"] # Galaxy gate parts are optional; signal progress exists only while active. equipment["gates"] = {"vashar": {"parts": 20, "signal": "active", "progress": 7}, - "korrath": {"parts": 3, "signal": "active", "progress": 9}} + "korrath": {"parts": 3, "signal": "active", "progress": 9}, + "sylith": {"parts": 5, "signal": "active", "progress": 11}} self.assertTrue(pilots.valid_equipment(equipment)) equipment["gates"] = {"vashar": {"parts": 20, "signal": "done", "progress": 1}} self.assertFalse(pilots.valid_equipment(equipment)) + equipment["gates"] = {"sylith": {"parts": 5, "signal": "active", "progress": 12}} + self.assertFalse(pilots.valid_equipment(equipment)) equipment["gates"] = {"unknown": {"parts": 1, "signal": "available", "progress": 0}} self.assertFalse(pilots.valid_equipment(equipment)) del equipment["gates"] diff --git a/tests/rpc_compatibility_test.gd b/tests/rpc_compatibility_test.gd index d4dc9f6..b1908b9 100644 --- a/tests/rpc_compatibility_test.gd +++ b/tests/rpc_compatibility_test.gd @@ -66,7 +66,7 @@ func run() -> void: # Schema 17 previews share this RPC table but pack world entries and profiles # without revisions, so only the schema separates their fingerprints. var preview := server.session.protocol_fingerprint(17) - check(preview != server.session.protocol_fingerprint() and FlightSession.NETWORK_SCHEMA == 22, "Profile revisions change the protocol fingerprint") + check(preview != server.session.protocol_fingerprint() and FlightSession.NETWORK_SCHEMA == 23, "Profile revisions change the protocol fingerprint") var preview_server := func(id: int): server.multiplayer.send_auth(id, JSON.stringify({"nonce": "00".repeat(32), "protocol": preview}).to_utf8_buffer()) server.multiplayer.peer_authenticating.connect(preview_server) client.session.join("127.0.0.1", test_port(24683)) diff --git a/tests/sector_visuals_test.gd b/tests/sector_visuals_test.gd index 22d0260..aa578b5 100644 --- a/tests/sector_visuals_test.gd +++ b/tests/sector_visuals_test.gd @@ -75,7 +75,7 @@ func check_campaign_backdrops() -> void: root.add_child(authority) authority.set_physics_process(false) var client_obstacles := static_obstacles(flight) - check(client_obstacles == static_obstacles(authority) and client_obstacles.size() == 197, "All four rendered maps and both gate arenas retain identical server obstacles") + check(client_obstacles == static_obstacles(authority) and client_obstacles.size() == 221, "All four rendered maps and three gate arenas retain identical server obstacles") check(render_nodes(authority) == 0, "Four-map server creates no campaign planets, machines or sky") check(flight.map_scenery.keys() == [0], "Startup builds only the current map's scenery") check(authority.map_scenery.is_empty(), "Dedicated startup has no visual map cache") diff --git a/tests/server_export_test.gd b/tests/server_export_test.gd index 8b0d852..995ca16 100644 --- a/tests/server_export_test.gd +++ b/tests/server_export_test.gd @@ -35,7 +35,7 @@ func run() -> void: var shape := collider.shape colliders.append([str(collider.global_transform), shape.get_class(), shape.radius if shape is SphereShape3D else str(shape.size)]) - check(colliders.size() == 197, "All 144 asteroids across four maps and two gate arenas, and 53 station colliders, survive export") + check(colliders.size() == 221, "All 168 asteroids across four maps and three gate arenas, and 53 station colliders, survive export") var arena_slots := 0 for gate_id: String in GalaxyGates.ORDER: arena_slots += GalaxyGates.pool_kinds(gate_id).size() diff --git a/tools/pilots.py b/tools/pilots.py index fc00be4..25009b0 100644 --- a/tools/pilots.py +++ b/tools/pilots.py @@ -132,7 +132,7 @@ def whole(value: object, low: int, high: int) -> bool: # Mirrors GalaxyGates in scripts/galaxy_gates.gd: per-gate progress with at most # 999 parts and operation progress below each gate's requirement. -GATE_OPERATION_REQUIRED = {"vashar": 8, "korrath": 10} +GATE_OPERATION_REQUIRED = {"vashar": 8, "korrath": 10, "sylith": 12} def gate_collection(data: object) -> object: diff --git a/tools/render_alien_preview.gd b/tools/render_alien_preview.gd index b535004..68f7455 100644 --- a/tools/render_alien_preview.gd +++ b/tools/render_alien_preview.gd @@ -1,7 +1,7 @@ extends SceneTree ## Capture contract/rear previews, or use -- --sector for 25 m / 90 m visibility. -## -- --outer limits the set to the M2–M4 aliens and -- --vashar to the Vashar Gate aliens. -## -- --korrath limits the set to the Korrath Gate aliens. +## -- --outer limits the set to the M2–M4 aliens, and -- -- (for example +## -- --vashar, -- --korrath or -- --sylith) to that galaxy gate's aliens. func _initialize() -> void: @@ -11,13 +11,14 @@ func _initialize() -> void: func render_preview() -> void: var sector_view := "--sector" in OS.get_cmdline_user_args() var outer_view := "--outer" in OS.get_cmdline_user_args() - var vashar_view := "--vashar" in OS.get_cmdline_user_args() - var korrath_view := "--korrath" in OS.get_cmdline_user_args() + # The first gate named on the command line, derived from the gate definitions. + var gate_view := "" + for gate: String in GalaxyGates.ORDER: + if gate_view.is_empty() and "--" + gate in OS.get_cmdline_user_args(): + gate_view = gate var kinds: Array = ["Skirmisher", "Raider", "Marauder", "Warden", "Ravager", "Overlord"] if outer_view else Alien.TYPES.keys() - if vashar_view: - kinds = GalaxyGates.info("vashar")["pool"].keys() - elif korrath_view: - kinds = GalaxyGates.info("korrath")["pool"].keys() + if not gate_view.is_empty(): + kinds = GalaxyGates.info(gate_view)["pool"].keys() if DisplayServer.get_name() == "headless": push_error("Alien review rendering requires a graphics display.") quit(1) @@ -61,7 +62,7 @@ func render_preview() -> void: preview.camera.position = Vector3(0, 4, -25 if row == 0 else -90) preview.camera.look_at(Vector3.ZERO) elif row == 1: - var diameter := float(Alien.VISUAL_DIAMETERS[kind]) * float(Alien.VISUAL_SCALE[kind]) + var diameter := float(Alien.VISUAL_DIAMETERS.get(kind, ContractPreview.PLACEHOLDER_DIAMETER)) * float(Alien.VISUAL_SCALE[kind]) preview.camera.position = Vector3(-8, 5, 10).normalized() * maxf(15.0, diameter * 1.5) preview.camera.look_at(Vector3.ZERO) previews.append(preview) @@ -72,12 +73,11 @@ func render_preview() -> void: var directory := ProjectSettings.globalize_path("res://build/validation") DirAccess.make_dir_recursive_absolute(directory) var filename := "alien-visibility-sector.png" if sector_view else "alien-models-godot.png" - if outer_view: + # A gate filter overrides --outer for both the roster and the filename. + if not gate_view.is_empty(): + filename = gate_view + "-" + filename + elif outer_view: filename = "outer-" + filename - elif vashar_view: - filename = "vashar-" + filename - elif korrath_view: - filename = "korrath-" + filename var error := root.get_texture().get_image().save_png(directory.path_join(filename)) print("ALIEN_PREVIEWS ", root.size, " renderer=", RenderingServer.get_video_adapter_name(), " result=", error) quit(error)