Black hole planet and dark matter #55
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A new landable body yielding dark matter, a resource that can only ever be obtained through an extractor - never as a surface pickup.
Depends on #49 (generalize the resource HUD readouts).
Scope
DarkMatterResourceGlyph.tscn+.gd(NeonDraw),DarkMatterResourceDefinition.tres(resource_id = "dark_matter", a deep violet/near-black-with-rim colour that still reads on both the dark space background and the bright rocky surface - check both), registered inResourceDefinitions.ORDER/DEFINITIONSandGameState.RESOURCE_DARK_MATTER.BlackHoleVisual.tscn+.gdimplementing the same informal interface asGasGiantVisual/RockyPlanetVisual-configure(shape_seed),extractor_anchor(), and animating via its own_process. Draw an accretion disc (concentric arcs, brighter inward) around an unfilled dark core; no solid body.BlackHolePlanetDefinition.tres-definition_id = "black_hole",resource_id = "dark_matter",surface_profile_id = "void", its ownnameslist, map colour. Register inPlanetDefinitions.VoidSurfaceProfile.treswith no resource provider - dark matter is extractor-only, so nothing may be gatherable by flying over it.PlanetSurfaceController._compose_surface()already toleratesfeatures_scene == null; use that rather than shipping an empty provider scene. Give the void profile its own background colours (and, if #51 has landed, optionally its ownbackground_shader).WorldGen.planet_data_at_chunk()currently picks rocky vsgas_giantfrom the biome. Add black holes as a rare third outcome, seeded deterministically from the chunk coordinates like everything else - the same chunk must always produce the same body, since bothPlanetFieldand the world map resolve planets through this one function and must never disagree (see #37).planet.resource_typeintoGameState.add_extractor(), so an extractor on a black hole banks dark matter with no change - confirm, don't reimplement.Acceptance criteria
WorldGenremains a pure function of chunk coordinates.run_tests.sh planet) still pass, including deterministic identity and map-marker agreement.Tests
tests/test_black_hole.gd(bash tests/run_tests.sh black_hole), plusrun_tests.sh planetandrun_tests.sh extractor. Screenshots: the black hole in space at 720x1280, and its landed surface showing an empty field.Repo notes (read before starting)
/storage/emulated/0/GodotProjects/SpaceshipTest.touchon it. Android FUSE does not bump mtime under~/storage/shared, and Godot's import cache will silently keep serving the old version, making a correct fix look like it did nothing.bash tests/run_tests.sh <substring>; full suite with no argument. Tests areSceneTreescripts printingTEST_NAME: PASS/TEST_NAME: FAIL (reason)and callingquit(0|1)- copy the shape oftests/test_capture_points.gd.bash tests/screenshot.sh <res://Scene.tscn> <out.png> <frames> 720x1280. Use few frames (~15); the software rasterizer is slow.--headlessrenders nothing at all, so it cannot validate visuals.NeonDraw/NeonPiece; do not introduce a different visual idiom.*Definitionresources plus capability component scenes. Do not addif type == "..."branches.FileAccess, nouser://).GameStateis an in-memory autoload. Do not invent a save system.Traps that have already cost hours on this codebase
const X = preload(...)in a test file that is itself the-sentry point. It evaluates during that file's own early compilation, which can run before autoloads are registered; any script it pulls in that referencesGameStateinside a function body then fails to compile withIdentifier not found: GameState. Usevar X: Scriptplusload()inside_initialize()instead. See the header comment intests/test_capture_points.gd.[]to a typedArray[Resource]export from another script fails at runtime - the compiler only sees the target asResourceand cannot confirm the element type. Leave the declared default alone, or build the typed array inside the owning script.Fleet.spawn_ships(0, ...)does not empty the fleet - it falls back to one default interceptor by design. Clearfleet.shipsexplicitly if a test or preview needs genuinely zero ships.ship.positionwithout also settingship.move_targetletsShip._physics_processsteer it straight back toward the stale target within a few frames.SceneTreetest's own_process()clock under device load, even with--fixed-fps 60. Gate waits on the system's own state (a component's timer or flag), not onelapsed >= duration.queue_free()s itself (projectiles, shells) must not be re-read inside a per-frame wait condition - cache the scalar you need before the wait._screenshot_tool.gd's_initialize(), so their_ready()races the game scene's own_ready(). Do setup on the first_process()tick, andget_tree().paused = trueonce everything is placed if the scene must hold still.Implemented in
cbe07bb.A rare, deterministically-seeded black hole planet type yielding a fourth resource, dark matter, obtainable only through an extractor - never a surface pickup.
dark_matteradded as a fully genericResourceDefinition(own glyph - concentric violet octagon rings around a near-black core, own colour), registered inResourceDefinitions.gdalongside ore/gas/energy. Confirmed generic end-to-end: shows up inresource_types(), the HUD readout (banked + fleet hold), and the extractor/transporter pipeline with zero black-hole-specific code.black_holeadded as aPlanetDefinition(BlackHoleVisual.gd: an accretion disc of rotating glowing arc segments, genuinely empty core - no solid body drawn), surfaced viaWorldGen.gdwith a flat 5% per-planet-chunk chance, excluded from the guaranteed early gas-giant landmark chunk so that source stays reliable.voidPlanetSurfaceProfilewith nofeatures_scene- no resource provider spawns there, confirmed by flying around a landed black hole for 2s and checking banked+fleet resource totals are unchanged from baseline.PlanetSetup(likevoid) never registered capture points at all, which would have permanently blocked extractor placement (is_planet_conquered()stuck false forever).register_capture_points()now treats a total of 0 required points as vacuously conquered, andPlanetSurfaceController._compose_surface()registers that zero-point state explicitly when no setup exists. Verified this doesn't affect any planet with real capture points, and doesn't regresstest_planet_conquest_gate.gd's "a fresh planet reported conquered" check.Tests:
tests/test_black_hole.gd(determinism + rarity vs gas giants across a 6,400-chunk scan, resource genericity, structural definition checks, no pickups on a landed void surface, extractor mining + transporter banking). Full suite: 81/82 passed (test_enemy_mothership.gdflaked under device load, confirmed unrelated - passes cleanly in isolation, no code touched by this ticket is anywhere near enemy mothership spawning).planet(11/11) andextractor(4/4) regressions also pass.Screenshots taken and visually confirmed:
Event Zerocaption, dark matter's own glyph visible in both BANKED and FLEET HOLD HUD rows, no scattered resource pickups anywhere on the field.