sim
A module script.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2strict
airDensity(altitude: number) → number
Air density by the ISA troposphere model.
| arg | type | description |
|---|---|---|
| altitude | number |
airTemperature(altitude: number, surfaceK: number) → number
Ambient air temperature (K): sea-level surface temp minus the lapse rate.
| arg | type | description |
|---|---|---|
| altitude | number | |
| surfaceK | number |
bmrKcalPerDay(mass: number) → number
Basal metabolic rate, kcal/day. BMR = 70 * M^0.75.
| arg | type | description |
|---|---|---|
| mass | number |
bmrWatts(mass: number) → number
Basal metabolic rate as heat, watts.
| arg | type | description |
|---|---|---|
| mass | number |
q10Factor(bodyK: number, q10: number?) → number
Metabolic rate scales with body temperature (Q10 = 2.3 for reptile tissue).
| arg | type | description |
|---|---|---|
| bodyK | number | |
| q10 | number? |
wingspan(wingArea: number) → number
Wingspan from area and aspect ratio: b = sqrt(AR * S).
| arg | type | description |
|---|---|---|
| wingArea | number |
wingLoading(mass: number, wingArea: number) → number
Wing loading, kg/m^2 -- mass per unit wing area.
| arg | type | description |
|---|---|---|
| mass | number | |
| wingArea | number |
lift(rho: number, v: number, wingArea: number, cl: number) → number
Lift, newtons. L = 0.5 * rho * v^2 * S * CL.
| arg | type | description |
|---|---|---|
| rho | number | |
| v | number | |
| wingArea | number | |
| cl | number |
drag(rho: number, v: number, wingArea: number, cl: number) → number
Drag, newtons. Parasite + lift-induced.
| arg | type | description |
|---|---|---|
| rho | number | |
| v | number | |
| wingArea | number | |
| cl | number |
stallSpeed(mass: number, wingArea: number, rho: number) → number
Stall speed, m/s. The airspeed below which CL_max cannot carry the weight. v_stall = sqrt( 2 m g / (rho S CL_max) )
| arg | type | description |
|---|---|---|
| mass | number | |
| wingArea | number | |
| rho | number |
glideRatio( ) → number
Best glide ratio (L/D max) for this planform.
hoverPower(mass: number, wingArea: number, rho: number) → number
Induced power to hover, watts (Pennycuick momentum-jet): P = (m g)^1.5 / sqrt(2 rho A_disc), A_disc = pi b^2 / 4. This is the equation that makes square-cube bite: mass enters as ^1.5 while the disc it must push against only grows with wing area.
| arg | type | description |
|---|---|---|
| mass | number | |
| wingArea | number | |
| rho | number |
frontalArea(mass: number) → number
Frontal area of the body, m^2 -- what the air actually has to be pushed around in forward flight.
| arg | type | description |
|---|---|---|
| mass | number |
powerCurve(mass: number, wingArea: number, v: number, rho: number) → PowerCurve
Mechanical power to hold level powered flight at airspeed `v` (Pennycuick). Hovering is the expensive corner of the envelope, not the normal case: induced power falls as 1/v while parasite power climbs as v^3, so the sum is U-shaped and has a minimum. That minimum is why an animal too heavy to hover can still fly perfectly well once it is moving -- and why the launch problem (a hover, from a standstill) is a completely different question from the cruise problem.
| arg | type | description |
|---|---|---|
| mass | number | |
| wingArea | number | |
| v | number | |
| rho | number |
minPowerSpeed(mass: number, wingArea: number, rho: number) → number
The airspeed that costs the least power to hold -- an animal's cruising speed, found by walking the curve.
| arg | type | description |
|---|---|---|
| mass | number | |
| wingArea | number | |
| rho | number |
availablePower(mass: number, muscleFrac: number, bodyK: number, anaerobic: boolean) → number
Peak mechanical power the flight muscles can produce, watts. Muscle mass * mass-specific burst power, gated on body temperature.
| arg | type | description |
|---|---|---|
| mass | number | |
| muscleFrac | number | |
| bodyK | number | |
| anaerobic | boolean |
muscleTempFactor(bodyK: number) → number
Muscle power derates away from optimal temperature; below the cold edge it collapses, above the hot edge proteins start to fail.
| arg | type | description |
|---|---|---|
| bodyK | number |
launchMassLimit(wingArea: number, muscleFrac: number, bodyK: number, rho: number) → number
The mass at which this planform can no longer flap-launch, kg. Solved numerically: the crossover of P_avail ~ m^1.0 and P_hover ~ m^1.17.
| arg | type | description |
|---|---|---|
| wingArea | number | |
| muscleFrac | number | |
| bodyK | number | |
| rho | number |
surfaceArea(mass: number) → number
Body surface area, m^2. Meeh's law: A = k * M^(2/3) -- the square-cube law in its plainest form. Surface grows slower than volume, so a big dragon sheds heat badly and a hatchling freezes fast.
| arg | type | description |
|---|---|---|
| mass | number |
convectionCoeff(airspeed: number) → number
Convective heat transfer coefficient, W/(m^2 K). Rises with airspeed.
| arg | type | description |
|---|---|---|
| airspeed | number |
radiationCoeff(meanK: number) → number
Linearised radiative coefficient, W/(m^2 K), about a mean temperature. h_rad = 4 * eps * sigma * T^3.
| arg | type | description |
|---|---|---|
| meanK | number |
vasomotorTone(bodyK: number) → number
Vasomotor state, 0 = fully constricted (hoard heat), 1 = fully dilated (dump heat). An animal at its setpoint holds heat; it only opens the skin once it is running hot. Tone rises from optimal to the hot edge.
| arg | type | description |
|---|---|---|
| bodyK | number |
insulationCoeff(bodyK: number, armor: number) → number
Core-to-skin conductance, W/(m^2 K). Armour is dead weight in the air but it is also insulation -- ossified plates over fat raise the core's thermal resistance.
| arg | type | description |
|---|---|---|
| bodyK | number | |
| armor | number |
overallU(bodyK: number, airK: number, airspeed: number, armor: number) → number
Overall core-to-air heat transfer coefficient, W/(m^2 K). Series resistance: core -> skin (insulation), then skin -> air (convection in parallel with radiation).
| arg | type | description |
|---|---|---|
| bodyK | number | |
| airK | number | |
| airspeed | number | |
| armor | number |
evaporativeWatts(metabolicW: number, bodyK: number, humidity: number) → number
carry in dry air at full pant. High, and measured: birds in flapping flight shed most of their heat production through the respiratory tract (Torre-Bueno 1976), and a dragon flying hard is ventilating at the top of that range. Evaporative heat loss, watts. Scales with metabolic rate (ventilation follows workload) and ramps up as the animal heats past its setpoint.
| arg | type | description |
|---|---|---|
| metabolicW | number | |
| bodyK | number | |
| humidity | number |
evaporativeWaterKgPerSec(evapW: number) → number
Water spent to shed that heat, kg/s. A dragon that flaps across a desert dies of thirst; this is the bill for the cooling above.
| arg | type | description |
|---|---|---|
| evapW | number |
shiverMultiplier(bodyK: number) → number
| arg | type | description |
|---|---|---|
| bodyK | number |
thermalBreakdown(i: ThermalInput) → ThermalBreakdown
Full heat budget, watts. Positive warms the core, negative cools it.
| arg | type | description |
|---|---|---|
| i | ThermalInput |
netHeatWatts(i: ThermalInput) → number
| arg | type | description |
|---|---|---|
| i | ThermalInput |
deltaTemperature(netWatts: number, mass: number, dt: number) → number
Temperature change over dt, K. dT = Q * dt / (m * c).
| arg | type | description |
|---|---|---|
| netWatts | number | |
| mass | number | |
| dt | number |
hoardSurfaceArea(hoardMass: number) → number
of solid gold's 19300 once you count the air between them Exposed surface of a heaped pile of treasure, m^2, modelled as a hemisphere at heaped-coin bulk density.
| arg | type | description |
|---|---|---|
| hoardMass | number |
hoardCoupling(hoardMass: number, dragonMass: number) → number
The share of a dragon's surface a pile of this size can actually support. You cannot drape a 400 kg animal over a bucket of coins: contact -- and so every thermal benefit -- is capped by the pile's own footprint.
| arg | type | description |
|---|---|---|
| hoardMass | number | |
| dragonMass | number |
hoardThermalMass(hoardMass: number) → number
Thermal mass of the pile, J/K -- the number that decides whether a hoard rides out a night. Compare against a dragon's own m * TISSUE_C.
| arg | type | description |
|---|---|---|
| hoardMass | number |
methanogenActivity(bodyK: number) → number
Methanogen activity vs body temperature. Mesophilic archaea peak near 38 C and stall below 15 C.
| arg | type | description |
|---|---|---|
| bodyK | number |
methaneRate(gutCarrion: number, bodyK: number, backpressure: number?) → number
Rate of CH4 production, mol/s, gated on sac backpressure. Methanogens are inhibited by the partial pressure of their own product, so a full sac slows the culture rather than bursting it -- fermentation stalls as the sac approaches burst pressure.
| arg | type | description |
|---|---|---|
| gutCarrion | number | |
| bodyK | number | |
| backpressure | number? |
sacPressure(moles: number, sacVolume: number, bodyK: number) → number
Sac pressure, Pa absolute. Ideal gas: P = nRT/V.
| arg | type | description |
|---|---|---|
| moles | number | |
| sacVolume | number | |
| bodyK | number |
sacCapacityMoles(sacVolume: number, bodyK: number) → number
Moles the sac can hold before it vents.
| arg | type | description |
|---|---|---|
| sacVolume | number | |
| bodyK | number |
ignitionQuality(catalystCharge: number, bodyK: number) → number
Ignition quality, 0..1. The mechanical igniter (the click) throws a spark that lights a small kernel on the Pt-group bed. The bed never has to reach bulk light-off: once CH4 starts oxidising on platinum the reaction's own enthalpy (-890 kJ/mol) carries the bed up in milliseconds and the front propagates. So catalyst loading decides whether a kernel propagates at all, and body heat decides how reliably -- a warm bed is already part of the way to CATALYST_LIGHTOFF_K, so less of the gap is left for the exotherm to bridge before the kernel quenches.
| arg | type | description |
|---|---|---|
| catalystCharge | number | |
| bodyK | number |
nozzleDiameter(mass: number) → number
Throat diameter, m. The nozzle scales with the animal, which is why a hatchling gets a candle and an adult gets a cutting torch.
| arg | type | description |
|---|---|---|
| mass | number |
jetVelocity(pressure: number, bodyK: number) → number
Jet exit velocity, m/s. Compressible flow out of the sac: v = sqrt(2 * dP / rho), with rho the sac gas density from the ideal gas law.
| arg | type | description |
|---|---|---|
| pressure | number | |
| bodyK | number |
isometricWingArea(mass: number) → number
The wing area an isometrically-grown animal of this mass would carry. Wing area tracks mass^(2/3): area scales as length^2, mass as length^3. Growing mass without paying for wings is what strands a dragon.
| arg | type | description |
|---|---|---|
| mass | number |
massFromKcal(kcal: number) → number
Mass gained from surplus energy, kg.
| arg | type | description |
|---|---|---|
| kcal | number |
armorMass(mass: number, armor: number) → number
Armor adds dead weight: ossified dermal plates at ~2.0 g/cm^3 over the body surface.
| arg | type | description |
|---|---|---|
| mass | number | |
| armor | number |
displayScore(mass: number, t: Traits, sacMoles: number, bodyK: number) → number
Visible fitness -- what a rival can actually see and score in a display. Size, span, plume, and armor are honest signals; they cost what they show.
| arg | type | description |
|---|---|---|
| mass | number | |
| t | Traits | |
| sacMoles | number | |
| bodyK | number |
lifeStage(mass: number) → string
| arg | type | description |
|---|---|---|
| mass | number |
inheritTraits(parent: Traits, rng: () → void
Inherit traits from a parent with mutation. Offspring start at hatchling mass but keep the parent's proportions, drifted.
| arg | type | description |
|---|---|---|
| parent | Traits | |
| rng | ( |
drift(v: number, lo: number, hi: number) → number
| arg | type | description |
|---|---|---|
| v | number | |
| lo | number | |
| hi | number |
starterTraits( ) → Traits
clutchArea(eggCount: number) → number
Surface area of a clutch, m^2 -- eggs modelled as spheres.
| arg | type | description |
|---|---|---|
| eggCount | number |
incubationRate(nestK: number) → number
Incubation progresses only inside the band; outside it, the clutch chills or cooks and progress decays.
| arg | type | description |
|---|---|---|
| nestK | number |
PowerCurve = {ThermalInput = {ThermalBreakdown = {FermentStep = {BreathResult = {Traits = {Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.