Active Rails


Adds an Active Rail for better train control

Utilities
2 months ago
2.0
273
Transportation Trains Circuit network

Changelog

Version: 0.0.3
Date: 2025.07.27
  Bugfixes:
    - Transfering from previous saves would cause a crash if there were active rails missing their combinators, or vice versa
Version: 0.0.2
Date: 2025.07.23
  Changes:
    - Active Rails can now be placed in all directions and curvatures
    - Change from old Active Rail item to new Active rail item (which is now a rail-planner) due to prior misunderstanding of rail functionality.
  Optimizations:
    - Reduced processing time per tick by about 33% when all Active Rails have outputs. Only a 20% reduction in performance for Active Rails when they are not reading a train. Reduced nearly all unnecessary processing time on unused rail inputs. On my weak laptop the game can handled about 400 updating Active Rails before UPS drops, more as long as they are not currently outputting, which I am pretty happy with for now
Version: 0.0.1
Date: 2025.07.20
  Changes:
    - "Active Rails" Separated into a standalone mod
    - Used rail orientation to avoid false detection of train on adjacent diaganol tracks
    - Improved Initiation of global tables, mostly just for active rails already present in saves before this mod was created
    - [Previous] Robots can now place rail combinators with correct wires attached
    - [Previous] Blueprinting and Copy-Pasting Active Rails are improved significantly
    - [Previous] Active Rails are able to be built on Space Age and modded planets
    - [Previous] Circuit conditions now work as intended when re-evaluating interrupts
    - [Previous] Interrupts will no longer need to be marked as "inside-interrupt" to be included in re-evaluation on decoupling
    - [Previous] When re-evaluating interrupts, the train will return to the same speed if its new path is in the same direction as its old one
    - [Previous] When Trains couple or decouple, they will immediately check if any interrupt conditions are true, then activate the interrupt
    - [Previous] Rails now have a larger zone of detection (2.5x2.5 tiles around their centerpoint), but will only show the information of the train car closest to that rail
    - [Previous] Rail combinators are now centered on the rail
    - [Previous] Active Rails are now blueprintable; Rail Combinators maintaining circuit connections and rotation when rebuilt
    - [Previous] Rail Combinators are now updated every tick (previously every 15 ticks)
  Bugfixes:
    - Locomotives would not output fuel inventory
    - [Previous] Crash when decoupling certain trains
    - [Previous] Fluids of train cars actually get output to the Rail Combinator
    - [Previous] Robots building wouldn't cuase Active Rails to pair with a Rail Combinator (they will still not build combinators with any wires, that will need a more in-depth fix)
    - [Previous] Crash when placing an Active Rail on a non-Nauvis planet
    - [Previous] Game would crash when decoupling a locomotive that was automatic with no path
    - [Previous] Schedules with multiple interrupts now work as intended
    - [Previous] Additional error in the global table of Active Rails
    - [Previous] Incorrect initiation of global tables
    - [Previous] Crash when placing active rails
    - [Previous] Automatic trains coupling or decoupling would swap schedules due to use of guess and check to couple/decouple
    - [Previous] A train car close enough to a couple signal on an adjacent track would attempt to couple
    - [Previous] Trains in automatic would resort to manual mode after being coupled
    - [Previous] Protection against anamolous crashes
    - [Previous] Critical error crashing the game when placing an Active Rail
  Modding:
    - [Previous] Mini Trains added as optional dependency
  Major Features:
    - [Previous] Initial release, introduces active rails and train collisions