Automated Rail Signal Placer


Automatically places rail-signal ghosts at train-length intervals between two selected points.

Content
a month ago
2.1
97
Trains

Changelog

Version: 0.10.3
Date: 2026-07-25
  Bugfixes:
    - Read each train-settings field defensively so a window whose individual elements were removed or invalidated by another mod falls back to the stored value instead of raising inside the GUI event handler.
  Changes:
    - Check the built entity's prototype before requesting a LuaPlayer in the deliberately unfiltered built-entity handler, lowering the per-build cost for unrelated entities.
Version: 0.10.2
Date: 2026-07-24
  Changes:
    - Make the first legal endpoint placement succeed whether or not Factorio's Build ghost modifier (Shift+place by default) is held, so Shift can remain held while adding subsequent route guides.
    - Treat a normal final-endpoint click matching the most recent guide as promotion of that guide to the endpoint; earlier ordered guides remain active, while finishing on an older guide is still rejected rather than silently truncating the route.
    - Update placement instructions to explain the hold-Shift guide workflow and how to finish at an accidentally added last guide.
  Bugfixes:
    - Preserve a real item picked up during the one-tick placement arbitration window instead of replacing it with the planner signal cursor.
    - Never destroy another player's locked temporary endpoint when a cross-mod event misattributes it as a temporary guide candidate, including cancellation, disconnect, player removal, and pending-candidate replacement during the deferred tick.
    - Deduplicate repeated sandbox/editor revive and built notifications so one setup placement cannot remove more than its own undo entry.
    - Remove a temporary sandbox marker's native undo item only when its prototype, surface, position, direction, ground/elevated rail layer, and quality match the exact intercepted placement; ambiguous history is preserved instead of risking removal of an older signal action.
    - Perform layer-aware undo correlation only after a normal endpoint ghost has revived into a real rail signal, avoiding rail-only property access on an entity ghost.
Version: 0.10.1
Date: 2026-07-23
  Changes:
    - Use Factorio's Build ghost control for ordered route-guide placement (Shift+place by default), including the player's remapped base-game binding.
    - Resolve the normal placement input, route-guide input, built-entity event, and script-raised revive on the following tick so their delivery order cannot turn an intended guide into the final endpoint.
    - Keep the planner's linked placement, guide, settings, and cancellation inputs enabled while spectating for sandbox and editor-style controller compatibility.
  Bugfixes:
    - Restore direct selection of existing rail and chain signals as endpoints or guides even when Factorio has transiently cleared the planner cursor ghost.
    - Correlate editor and sandbox direct-build revives with the exact event entity, player, surface, force, position, and direction instead of guessing from nearby signals.
    - Convert each newly placed endpoint ghost into a locked temporary signal immediately, preventing construction robots from building setup markers before the completed plan is released.
    - Give a same-tick route-guide or invalid-guide suppression request priority over ordinary endpoint placement regardless of event order.
Version: 0.10.0
Date: 2026-07-23
  Features:
    - After selecting the first endpoint, use Factorio's build-ghost modifier (Shift+place by default) to add up to eight ordered route guide points before placing the final endpoint normally.
    - Guide points constrain the shortest continuous, non-overlapping route through the chosen branches, loops, ramps, and rail layers.
  Changes:
    - Preserve the original two-click workflow when no route guide is used.
    - Store accepted guide points as numbered visual markers rather than construction ghosts or live signals, so the planner creates no robot jobs until the final endpoint completes the plan.
    - Determine one-way or paired two-way output from the two endpoint sides only; route-guide sides do not change the signaling mode.
    - Keep block spacing cumulative across the complete guided route and keep the first endpoint plus valid guides selected when a final endpoint is rejected.
    - Show the first endpoint and numbered guides in both game and map views, including a constant-size map label for long-distance planning.
    - Reject exceptionally dense guided searches at a bounded complexity limit without changing signals, rather than allowing a pathological rail maze to stall the game.
  Bugfixes:
    - Distinguish routes that share the same endpoints in cyclic or reconverging networks instead of always forcing the unconstrained shortest alternative.
    - Track guide progress as part of route-search state so a rail orientation can be revisited after a guide is reached without being discarded as an already visited state.
    - Preserve a longer clean guided route when a cheaper candidate reaches the same state only after consuming a rail it would need to traverse again.
    - Recover temporary endpoints and guides when a sandbox/editor mod raises its signal event before the planner receives the linked placement input, while rejecting wrong-direction or other-player signals.
    - Clear route guides tied to a reused first endpoint if that endpoint is mined before a replacement start is selected.
