Makes the total amount of each map resource the same on every map, regardless of the Colony Site's resource level. In vanilla a low-resource site gives fewer and leaner deposits and a high-resource site more and richer ones (the per-level numbers are on the Colony Sites page); this pins every map's totals to a fixed target while leaving the number of spots exactly as vanilla rolled them - only the amount each spot holds changes. Status: Tested v2.9 - in StS as Code/StS_ResourceParity.lua.
Every map is normalized to these totals (the numbers a deposit's tooltip shows). "Surface and shallow" is the tier workable with no deep tech (surface piles plus depth-1 scanned deposits); "deep" is the depth-2 tier behind Deep Water Extraction / Deep Metal Extraction. Metals surface splits into the loose piles you pick up directly and the depth-1 scanned metal. These are the rough baseline; Metals and Rare Metals are then shifted by map Topography (see below), Water and Concrete are not.
| Resource | Surface and shallow | Deep |
|---|---|---|
![]() | 50k | 150k |
![]() | 20k | none |
![]() | 7.6k = 1200 loose piles + 6.4k shallow scanned | 13k |
![]() | 3k | 5k |
So at the rough baseline total Metals on a map is 20.6k (1.2k + 6.4k + 13k), total Water 200k, total Rare Metals 8k, total Concrete 20k. The spot counts stay whatever the generator rolled, and the deposit grade (the 60-140% roll) is left vanilla: grade is a mining-speed modifier, not stored amount, so it changes nothing here.
The hillier the map, the more Metal and Rare Metal it carries. Every Metals and Rare Metals
target above (loose, shallow, deep) is scaled by (100 + pct)/100, where the percent
comes from map Topography
(StS_TopographyMetalPercent in
Code/StS_ConditionTopography.lua).
Water and Concrete are untouched.
| Topography | Shift | Loose | Shallow | Deep | Metal total | Rare total |
|---|---|---|---|---|---|---|
| Relatively Flat | -20% | 960 | 5120 | 10400 | 16,480 | 6,400 |
| Rough | 0% | 1200 | 6400 | 13000 | 20,600 | 8,000 |
| Steep or Mountainous | +20% | 1440 | 7680 | 15600 | 24,720 | 9,600 |
Concrete has to be handled differently from the other three, so the feature has two parts.
Terrain concrete is a painted terrain patch, and the extractor physically digs that patch. Its
minable amount is Min(painted-terrain yield, max_amount)
(TerrainDeposit.lua:551), so raising max_amount after the map is
built cannot conjure more concrete - the terrain area caps it. Concrete therefore has to be scaled
at the ResourcePreset before the map builds, which scales the painted terrain
and the amount together.
On ClassesBuilt the mod scales the three per-patch volume ranges
(TerrSizeVol1/2/3) on Concrete_VeryLow .. Concrete_VeryHigh
so each level's expected total is 20k, leaving the patch counts
(TerrSizeCount1/2/3) untouched. Because concrete is many small-to-large patches, the
per-map roll around 20k is modest - concrete is exact on average, not identical every map. (This is
the same preset edit the ConcreteTriple
probe proved.)
These three are scaled from the actual deposits the generator placed, so the total is exact on every single map - not just on average, and not dependent on the site level. That matters most for the deep tiers, which spawn few spots with a wide count roll (deep water 2-6 spots, deep metal 4-10): a preset-only scale would leave a big per-map wobble there, and reading the real map removes it.
Msg("MapSectorsReady", exploration) fires at the end of
Exploration:Init (Exploration.lua:1139), after every deposit marker is
registered. The mod runs once per colony (guarded by a saved flag) and only on the main Mars
map; Below and Beyond asteroid / underground maps are created later by player action, use their
own *_Asteroid_* / *_Underground_* presets, and are left alone.sector.markers.surface / .subsurface / .deep
(GetDepositList → GetDepthClass,
Exploration.lua:371-375; SubsurfaceDeposit.lua:55-57). Surface holds
the loose metal piles (and concrete, skipped here); subsurface is depth-1; deep is depth-2.target / actual, so the sum lands exactly on target while the spots keep
their relative sizes. Editing an unrevealed marker's max_amount carries into the
deposit the player later scans: both SubsurfaceDepositMarker:SpawnDeposit and
SurfaceDepositMarker:SpawnDeposit build the deposit with
max_amount = self.max_amount (SubsurfaceDeposit.lua:85-86,
SurfaceDeposit.lua:91). An already-placed deposit is updated in place as well.max_amount is 0; the 5-15 per-pile amount is rolled at spawn
(SurfaceDeposit.lua:43,51-55,139-142), so a ratio scale means nothing. Instead
every loose-metal marker is set to a flat target / N (N = number of loose-metal
spots on the map; target 1200 at the rough baseline, shifted by topography), which is exact and
applies to piles spawned later on scan; any pile already placed
is updated via SurfaceDeposit:Setmax_amount, which also updates its drone request
(SurfaceDeposit.lua:202-206).Affects new colonies only - deposits on an existing save were already rolled at generation
time and are not touched. Spot counts are never changed; only per-spot amounts. Amounts are stored
internally as the on-screen number × const.ResourceScale (1000), the same
convention the other rebalances use.
Base game and DLC, decompiled (method: docs/reading-surviving-mars-code.md). The per-level vanilla resource totals this normalizes are derived on the Colony Sites page.
mod-survive/Code/StS_ResourceParity.lua - Part A concrete on ClassesBuilt/ModsReloaded; Part B on MapSectorsReady, guarded by GlobalVar StS_ResourceParityDone, scoped to MainCity.map_idLua/Exploration.lua:1139 - Msg("MapSectorsReady", self) at end of Exploration:Init; :371-375 MapSector:GetDepositList buckets a marker by GetDepthClass; :832-837 sector.markers {surface, subsurface, deep}Lua/Buildings/SubsurfaceDeposit.lua:55-57 GetDepthClass (depth_layer ≤1 = subsurface, else deep); :85-86 SpawnDeposit max_amount = self.max_amount; :14-21 DepositGradeToMultiplier (60-140%, mining speed only)Lua/Buildings/SurfaceDeposit.lua:91 SpawnDeposit max_amount = self.max_amount; :43,49-56,139-142 marker max_amount 0, per-pile 5-15 rolled at spawn; :202-206 Setmax_amount updates the transport requestLua/Buildings/TerrainDeposit.lua:551 amount = Min(terrain yield, max_amount); :240-247 extractor digs the painted terrain patch - concrete cannot be scaled up post-genData/ResourcePreset.lua - Concrete_VeryLow.._VeryHigh TerrSizeCount1/2/3 (patch counts, kept) and TerrSizeVol1/2/3 (per-patch amount, scaled to expected 20k)Lua/City.lua:466-468 MainCity set + Msg("CityStart"); :472-478 OnMsg.NewMapLoaded calls Exploration.InitLua/_GameConst.lua:214-221 DepositsDefaultAmountRange (Metals 5-15); const.ResourceScale = 1000