Proposal: Cargo Preservation API for Refrigerated Transport

Willkommen in der Transport Fever Community

Wir begrüßen euch in der Fan-Community zu den Spielen Transport Fever und Train Fever, den Wirtschaftssimulatoren von Urban Games. Die Community steht euch kostenlos zur Verfügung damit ihr euch über das Spiel austauschen und informieren könnt. Wir pflegen hier einen freundlichen und sachlichen Umgang untereinander und unser Team steht euch in allen Fragen gerne beiseite.

 

Die Registrierung und Nutzung ist selbstverständlich kostenlos.

 

Wir wünschen euch viel Spaß und hoffen auf rege Beteiligung.

Das Team der Transport-Fever Community


  • Proposal: Cargo Preservation API for Refrigerated Transport

    Hi everyone,


    I am exploring a cold-chain mod for Transport Fever 3 and would like to propose a native cargo delivery-time API. I would also appreciate hearing whether a supported solution already exists.


    The intended behavior is simple: fish, meat, or vegetables should consume their delivery-time budget more slowly while carried in a refrigerated compartment, without becoming a different cargo type.

    Why an engine-level API?

    The game already has per-cargo delivery limits, and specialized warehouses can freeze delivery timers. However, I have not found a documented way to apply a comparable preservation effect to cargo in a vehicle compartment or adjust an individual item's effective delivery age.


    Resource modifiers and script wrappers offer useful workarounds. Separate refrigerated goods are another possibility, but they require changes to production chains and receiving facilities. Script-side timing also needs to stay consistent with native quality displays, delivery statistics, and industrial effects.

    Proposed capabilities

    The following names and examples are illustrative proposals, not existing API calls.


    1. Declarative preservation rates


    An optional deliveryTimeRate on a vehicle compartment's cargo entry could specify:

    • 1.0: normal timing.
    • 0.25: one minute of effective delivery age per four minutes transported.
    • 0.0: paused timing.

    This should apply to the compartment actually holding the cargo, not the whole train or vehicle consist. The same concept could optionally be exposed for warehouse stocks, preserving current defaults when the field is omitted.


    2. Per-cargo timing queries


    A getDeliveryTimeInfo(cargoEntity) query could return whether timing has started, effective delivery age, the current adjusted delivery limit, the active rate, and native on-time status.


    Mods should not need to duplicate the game's deadline rules or infer timing from internal component fields.


    3. Controlled timing adjustments


    A command such as makeCargoAdjustDeliveryAgeCmd(cargoEntity, deltaMs) could adjust effective age. Positive values would increase it; negative values would reduce it, with a minimum of zero.


    This would support scripted preservation treatments and other transport conditions without exposing unrestricted timestamp writes.

    Required behavior

    • Use simulation time and start at the first pickup, retaining the existing deadline rules.
    • Preserve accumulated effective age across unloading and transfers: changing containers changes the rate, not the cargo's age.
    • Integrate with native quality indicators, late-delivery statistics, and any industrial calculations using delivery timeliness.
    • Save and restore timing state without double-counting or adding real-world time spent offline.
    • Retain existing behavior for old resources and mods.
    • Leave completed delivery records unchanged by later adjustments.
    • Keep actual transport duration distinct from effective delivery age, including in existing income-function callbacks.

    Example

    A shipment could travel through:

    • Five minutes of normal transport: 5 minutes of effective age.
    • Twenty minutes of refrigerated transport at rate 0.25: 5 minutes.
    • An hour in a specialized warehouse: 0 minutes.
    • Five minutes of normal last-mile transport: 5 minutes.

    The final effective delivery age would be 15 minutes.


    This is a request for control over delivery-time accounting, not necessarily a new spoilage simulation.

    Questions for the community and Urban Games

    Is there already a supported mechanism for this? If not, would compartment-level preservation rates and a small timing-query/command API be a practical extension?


    I would be interested in other modding use cases and compatibility concerns as well.


    Relevant documentation:


    Cargo types and delivery times

    Warehouses and specialized storage


    Thanks for any feedback.