Version: 0.9.2
Date: 2026-07-23
  Changes:
    - Explain in the completion summary when pre-existing deconstruction orders are outside the generated plan's Ctrl+Z undo item.
    - Keep the common single-player ownership check allocation-free, while using one keyed route scan when relevant same-force multiplayer selections exist.
  Bugfixes:
    - Reject direct endpoint selection and completed routes that overlap another player's live temporary first endpoint, before changing any route signals.
    - Preflight both automatically generated opposite-side endpoint signals before committing a paired two-way plan, preventing a known obstruction from leaving a half-paired result.
    - Distinguish deconstruction orders cancelled by the plan and obsolete signals already scheduled for removal from undoable planner-created work.
    - Recover an exact desired built boundary that Factorio temporarily reports as disconnected while it has a pre-existing deconstruction order, then cancel and report that old order during commit.
Version: 0.9.1
Date: 2026-07-23
  Features:
    - Added a persistent per-player lateral-clearance setting for the optional cramped-position filter; 1.25 tiles remains the default and 0 disables the extra check.
  Changes:
    - Re-probe planner-created ghosts once per plan before reuse; continue treating untagged user, blueprint, and other-mod ghosts as deliberate placements rather than attachment-probing them.
    - Remove stale planner-owned ghosts at protected junction boundaries without changing user, blueprint, or built junction signals.
    - Thread the active player's lateral clearance explicitly through planning and cache attachment results for the synchronous plan.
    - Require ordinary rail signals at generated train-length boundaries; chain signals remain valid as deliberately selected endpoints and at protected junctions, while obsolete internal chain signals are removed without receiving overlapping normal ghosts.
  Bugfixes:
    - Revive endpoint ghosts on their own ground or elevated rail layer before considering an existing-signal fallback.
    - Reject the rare fallback when stacked ground and elevated signals are indistinguishable instead of choosing by entity iteration order.
    - Preserve construction ghosts during attachment probes so validation cannot consume another plan's shared-trunk ghost or transfer its undo ownership.
    - Validate and clamp stored lateral-clearance values and validate planner ghost layer tags before using them.
    - Save lateral-clearance edits immediately, matching the settings window's persistence promise.
    - Treat a temporarily unprobeable planner ghost as an unknown fixed boundary instead of reporting it as both reused and failed; spacing now remains safe even when that boundary would not otherwise have been selected.
Version: 0.8.2
Date: 2026-07-22
  Changes:
    - Rebalance spacing around known illegal or cramped internal boundaries before creating ghosts.
    - Reuse still-legal planner ghosts so a second branch can share an already-planned trunk.
    - Report preflight adjustments separately from unexpected build failures.
  Bugfixes:
    - Toggle Sandbox and editor-style controllers now intercept directly built rail signals as temporary endpoints instead of leaving ordinary signals behind.
    - Existing-endpoint clicks now verify Factorio's immutable selected-prototype snapshot, preventing cross-mod build ordering from misclassifying a newly built sandbox signal as pre-existing.
    - The first-endpoint highlight now remains visible until completion or cancellation instead of expiring after ten minutes.
    - Internal editor-event ownership promotion no longer prints a misleading same-endpoint warning.
    - If ghost revival loses a race with an existing signal, that built signal is reused as the endpoint instead of rejecting the click.
