Transport Fever 2

Transport Fever 2

Smart Power and Tractive Effort Customiser
正在显示第 1 - 9 项,共 9 项条目
更新于:11 月 4 日 下午 10:53
作者:AksLrs

v2.0 Smart Power and Tractive Effort Customiser - Major Version

-Added

--DRY multiplier pools: Single generator makeMultiplierPool(maxVal) with a central POOLS = { POWER, TE, TRAM_ROAD }.
--Robust carrier normalization: Handles both numeric and string carrier codes and falls back via metadata to classify rail/road reliably.

-Changed

--Slider indexing is now safe:
--Before (v1.6): Default mapped to the first multiplier (e.g., x1.5) due to direct indexing → unintended scaling.
--Now (v2.0): Default always means no change (1.0). Multipliers resolve with a correct index-1 offset.

---Multiplier values are numeric:

----Before: multipliers generated as strings (e.g., "1.5") and used directly in arithmetic.
----Now: multipliers are numbers, ensuring type-safe math and fewer surprises.
----Clear scaling scope: Power/TE applied across engines and, when present, vehicle-level availPower and maxThrust-only if the resolved multiplier ≠ 1.0.
----Rounding policy: Removed unconditional math.floor(...) on engine fields. Values stay as floats for accuracy (consistent behaviour).
----Run function hardening: Safely reads mod settings and applies a single loadModel hook.

-Removed

--All cache layers and trimming logic (safeGetWithTrimming, cache tables, access counters, generateCacheKey, etc.).
--Compartment/passenger deep scans (hasPassengerCompartment, hasPassengerLoadConfig, nested table scans, duplicate caches).

-Passenger-driven MU switching:

--Before: If a powered rail vehicle “carried passengers,” it switched to MU sliders.
--Now: No inference. MU sliders apply only if the model is explicitly flagged multipleUnitOnly. Unpowered wagons are naturally ignored (no engines → nothing to scale).

-Fixed

--Indexing bug for UI sliders: Default no longer triggers unintended scaling.
--Type safety: Eliminated arithmetic on string multipliers.
--Potential crash path: Removed table.concat(modSettings, ',') on a dict-like table (invalid in Lua).
--Shadowed/duplicate caches: The old checkCompartmentsCache duplication is gone, along with the overhead that provided no runtime benefit for this mod.

-Behaviour Changes (Breaking)

--MU selection logic simplified: Powered passenger locomotives/units that previously got MU multipliers only because they “carried passengers” will no longer do so unless the asset is explicitly multipleUnitOnly.
--Rationale: passenger wagons don’t expose power/TE, so inferring MU from “passenger-ness” added complexity without benefit.

-Migration Tips

--If you relied on the old “passenger ⇒ MU” heuristic: set multipleUnitOnly = true on assets that should use MU sliders, or adjust the Locomotives sliders instead.
--Keep sliders at Default to preserve vanilla values; dial up only the specific categories you want (MU, Loco, Tram/Road, Air, Water).

- Summary

--The new v2.0 is leaner, safer, and easier to maintain:
--Fewer moving parts (no caches, no deep passenger scans).
--Correct and predictable slider behaviour.
--Explicit, transparent rules for when MU scaling applies.

更新于:2024 年 2 月 14 日 下午 5:54
作者:AksLrs

-- 1.6 implemented an advanced caching mechanism designed to significantly enhance the performance by reduced Load Times, avoiding redundant computations, especially for games with a lot of vehicle mods installed.

更新于:2024 年 2 月 14 日 下午 5:42
作者:AksLrs

-- 1.5 Major Version
- Introduced multipliers for all vehicles (Rail, Road, Air, Water)
- Major performance improvement

更新于:2024 年 1 月 16 日 上午 3:44
作者:AksLrs

1.4 -- Minor performance improvement

更新于:2024 年 1 月 15 日 下午 4:38
作者:AksLrs

1.3 -- Minor code improvements

更新于:2023 年 12 月 31 日 上午 4:41
作者:AksLrs

1.2 -- Introduce the "Default" value. Update to multipliers to handle more cases. Minor performance optimization

更新于:2023 年 12 月 26 日 下午 9:12
作者:AksLrs

Minor code improvements

更新于:2023 年 12 月 26 日 下午 8:56
作者:AksLrs

Add slider to mod menu

更新于:2023 年 12 月 26 日 下午 5:12
作者:AksLrs