Skip to content

fix(space): EVA asteroid mining obeys drill tiers, hardness and inventory space - #686

Merged
marceld23 merged 1 commit into
mainfrom
fix/eva-asteroid-mining-hardness
Aug 3, 2026
Merged

fix(space): EVA asteroid mining obeys drill tiers, hardness and inventory space#686
marceld23 merged 1 commit into
mainfrom
fix/eva-asteroid-mining-hardness

Conversation

@marceld23

Copy link
Copy Markdown
Owner

Summary

During an EVA spacewalk, any asteroid block could be mined with a single bare-hand click — no drill, no hardness, titanium included — while the same block on a planet requires a tier-2 drill and several timed hits. With a full inventory the ore was silently lost (the cell was cleared before the drops were banked).

Closes #685.

Changes

Server (GameServerSpaceStructure.cs)

  • Asteroid mining now runs the planet rules: ToolCanMine (drill kind + MinToolTier) and per-cell hardness accumulation (progress += tool.MiningPower until BlockDefinition.Hardness), tracked in a new _structureMiningProgress map keyed by structure id + cell (same same-block guard as the world path).
  • Drops are capacity-checked with MaterialPool.CanFit before the cell clears (mirrors Mined drops are silently destroyed when inventory and cargo are full #600): a full inventory refuses the break with the standard @inventory_full reject; banked progress survives, so the block falls on the next hit once there is room.
  • Own-ship and station editing stays instant by design — construction UX, not resource gathering. Stale progress is dropped when an asteroid despawns.

Protocol (Messages.cs, NetCodec.cs)

  • New StructureMiningProgress message (structure-local cell + fraction), registered as tag 188.

Client (NetworkClient.cs, SpaceView.cs)

  • EVA mining is hold-to-repeat at the on-foot drill pace (0.28 s) instead of one intent per click.
  • The aim marker warms from cyan to orange with the server-reported progress, so multi-hit ore visibly works toward breaking.

Balance result

Block Bare hand Drill t1 (power 1) Drill t2 (power 2)
ice (0.8) 1 hit 1 hit 1 hit
iron_ore (4.0) rejected 4 hits 2 hits
titanium_ore (7.2) rejected rejected 4 hits

Soft materials keep the light one-hit feel by their own hardness; titanium keeps its tier-2 progression gate.

Tests

  • EvaMine_TakesOreFromAVoxelAsteroid updated (tier-2 drill, 4 hits).
  • New: EvaAsteroidMine_NeedsSeveralHits_AndTheRightDrill (bare hand + t1 rejected, t2 holds for 3 hits, falls on the 4th) and EvaAsteroidMine_RefusedWhenTheDropsWouldNotFit (full personal + cargo → refused losslessly; freeing a slot finishes the break).
  • Ship one-click editing stays locked in by the existing EvaStructureEdit_* tests.
  • Local: full Release build 0 warnings, 1363 + 147 tests green, Unity Windows client build OK.

🤖 Generated with Claude Code

…tory space (#685)

A single bare-hand click popped any asteroid block during a spacewalk —
titanium included — while the same block on a planet needs a tier-2 drill
and several timed hits; with a full backpack the ore silently vanished.

The EVA structure-mine path now mirrors the planet pipeline for asteroids:
ToolCanMine gates by drill kind + tier, hardness accumulates per hit, and
the new StructureMiningProgress message (NetCodec 188) drives the client
aim marker from cyan to orange as the ore works toward breaking. The
client mines hold-to-repeat at the on-foot drill pace instead of per
click. Drops are capacity-checked BEFORE the cell clears (mirrors #600):
a full inventory refuses the break losslessly and the banked progress
finishes the job once there is room. Own-ship and station editing stays
instant by design (construction UX, not resource gathering).

closes #685

Co-Authored-By: Claude Fable 5 <[email protected]>
@marceld23
marceld23 merged commit d0f871d into main Aug 3, 2026
12 checks passed
@marceld23
marceld23 deleted the fix/eva-asteroid-mining-hardness branch August 3, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EVA asteroid mining is one-click: no hardness, no tool gating, drops lost on full inventory

1 participant