Version: 0.8.1
Date: 2026-07-22
  Changes:
    - Integrated the independently audited 0.8.0 safeguards after comparison with the engine-tested 0.7.3 core.
    - Prefer an already-built matching signal over a construction ghost at an alternative legal position.
    - Clarified that paired-boundary preflight prevents known incomplete new pairs but is not a database-style transaction.
    - Improved failure warnings so removal failures do not incorrectly imply that blocks can only become longer.
  Bugfixes:
    - Player removal now clears the first-endpoint render marker as well as its temporary signal.
Version: 0.8.0
Date: 2026-07-22
  Features:
    - Added an "Avoid cramped signal positions" settings checkbox so the lateral clearance filter can be disabled.
    - The shortcut now acts as a toggle: clicking it while active cancels the selection instead of silently restarting it.
    - The first endpoint is highlighted with a temporary circle marker so it is easy to find when placing the second.
  Changes:
    - Paired two-way boundaries are now placed completely or skipped as a whole, never leaving a one-directional half pair.
    - When an existing signal satisfies a placement, a second signal at the same boundary's alternative position is now removed instead of both being kept.
    - A visible warning is printed after completion whenever planned positions were skipped or removals failed.
  Bugfixes:
    - Rail-signal ghosts stamped from a blueprint while the planner is armed are no longer captured as endpoints.
    - Clicking the first endpoint signal again as the second endpoint is now rejected with a clear message instead of producing a zero-length plan.
    - A player leaving the game no longer strands a locked temporary endpoint signal until rejoin.
Version: 0.7.3
Date: 2026-07-21
  Changes:
    - Avoid legal-but-cramped signal positions beside unrelated rails at merges and crossings.
    - Keep user-selected endpoint positions unchanged while applying clearance to generated signals.
Version: 0.7.2
Date: 2026-07-21
  Bugfixes:
    - Reject final ghost positions unless a momentary real signal attaches to at least one rail.
    - Prevent orphan signals on elevated curves and during junction re-signalling.
    - Do not reuse detached signals or old planner ghosts on repeated runs.
Version: 0.7.1
Date: 2026-07-21
  Bugfixes:
    - Fixed valid second endpoints being rejected on the entry end of curves, ramps, and junction rails.
    - Route discovery now genuinely explores both physical directions from the first endpoint.
    - One-way versus paired two-way mode now remains correct whichever route direction reaches the second endpoint.
    - Paired endpoint ghosts now use the actual opposite signal side for every endpoint orientation.
Version: 0.7.0
Date: 2026-07-20
  Features:
    - Route discovery now tries both travel orientations from the first endpoint and chooses the shortest valid route.
    - Endpoint sides still determine one-way versus paired two-way output without requiring the first endpoint to face toward the route.
  Bugfixes:
    - Fixed valid retries being rejected after Ctrl+Z or signal removal when Factorio exposed the first endpoint through the opposite rail-end orientation.
    - Route search states now retain endpoint orientation independently, including across branches and merges.
    - Successful and cancelled plans leave no temporary endpoint signals behind.
Version: 0.6.2
Date: 2026-07-20
  Bugfixes:
    - Fixed the non-recoverable "Entity is not rail-signal" error when placing the first endpoint.
    - Temporary endpoints now use LuaEntity.silent_revive instead of reading rail-signal-only fields from an entity ghost.
    - Ghost revival preserves Factorio's internal ground or elevated rail attachment without creating a robot construction job.
    - Uses the Factorio 2.1 writable minable_flag property when locking temporary endpoint signals.
Version: 0.6.1
Date: 2026-07-20
  Bugfixes:
    - Endpoint placement no longer depends on the cursor ghost still being present when Factorio delivers the built-entity event.
    - The endpoint cursor is explicitly re-equipped after the first endpoint is accepted.
    - Q cancellation now listens to the real clear-cursor control instead of treating automatic cursor changes as cancellation.
    - Removed the built-event prototype filter and validate endpoint ghosts in the handler for compatibility with altered signal prototypes.
