feat(space): mini-asteroids roll seeded sizes and mineral families, water ice included - #689
Merged
Merged
Conversation
…ater ice included (#687) Every mineable space rock was the same clone: a fixed r=2 sphere with a titanium core and an iron/copper/stone shell, hardcoded loot, always 3. Rocks now roll a seeded family (stony/metallic/icy/carbonaceous/ crystalline, mirroring the landable families from #515) and a size (r=1 pebble / r=2 classic / r=3 boulder, cores growing with the rock); icy rocks are water-ice deposits around a rocky heart, and shoot-down loot matches family and size. Rock 0 of every field stays pinned to the classic metallic r=2 so each field guarantees one titanium core (mirrors the start-planet ring pin) and the mining tests keep their anchor. Rolls use a deterministic xorshift over integer state only (instance-id stable hash + world seed + spawn ordinal) so the same world grows the same rocks across restarts and platforms. closes #687 Co-Authored-By: Claude Fable 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Every mineable space rock was an identical clone: fixed r=2 voxel sphere, titanium core, iron/copper/stone shell, hardcoded loot. Rocks now roll seeded mineral families and sizes — including water-ice asteroids.
Closes #687. Builds on #686 (EVA mining hardness parity).
Changes
Server (
GameServerSpaceStructure.cs,GameServerSpaceCombat.cs)WorldGenerator.StableHash(instance.Id)+ world seed + spawn ordinal — integer state only: noRandom, nostring.GetHashCode(process-randomized), no trig-derived floats (Windows/Linux libm differ). Respawned rocks continue the ordinal sequence (3 + rotor).Balance
With #686 in place the mining feel scales by material automatically: ice (hardness 0.8) pops in one bare-hand hit — an easy water harvest — while titanium keeps its tier-2 drill gate.
Tests
SpaceAsteroids_RollSeededFamiliesAndSizes: pinned metallic anchor, legal sphere sizes, same world → identical rocks (restart-safe), different seeds → actual variety.StructureCellForTest(structureId, x, y, z).🤖 Generated with Claude Code