Feat: Auto-reconstruct rails using trains at dead-ends

Open
#5,513 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Active
Tech stack
typescript
Domain
game-dev

Research direction

Start at the factory-train arrival and station dead-end flow, then locate the existing function that calculates and places tracks when structures are added. Define the repair and payout behavior, and verify that a stranded train can reconnect eligible structures without removing manual track control.

Written by the indexing model from the issue text.

Description

not-approved

Purpose

When nuclear strikes destroy structures, the rail network connected to them gets destroyed too. Rebuilding these tracks manually by placing down new buildings can be a lot of effort, and newer players often do not even realize their rail lines are severed and that their trains stopped running.

This proposal adds an automated recovery mechanic: if a factory train gets stuck at a station because downstream tracks are missing, it stops there. It calls the game function that calculates and places tracks down, rebuilding the connection just like the game normally does when new buildings are placed. Optionally, this could consume the train's gold payout for that stop to balance out the repair.

Objectives

  • Automatically repair broken rail networks after nuclear strikes without requiring tedious manual rebuilding.
  • Help newer players whose train economies silently collapse after taking damage.
  • Preserve manual track control so skilled players can still plan and place structures deliberately.
  • Consider consuming the train's gold payout as an optional cost for laying down the new tracks.

Details

  • Trigger condition: A train spawned by a factory arrives at a station and cannot travel any further because the track is severed or dead-ends.
  • Behavior: The train stops at that station.
  • Repair action: It triggers the existing function that calculates and places tracks between eligible structures within range, exactly as if a new building was placed there.
  • Gold payout (optional): As a possible balancing option, the train could sacrifice its gold payout for that stop in exchange for the track repair, or it could simply lay the tracks and pay out normally.
  • Manual control preserved: High-level players can still manually lay out and optimize tracks ahead of time through structure placement, while casual players do not get permanently soft-locked out of train income.

Assignment

  • I'd like to be assigned to this issue and work on it myself

Discord: JB940

Dominant language
TypeScript
Stars
2.7k
Forks
1.4k
Avg merge
16h 28m
Merged PRs (30d)
332

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openfrontio/OpenFrontIO

All issues in openfrontio/OpenFrontIO

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.