Version: 0.6.0
Date: 2026-07-20
  Features:
    - Consolidated the interface to one native Factorio shortcut-bar button.
    - Added a configurable Shift+P input and /rail-planner-settings command for the train settings window.
    - Endpoint ghosts are now replaced immediately by locked, non-minable temporary vanilla rail signals.
    - Temporary endpoints show actual rail-block behavior without creating construction jobs.
  Bugfixes:
    - Personal construction robots can no longer build an endpoint and invalidate the span before the second endpoint is placed.
    - Final signal ghosts are created only after both endpoints form a valid connected route.
    - Temporary endpoint signals are removed on completion, cancellation, configuration migration, and player removal.
Version: 0.5.0
Date: 2026-07-20
  Features:
    - Renamed the mod to Rail Signal Planner.
    - Replaced the floating screen GUI with two native Factorio shortcut-bar buttons.
    - Added a normal-signal shortcut for endpoint placement and a chain-signal shortcut for persistent train settings.
    - Replaced the cloned endpoint prototype with tagged ghosts of Factorio's real rail-signal prototype.
  Bugfixes:
    - Endpoint placement now uses Factorio's own signal snapping and validation on ground and elevated rails.
    - Removed the custom rail-signal prototype, eliminating collision-mask and rail-attachment conflicts with graphics and rail mods.
    - Migration removes the obsolete floating and top GUI buttons.
Version: 0.4.1
Date: 2026-07-20
  Bugfixes:
    - Restored the base rail-signal ground and elevated collision masks required by Factorio.
    - Fixed startup compatibility with Factorio HD Age: Base Game - Logistics and Factorio HD Age: Elevated Rails.
  Features:
    - Clicking an existing rail or chain signal while the tool is armed now reuses it as an endpoint.
    - Shared branch starting points no longer depend on overlapping rail-signal prototypes.
Version: 0.4.0
Date: 2026-07-20
  Features:
    - Added bounded shortest-path routing through left, straight, and right rail branches.
    - Added automatic one-way mode for same-side endpoints and paired two-way mode for opposite-side endpoints.
    - Protected divergence and merge boundaries from ordinary signal placement and removal.
    - Preserved signals that belong only to unselected branches.
    - Reused existing signals at desired positions and marked obsolete real route signals for robot deconstruction.
    - Kept signal removal orders and newly generated ghosts in one native undo group.
    - Allowed the temporary endpoint ghost to overlap existing signals so shared branch starting points can be reused.
Version: 0.3.0
Date: 2026-07-20
  Features:
    - Replaced the top GUI button with a persistent bottom-right rail-signal tool button.
    - Added right-click configuration with automatically saved per-player train settings.
    - Added left-click activation of a hidden, ghost-only rail-signal endpoint marker.
    - Made endpoint markers use a cloned rail-signal prototype for normal signal snapping and visualization.
    - Generated normal rail-signal ghosts at both endpoints as well as between them.
    - Grouped every generated signal ghost into one native Factorio undo item for single-step Ctrl+Z undo.
    - Added Q-to-cancel behavior and automatic cleanup of temporary markers.
Version: 0.2.0
Date: 2026-07-20
  Changes:
    - Targeted Factorio 2.1 exclusively.
    - Added a Mod Portal thumbnail and an MIT license file.
    - Changed automatic vanilla spacing to seven rail tiles per vehicle with zero default clearance.
    - Balanced generated blocks while guaranteeing that every generated block fits the configured train.
    - Tried both primary and alternate legal signal locations, including their rail layer.
    - Kept the first endpoint selected after a rejected second endpoint so placement mistakes are recoverable.
    - Added GUI selection status, explicit selection cancellation, button toggling, and Escape-to-close behavior.
    - Removed locale keys that could overwrite Factorio's shared gui.close and gui.cancel translations.
    - Added per-player storage cleanup, bounded numeric input, and clearer expert signaling guidance.
Version: 0.1.0
Date: 2026-07-20
  Features:
    - Added per-player GUI for locomotive count, wagon count, clearance, and manual spacing override.
    - Added two-endpoint normal rail signal workflow.
    - Added automatic regular rail-signal ghost placement on unbranched spans.
    - Added ground/elevated rail-layer handling.
    - Added /rail-span-reset command.