#pragma once #include "CoreMinimal.h" /** * Constants of the world definition and its density function (World/DescentWorldDef.*, World/DescentSDF.*; * DESIGN_UE.md sections 2.2, 2.7 - 2.12). Metres unless the name says otherwise. The geometry tables themselves * (chambers, wells, galleries, chokes, tubes, beacons) are data and live in World/DescentWorldDef.cpp. */ namespace Descent::Tune::World { // ---- seeds (section 2.9): fixed, so every run and every test sees the same world ------------------------------- constexpr uint32 NoiseSeedA = 20193; // `noise3`: the craggy look of all walls constexpr uint32 NoiseSeedB = 771; // `noiseB` constexpr uint32 PoreSeed = 99; constexpr uint32 WormSeed = 5150; constexpr uint32 DepositSeed = 4242; // ---- the density function (section 2.2) ---------------------------------------------------------------------- /** Gen = clamp(GenRaw, -ClampD, +ClampD). */ constexpr double ClampD = 4.0; /** Rock-side noise on ordinary voids: rock = open + AmpN1 n1 + AmpN2 n2 (+ AmpDeepB noiseB below DeepZ). */ constexpr double AmpN1 = 5.5; constexpr double AmpN2 = 1.4; constexpr double AmpDeepB = 1.8; constexpr double DeepZ = -330.0; /** Carrier-scale voids use low noise so their clearances are honest (section 2.8). */ constexpr double AmpBigN1 = 2.2; constexpr double AmpBigN2 = 0.8; constexpr double BigBlendK = 8.0; constexpr double BigWellBlendK = 12.0; constexpr double CanyonX0 = -250.0; constexpr double CanyonX1 = 850.0; constexpr double CanyonHalfWidth0 = 70.0; constexpr double CanyonWallSlope = 0.18; constexpr double CanyonBlendK = 10.0; /** Z of the Throat's rim and the flat sea floor beyond the claim: everything above is open sea. */ constexpr double RimZ = 40.0; constexpr double RimWobble = 3.0; constexpr double AbyssX = 1250.0; constexpr double AbyssY = -300.0; constexpr double AbyssTopZ = -1400.0; constexpr double AbyssBottomZ = -1640.0; constexpr double AbyssRadiusTop = 70.0; constexpr double AbyssRadiusBottom = 6.0; constexpr double AbyssBlendK = 14.0; constexpr double PoreBlendK = 2.6; constexpr double SpongeBlendK = 4.0; constexpr double SpongeBoxGrow = 12.0; constexpr double SpongeNoiseCut = 0.085; constexpr double SpongeScale = 28.0; // ---- gather margins (section 2.2: same margins as v2 gatherLists) --------------------------------------------- constexpr double GatherSegMargin = 10.0; constexpr double GatherChamberMargin = 16.0; constexpr double GatherPoreMargin = 8.0; constexpr double GatherWellMargin = 14.0; constexpr double GatherShelfMargin = 8.0; constexpr double GatherPinchMargin = 48.0; /** Uniform bucket grid the world definition builds once, cell edge in metres. */ constexpr double BucketCell = 80.0; /** GenQuick caches one gathered list per cell of this edge, in an LRU map of GenQuickCacheEntries entries. */ constexpr double GenQuickCell = 40.0; constexpr int32 GenQuickCacheEntries = 4096; // ---- the claim: the designed region (section 2.7) -------------------------------------------------------------- constexpr double ClaimX0 = -330.0, ClaimX1 = 1560.0; constexpr double ClaimY0 = -980.0, ClaimY1 = 480.0; constexpr double ClaimZ0 = -1700.0, ClaimZ1 = 60.0; /** Beyond the claim: the dense basalt ramps up over this distance; nothing is cut past it (section 2.11). */ constexpr double BasaltRampM = 40.0; constexpr double BasaltHardnessGain = 7.0; // ---- strata (section 2.7) ---------------------------------------------------------------------------------- constexpr double Stratum1Z = -260.0; // S0 -> S1 constexpr double Stratum2Z = -560.0; // S1 -> S2 constexpr double Stratum3Z = -960.0; // S2 -> S3 constexpr double HardnessS0 = 1.0, HardnessS1 = 1.2, HardnessS2 = 1.5, HardnessS3 = 1.9; constexpr double CarrierStartZ = -30.0; constexpr double GoalZ = -1325.0; // ---- Tender tubes (section 2.9) ----------------------------------------------------------------------------- /** One segment per this many metres of a Catmull-Rom tube. */ constexpr double TubeSegmentLength = 3.0; /** Arc-length divisions used to parameterise a Catmull-Rom tube (three.js default). */ constexpr int32 TubeArcDivisions = 200; /** Gallery waypoints are at most this far apart (turtle path). */ constexpr double TurtleStepM = 8.0; // ---- procedural variation (section 2.9) --------------------------------------------------------------------- constexpr int32 PoreCount = 900; constexpr int32 PoreMaxAttempts = 6000; constexpr double PoreRadiusMin = 2.5, PoreRadiusSpan = 8.0; constexpr double PoreBelowZ = -330.0; // tube-wall pores only below this constexpr int32 WormCount = 36; constexpr double WormRadiusMin = 3.0, WormRadiusMax = 6.0; constexpr double WormLengthMin = 60.0, WormLengthMax = 220.0; constexpr double WormStepM = 8.0; constexpr double WormYawJitterDeg = 25.0, WormPitchJitterDeg = 15.0; constexpr double WormPocketChance = 0.40; constexpr double WormPocketRadiusMin = 8.0, WormPocketRadiusMax = 16.0; constexpr double WormPocketBlendK = 4.0; /** Rejection rule: a procedural void closer than this (plus its own radius) to a well or gallery axis is discarded. */ constexpr double NearCarrierRouteM = 30.0; // ---- deposits (section 2.12) --------------------------------------------------------------------------------- constexpr int32 DepositTarget = 600; constexpr int32 DepositMaxTries = 60000; constexpr double DepositMarchMax = 70.0; constexpr double DepositMinSpacing = 8.0; constexpr double DepositHalfMin = 2.0, DepositHalfSpan = 4.0; constexpr double DepositRadiusMin = 1.3, DepositRadiusSpan = 1.3; constexpr double DepositSinkFactor = 0.35; // centre sits this fraction of the radius behind the surface constexpr double DepositAboveRimSkip = 8.0; // no veins within this of the rim /** Yield = round(2 + half * radius * 0.9) loose chunks. */ constexpr double DepositYieldBase = 2.0, DepositYieldFactor = 0.9; /** Every this many removed core samples inside a vein give one mined chunk (v2). */ constexpr int32 DepositSamplesPerChunk = 6; // ---- the Shear (section 2.11) -------------------------------------------------------------------------------- constexpr double ShearBaseZ = 25.0; constexpr double ShearVertRamp = 4.0; // h / 4 constexpr double ShearLatRamp = 10.0; // a / 10 constexpr double ShearLatOffset = 150.0; constexpr double ShearMaxPart = 40.0; constexpr double ShearToward = 0.8, ShearDown = 0.6; /** The HUD warns from this Z (15 m before any push). */ constexpr double ShearWarnZ = 10.0; }