Initial commit: SpaceshipTest, a top-down space RTS in Godot 4.7.1
A fleet of neon-outlined ships explores a procedurally generated, seeded infinite world: tap/joystick steering, pinch zoom, formation pivoting, planet landings, an ore economy with extractors and haulers, and player built structures (mothership, ship crafter, command centre). All art is hand-drawn with draw_* calls rather than textures, and the backgrounds are camera-relative shaders so they stay precise at large world coordinates. Includes a 35-test headless suite (tests/run_tests.sh) plus screenshot tooling that renders real frames through Xvfb and Mesa softpipe, since --headless has no GPU. Excluded from version control: .godot/ (import cache, and it holds export credentials), builds/, android/build/ and packaged APKs - all regenerable, and ~325 MB combined. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
commit
85814ce88c
192 changed files with 9602 additions and 0 deletions
38
tests/test_biome_generation.gd
Normal file
38
tests/test_biome_generation.gd
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
extends SceneTree
|
||||
|
||||
# Headless gameplay test: run with
|
||||
# godot --headless -s res://tests/test_biome_generation.gd
|
||||
# Verifies WorldGen's biome-per-chunk function is deterministic (querying
|
||||
# the same chunk twice gives the same biome) and that the seeded noise
|
||||
# field actually produces both biome types within a reasonably large
|
||||
# sampled area - a regression guard against a threshold tuned so one biome
|
||||
# never appears at all.
|
||||
|
||||
func _initialize() -> void:
|
||||
var deterministic_ok: bool = true
|
||||
for i in range(20):
|
||||
var chunk: Vector2i = Vector2i(i * 3 - 10, i * 2 - 5)
|
||||
var a: int = WorldGen.biome_at_chunk(chunk)
|
||||
var b: int = WorldGen.biome_at_chunk(chunk)
|
||||
if a != b:
|
||||
deterministic_ok = false
|
||||
print("FAIL: chunk %s gave %d then %d" % [chunk, a, b])
|
||||
|
||||
var space_count: int = 0
|
||||
var asteroid_count: int = 0
|
||||
for x in range(-25, 25):
|
||||
for y in range(-25, 25):
|
||||
var biome: int = WorldGen.biome_at_chunk(Vector2i(x, y))
|
||||
if biome == WorldGen.Biome.SPACE:
|
||||
space_count += 1
|
||||
elif biome == WorldGen.Biome.ASTEROID_FIELD:
|
||||
asteroid_count += 1
|
||||
|
||||
print("deterministic_ok=%s space_count=%d asteroid_count=%d" % [deterministic_ok, space_count, asteroid_count])
|
||||
|
||||
if deterministic_ok and space_count > 0 and asteroid_count > 0:
|
||||
print("TEST_BIOME_GENERATION: PASS")
|
||||
quit(0)
|
||||
else:
|
||||
print("TEST_BIOME_GENERATION: FAIL")
|
||||
quit(1)
|
||||
Loading…
Reference in a new issue