Train Inertial Singularity

by Etrunon

Trains now print free resources—as long as they keep moving. Exploit spacetime to multiply cargo on long journeys, but beware: traffic jams will collapse the waveform and destroy your bonus. The factory must roll.

Content
5 hours ago
2.0
0
Logistics Trains

Changelog

Version: 0.2.0
Date: 2026-06-16
  Features:
    - Added an html calculator to better visualize the impact of all parameters. Go customise your
      game!
  Changes:
    - Improved the formula and the default values. Added a table in the mod page description that 
      shows the gains with those values.
Version: 0.2.0
Date: 2026-06-16
  Features:
    - Quality-aware cargo bonus (Space Age): each quality tier of cargo receives its bonus at
      that same quality. A wagon of rare iron plates earns rare bonus plates, not normal ones.
      Higher quality tiers earn a smaller share of the bonus via a geometric falloff:
      factor = (1 − X)^rank, where rank is 0 for normal, 1 for uncommon, etc. At the default
      X = 25%: normal = ×1.0, uncommon = ×0.75, rare = ×0.5625, epic = ×0.4219,
      legendary = ×0.3164. The falloff is tunable via the new "Quality bonus falloff" setting.
      In the base game (no Space Age), only normal quality exists so behaviour is identical.
    - The singularity is now a researched reward, gated behind a tree of "Inertia Singularity"
      technologies (per force). Until "Inertia Singularity I" is researched, cargo trains
      accumulate nothing and deliver exactly what they loaded.
    - Two parallel research tracks, both branching off "Inertia Singularity I" (which itself
      requires Automated rail transportation):
        * Cargo track (Singularity I -> II -> III -> IV): each tech raises the reachable share
          of the configured maximum bonus by a quarter. Singularity I = 25% of the cap,
          Singularity IV = the full cap.
        * Fuel track (Fuel Singularity -> Fuel Singularity II): turns the fuel energy-density
          reward on at half strength, then full strength. Before any fuel research, all fuels
          grow cargo at the neutral rate.
    - Science cost escalates: Singularity I starts on red/green/blue science (300), the deepest
      techs pull in utility and production science (up to 1000).
    - The wagon singularity panel is hidden entirely until a train's force has researched the
      first cargo technology; there is no bonus to show before then.
    - New runtime-global setting "Bonus only on intermediate products" (default on): restricts the
      bonus to items in the vanilla Intermediate products group (plates, gears, circuits...) plus
      all fluids; finished goods, ammo and buildings are delivered exactly as loaded. Turn it off
      to let the bonus apply to all cargo.
  Changes:
    - Fuel energy density now bends the bonus SUBLINEARLY instead of linearly: the per-locomotive
      fuel factor is (fuel energy / reference) ^ density exponent, clamped to the max fuel factor.
      The reference fuel stays exactly neutral (1.0); denser fuel rewards more and thinner fuel
      less, but the huge wood-to-nuclear energy span is compressed rather than swinging the bonus
      from near-zero to capped. New runtime-global setting "Fuel density exponent" (default 0.5 =
      square root; 1.0 = old linear behaviour; 0.0 = fuel density ignored).
    - The researched cargo share now scales the bonus GROWTH itself, not only the cap. Previously
      every tech grew the bonus at the same rate and only raised the ceiling, so short hauls felt
      identical at Singularity I and IV. Now the same trip delivers four times the bonus with
      Singularity IV (share 1.0) as with Singularity I (share 0.25), at every distance.
    - The bonus cap is now (configured maximum x researched cargo share), and the per-span fuel
      factor is blended toward neutral by the researched fuel share, both resolved per force.
    - Retuned the default growth curve to a clear anchor: a 1000-tile nonstop run on the densest
      fuel now reaches +50% (load 100 -> deliver 150), with that bonus split EQUALLY between
      distance (+25% on reference fuel) and fuel density (the densest fuel doubles it). Defaults:
      growth coefficient 0.25 -> 0.36, distance scale 200 -> 1000, fuel factor max 3.0 -> 2.0.
      Setting tooltips spell the split out. On coal the same run is about +8%.
  Bugfixes:
    - Fluid trains no longer deliver only their loaded amount: draining-pump detection no longer
      depends on the live fluid connection (which has not formed yet on the tick the train stops),
      so it now matches a pump by the static position its pipe connection points at the wagon --
      the same stop-tick-reliable approach already used for unloading inserters.
    - Fixed a crash ("Fluid amount has to be positive") when delivering a fluid bonus: spreading
      the total across wagons left a sub-epsilon floating-point residue that the spill pass tried
      to insert. Fluid inserts below epsilon (and any NaN/inf) are now dropped.
Version: 0.1.0
Date: 2026-06-16
  Features:
    - Cargo trains accumulate a "singularity": a virtual cargo bonus that grows while the train
      moves and is delivered as real items/fluids when the train is unloaded at a station. The
      goal is to reward big train networks and long hauls.
    - Growth is logarithmic in the distance covered between stops (straight-line displacement per
      movement span), so long uninterrupted runs pay off with diminishing returns.
    - Growth is scaled by the energy density of the locomotives' fuel: denser fuel (rocket,
      nuclear) grows cargo faster, thin fuel (wood, coal) slower. Electric / fuel-less
      locomotives count as neutral.
    - The bonus decays back toward the loaded amount while a train is stopped and NOT being
      unloaded (waiting at a signal, jammed, parked, or sitting at a non-unloading stop). It can
      never push delivered cargo below what was loaded.
    - Works on both cargo wagons (items) and fluid wagons (fluids), spread evenly across all
      wagons of the train.
    - Unload detection is event-driven with no polling: an unloading inserter is matched by its
      static pickup position over a cargo wagon; a draining pump is matched by its connection and
      facing direction relative to a fluid wagon. Loading inserters and filling pumps are ignored.
    - On arrival the whole bonus is delivered at once where space allows (and metered in as the
      wagon drains otherwise), so a fast unloader can no longer empty the wagon and trip an
      "empty cargo" schedule condition before the bonus lands.
    - A panel anchored under the wagon inventory shows: an animated "engaged" bar while moving;
      the current multiplier, charge, and a preview of the pending bonus while in transit/parked;
      and while unloading, a bar and text for the bonus still incoming plus the bonus delivered
      here (with the % of the delivery that came from the bonus). The panel resets on departure.
    - Remote interface "inertia-singularity" lets other mods override the growth factor per fuel
      item or per locomotive prototype (set/reset/get).
    - Pure runtime script: no prototypes are replaced, so the mod is compatible with other train,
      wagon, and fuel mods.
    - Tunable via runtime-global settings: growth coefficient, distance scale, decay half-life,
      maximum bonus multiplier, fuel reference energy, and maximum fuel factor.