Skip to content

About

Makes the auto-engineer drive like a person: a smooth throttle, early gentle braking for signals and speed limits, no creeping past stops, a stall guard on grades the train cannot climb, and optional realistic fuel use.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

158 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

College Educated Auto Engineer (Railroader)

Formerly Auto Engineer Brake Fix (versions up to 2.9.16). The mod folder and identifier are now CollegeEducatedAutoEngineer and exp232/collegeeducatedautoengineer; copy Settings.xml from the old Mods\AutoEngineerBrakeFix folder to keep your settings, and delete that old folder.

Makes the AI engineer drive like a person: less wasted coal and water, a smooth throttle, gentle brake sets for signals, no creeping past a stop, and (with Wheelslip Prototype) no spinning wheels or sliding cars. It changes the commands the game's own engineer issues, so the game's planner, signals and orders still work.

The features are on by default and can be switched off in the in-game settings window (Ctrl+F8, applied at once). Options without a control there are edited in Settings.xml in the mod folder (read at start-up). A copy of Settings.xml is kept in Documents\Railroader\CollegeEducatedAutoEngineer-Settings.xml and restored if an update replaces the mod folder (delete both to reset to defaults). Logging is off by default.

Throttle

  • Smoothing: the 0.6 rollout controller sets the throttle a notch at a time about once a second. The mod low-pass filters it (1.6 s, ThrottleSmoothingSeconds in Settings.xml), limits how fast it opens (full in 5 s) and closes, and with "Glide" on moves the lever about 20 times a second between the controller's updates, so it moves smoothly in the cab. A brake application or a real overspeed closes it at once. Smoothing is skipped at crawling speeds and near a coupling, so coupling behaves like stock.
  • Diesels: "Smooth diesel throttle" switches smoothing off on diesels, for use with another mod that smooths the notches. If another mod rounds a diesel's lever to the nearest notch, the "Diesel notch guard" switches smoothing off for that locomotive by itself so it can still notch up.
  • Diesels start in notch 1: the game often opens a diesel to notch 2 to 5 for a standing start. It now starts in notch 1 and takes one more notch every 2 s only while the train is not getting going (under 0.3 mph and gaining less than 0.1 mph), so a heavy train still gets away. On an upgrade at or above the hill-start grade (with the spool-up on) the game's notch is kept.
  • Shorter steam cutoff: the stock engineer uses the longest cutoff that reaches peak power, but steam and coal use rise with cutoff while pulling power does not. Above 5 mph the mod picks the shortest cutoff that gives up no more than 3% of that power (CutoffTolerancePercent), never longer than stock. Same route and train: coal fell 44% and water 26% for a few seconds more running time. On climbs of 2% or more (CutoffRevertGradePercent) the stock cutoff is used.
  • Hill-start spool-up: starting on an upgrade of 0.5% or more (HillStartMinGradePercent), the throttle is raised to the start-up value while the engineer waits for the train brake to release with the locomotive brake still on, so the locomotive is already pulling when the brake lets go.

Wheel slip, sand and car brakes

Work with the game's own wheel slip; with Wheelslip Prototype installed they also use its weather, sand and rail wear. Wheelslip is found by itself, and only used while it is actually running (Wheelslip Prototype switches itself off on a game build it does not support; the 0.9.8 package that lists 0.6.3 build 26740326 works, the earlier 0.9.8 package accepted only 0.6.2).

  • Slip guard: the throttle is held to 92% (SlipMargin) of what the driver wheels can carry before they slip: their weight on the drivers times the rail's grip. The guard learns how much effort the locomotive makes per unit of throttle at each speed, so it needs no slip to find the limit, and the limit rises as the train speeds up and falls on a wet rail. If the wheels slip anyway, the throttle comes down until they grip (the game gives a slipping wheelset only a tenth of its weight), then climbs back to a level a little under the one that slipped; a slip that shows the guard's estimate was too low lowers the limit for good. Below 1 mph the game's own start-up throttle is held to the same limit. A diesel is never held under one notch unless its wheels slip. Stands down above 30 mph (SlipGuardMaxMph).
  • Slip guard in manual driving: the game keeps the auto engineer attached while you drive by hand, so the slip guard and its sanding also look after a hand-driven locomotive. Switch this off to keep manual driving entirely yours (for example to slip the wheels on purpose); the engineer keeps both.
  • Sanding (Wheelslip Prototype, with its "Include AutoEngineer" option on): the engineer sands after a slip (for a few seconds after it), when the train's tonnage on the grade under it needs more than the dry rail carries, and on a rail the weather has made slippery when it asks for more than the rail carries. It never sands with the throttle shut, and an open throttle on a dry rail is no reason to sand. Up to 25 mph (SlipSandMaxMph). GP9 and SD7 keep Wheelslip's own automatic sanding.
  • Avoid car wheel lock (Wheelslip Prototype's wagon brakes): a car locks its wheels when its brake force passes the rail's grip, which happens at low speed because the brake force rises as a train slows. The engineer caps the train brake where the worst car would stay under that line and eases it off if one is past it, including on a direction-change stop. It also keeps Wheelslip's lock law to the real physics: the game's engineer asks each car's brake force at a full application while it plans, and those questions alone used to lock the cars.

Braking and stopping

  • Signals: the engineer reacts to a signal's aspect from 500 m (SignalSightMeters; the game uses 200 m). The game applies an Approach limit "right now", which makes the engineer brake at full effort; the mod applies it at the signal and keeps it until the next signal is registered, so the train doesn't speed up in between.
  • Earlier, lighter slowing: a lower limit is treated as starting 10 s of travel sooner ("Slowing lead"), so braking starts earlier and is lighter, and speeds land on the limit instead of under it. Stops are not shifted.
  • No power into reductions: with a lower limit in sight and the train already at or above it, the throttle is closed so the train coasts down before braking. Power returns once the train is a mph under the limit. Not on climbs of 1.5% or more, or below 5 mph.
  • Brake tap limit (2 mph): when the train is no more than this over its target, is not gaining speed and nothing ahead needs it to slow, the controller's first light brake application becomes a coast.
  • Stay stopped: in Road mode, within 2.5 m of a stop target the engineer holds the stop; the stock engineer can treat a train stopped 1-3 m short of a signal as "should be moving" and creep past it. Waypoint and Yard modes keep the game's own 1 m stopping accuracy; a train that has arrived stays stopped while coupler slack eases it back up to 1.5 m, and a waypoint newly set a few feet away is still driven to.
  • Hold stops without emergency (game 0.6.3): when the game holds a train at its stop mark it puts the train brake in emergency (a 90 psi reduction); this holds it with a full service application instead (StopHoldFullService, on).
  • Stop with the train brake: stopping a moving train with no speed order (changing direction, or a speed of 0) uses the train brake only: the locomotive brake is bailed off above 2 mph and only holds the train once it is nearly stopped. The planner's brake limit is lowered to 0.15 (about 13 psi, DirectionStopBrakeLimit) for a longer, gentler stop. Only when the cars behind the locomotives are at least half the train's weight (DirectionStopMinTrailingPercent); if the train has not slowed by 0.5 mph in 15 s the stop is handed back to the game.
  • Direction-change pause: when the engineer is told to run the other way it stands still for at least 3 s (0 to 15, 0 = off) with the brakes held and the throttle closed, even when the order came while the train was still rolling, and blows the stop blast first if the game skipped it ("Blast before reversing"). Time already stood counts. Then the game's own start-up runs.
  • Planner weights: five multipliers scale the rollout controller's scoring (1 = the game's value): PlanOverspeedScale, PlanUndershootScale, PlanUndershootDeadbandScale, PlanCeilingScale (Settings.xml) and PlanIndependentUseScale (the "Locomotive brake use" slider).

Stall guard

The game has no stall check: on a grade the train cannot climb, the engineer cycles between full throttle and light braking while rolling back. The guard latches in three cases: the train rolls back against its order (0.4 mph, or 0.2 mph just after a slip; once it has moved the ordered way or had power on while standing); it has been at full throttle for 10 s (StallSeconds) under 4 mph on a climb of 1% or more without gaining speed; or it cannot start at all (under 0.5 mph with the throttle at half or more and the brakes off for the same time). It then closes the throttle, holds the brakes and tells you. In Waypoint and Road modes it also sets the speed order to 0 mph; set a speed again to retry. The hold ends when you change the direction, mode or waypoint, set a speed again, take over by hand, or switch the engineer off and on. It never acts on a locomotive you drive by hand.

Train preparation

When a standing train gets a new order to move (Road, Yard or Waypoint mode; the engineer switched on, set from 0 mph to a speed, or given a new mode or waypoint), the mod releases the handbrake on every car, connects the air between each pair of coupled cars with both anglecocks open, and closes the anglecocks at the two ends of the train, once per order ("Prepare train on new orders"). With Waypoint Queue loaded it is skipped for waypoint orders, which that mod handles itself (WaypointQueueCompat). LogCarKeys in Settings.xml writes each car's key-value entries to logs\carkeys_*.txt.

Doors, gates and lamps

  • Doors at station stops: the doors and gates of passenger cars, baggage cars, cabooses and work cars open car by car when the engineer stops at a station, each car closes its own late in the stop, and any still open close in turn when the engineer departs. In every mode, open doors and gates are closed before the train moves, and the gate or vestibule door on a car end coupled to a locomotive or tender is kept shut.
  • Observation car headlight: when the observation car leads the train (the engineer backing it), its headlight is bright while moving and dim while stopped, like the locomotive's, and goes off when it stops leading.
  • Marker lamps: the marker lamp at the rear end of the train shows red and every other marker lamp on the train is switched off; set when the train is standing and the train, its cars or its direction change (also with the engineer off, using the direction it last had). Class lights are left to you. MarkerRedPosition (0 to 3, 2 by default) is the lamp position that shows red outward; a lamp at a car's front end (a caboose trailing backwards) is turned by MarkerFrontLampTurns (3) so it also shows red outward.

Realistic fuel use (on by default)

Switch it on or off with the "Realistic fuel" toggle in the settings window (Ctrl+F8); it takes effect at once. The steam rate, efficiency and coal scale are edited in Settings.xml.

The game's coal and water use rises with speed even though a locomotive's power falls with speed, so fuel per horsepower is about right at 10-20 mph and 1.5-2x too high above 30 mph. With this option, steam = steam rate (default 21.5 lb per indicated hp-hour) x the engine's own power x a cutoff factor, and coal follows from the steam through an evaporation curve (8 lb water per lb coal at light firing, 7 at moderate firing, 5.5 at heavy firing). On the Bryson to Sylva Interchange round trip (EMR 5000, the game's 2-10-2 after the Southern Railway Ss class, about 1,931 short tons, 38.4 miles) this comes to about 23 lb of water and 3.4 lb of coal per indicated horsepower-hour, and about 116 lb of coal and 95 gal of water per 1,000 gross ton-miles (replayed from the logs); the game's own use on the same train was about 36 lb of water and 4.8 lb of coal per indicated horsepower-hour, and 172 lb and 153 gal per 1,000 gross ton-miles, and it ran out of water 3.9 miles short of the end. For comparison: Goss's Purdue tests (Superheated Steam in Locomotive Service, 1910) measured 21.6 lb of steam and 2.97 lb of coal per indicated horsepower-hour for a superheated engine at 200 psi in steady running (25.5 and 3.43 saturated), and about 20% more in service with stops; the ICC's Class I road-freight averages were 162 lb of coal per 1,000 gross ton-miles in 1921, 137 in 1926, 125 in 1929 and 111 to 117 from 1937 to 1943 (all routes, locomotives included). Logged use matched the tender within 1%.

By design nothing is burned while the throttle is closed, so a locomotive left idling does not run out of coal and water. A realistic idle burn may come later as a separate "hardcore" option.

Starting resistance (on by default)

The game uses the Davis equation for rolling resistance, which is only valid for a moving train: a standing car meets about 1.6 lb per ton, where real plain-bearing cars need 5-10 lb per ton to break away. This option adds a standing-start drag (default 7 lb per ton, fading out exponentially with speed: 37% left at 2.5 mph, about 13% at 5 mph). The "Fades out by" slider in the settings window sets the speed where the drag has faded out. Standing time (StartingResistanceStandingTime in Settings.xml, on by default) scales it by how long each car has stood: a car that has just stopped still has oil in its journals and starts at about 40% of the full drag, settling back over about 10 game minutes. It uses the game clock and is not saved, so cars count as fully settled when you load a save.

Fuel in fast-forward

The game charges fuel and water once per second of real update, whatever the time scale, so a fast-forwarded trip used about a third of its coal. The mod charges the game time that has actually passed (FuelFollowsTimeWarp, on by default; normal speed is unchanged).

Fusee in fast-forward

Fast-forward switches the main camera off, and the game's fusee code (Effects.FuseeRenderer.Update) then throws a NullReferenceException on every frame for as long as a fusee is near the train. The mod skips that update while there is no camera (GuardFuseeCamera, on by default). It only silences the error; nothing visible changes.

Coast band (1 mph by default)

Set "Coast band" in the settings window (1 mph by default). The engineer then closes the throttle when coasting would hold its speed and it is within the band below its target, or when the downhill will pick the train up to its target within the pickup horizon (30 s by default, CoastBandAssistSeconds in Settings.xml; slower than that the engineer accelerates on its own), and it waits to brake until it is more than the band over its target, unless a lower limit or a stop ahead needs the brakes. This stops the power-then-brake hunting on downhill and rolling track. Road and Waypoint modes.

Water stop for Road-mode engineers (on by default)

Switch on "Water stop" in the settings window (Ctrl+F8). When the tender's water drops below the "Stop below" level (25% by default), a Road-mode engineer looks ahead along the route as it is lined for the nearest water column or tower, tells you where it will take water, and slows to the approach speed (25 mph by default, WaterStopApproachMph in Settings.xml) about half a mile out, and further near the column so it can stop in the distance left; distances are measured from the tender's water hatch, so a shoved train with cars ahead of the engine is judged correctly. It keeps to your routing until the train is in the column's signal block, then switches to Waypoint mode just long enough to spot the tender under the spout, fills it with the column's own equipment, and goes back to Road mode at the speed and direction it had. With no column in sight it looks again every second. A train standing still counts a column any distance ahead of the hatch; a moving one needs about 30 m, since it could not stop in less. Changing its orders yourself cancels the stop. Works from Road or Waypoint orders (fast forward needs a Waypoint order); with a waypoint it only stops for a column before the destination and puts the waypoint back afterwards. Steam locomotives only; host only. The spotting method follows PrinceOfPluto's Waypoint Queue mod (MIT). Once stopped it checks where the hatch ended up and, if it is not under the spout, moves the train up or back (up to three times, as far as 100 m) before taking water. If the tender still can't be lined up, or no water comes in, the engineer stops at the column and hands over to you: take water by hand and it carries on with its road orders once the tender is full and the spout is up, or give it new orders yourself.

An engine whose QbanRambo Train Orders are running is left to Train Orders: no water stop is started for it, so it doesn't interrupt Train Orders' own refuel orders.

Swinging water spouts (now a separate mod)

Swinging spouts moved out in 2.7.0 to their own mod, College-Educated Spouts (exp232/collegeeducatedspouts): water columns and towers that turn to the tender hatch before they lower. It is not required, but highly recommended with this mod: when it is installed, the water stop counts a hatch that a turning spout can reach as in reach (and logs "College-Educated Spouts found"). Remove any spoutswing.txt from this mod's folder and put it in College-Educated Spouts' folder instead; the SpoutSwing* and HatchWidthFactor entries in Settings.xml are ignored now.

Legacy speed limits (on by default)

Since 0.6 the game no longer shows the map's per-track speed limits (the old speed boards are removed when a game loads), but the auto engineer still obeys them, so trains slow down for no visible reason (forum topic 306). Switch on "Fix legacy limits" in the settings window: on the mainline (track inside CTC signal blocks, which includes signalled passing sidings) these limits are cleared, so the railroad speed limit, curves and track class decide the speed. On branches, yards and spurs the limits stay (no boards are put up). Nothing is saved to the map; switching it off puts the limits back.

Detailed engineer status (on by default)

Switch on "Detailed status" in the settings window. The status line under the auto engineer controls then says what is setting the speed and how far ahead it is, for example "Curve Speed: 15mph in 420 ft", "Equipment Speed: 15mph", "Track Class: 25mph", "Track Speed: 45mph", "Engine Speed: 41mph", "Water Approach: 20mph in 2,000 ft" or "Water Fill". The wording follows the game's own ("Track Speed", "Station Stop"), and a distance is shown only for a speed reduction ahead. Hover it for the details: which car's curve rating, what the track alone would allow, the posted or railroad limit, the tender's water level and the next targets ahead with their distances. It updates as often as the engineer replans (every half second to three seconds). Distances are in feet and miles; "Metric distances" switches to metres and kilometres. Only the text changes, never the speeds. The tooltip detail is shown on the host.

Diagnostic log columns

The ae_*.csv log has routeMph, routeDropM, routeCause (the slowest limit in 1.5 km of route as the mod walks it, where it first drops, and why: class, equipment, curve, legacy, railroad) and zones (the first speed zones of the route profile the game gives the speed controller, mph@startM). In a test run the game listed every reduction 600-1,450 m ahead.

With Position and G forces on (Diagnostics section of the settings window, LogGForces), each row also has the locomotive's position and the forces on it: posX, posY, posZ (game coordinates in metres, posY = elevation), trackLoc (the front of the locomotive as a track location, in the format the /location command copies), area (the nearest ops area), and gX, gY, gZ in g. The axes are the locomotive's own: X forward (toward its front, F, end), Y to the right, Z up. Values are what an accelerometer on the locomotive would read, gravity included: standing on level track reads 0, 0, 1; a 2% grade adds about 0.02 to X (nose up) and a right-hand curve gives a positive Y (v²/r). The game simulates cars along the track only, so the mod works these out every physics tick from the locomotive's speed and the track geometry under it, then smooths them (GForceSmoothingSeconds in Settings.xml, 1 s; 0 = raw) to take out slack and coupler jitter. Only the locomotive is measured. Like the rest of the log, rows are written only while the engineer is running and the train is moving, and the first reading comes after the locomotive has moved half a metre.

Settings window

Press Ctrl+F8 in game (not at the main menu). Sections: Throttle; Wheel slip, sand and car brakes; Braking and speed limits; Train preparation; Stall guard; Starting resistance; Fuel and water; Speed limits and status; and Diagnostics and testing (the logging switches, all off by default, and a "Fill sand tank" test button with Wheelslip Prototype). The self-check result per feature is at the bottom. Changes apply at once and are saved to Settings.xml; "Reset these to defaults" resets everything in the window except the diagnostics.

With the Mod Settings Hub installed (optional), this page also appears in the hub's window (Ctrl+F7, or the button in the top-right menu). Ctrl+F8 still opens this mod's own window.

Only in Settings.xml: overspeed margin, cutoff tolerance and steep-grade limit, smoothing time, crawl-smoothing speed, stall time, the hill-start grade, the slip guard margin and speed limits, the sanding speed limit, the direction-change brake limit and its minimum car share, the other four planner weights, realistic-fuel steam rate, cutoff effect and coal scale, signal sight distance, the Approach signal options, CtcDropBlocks (map workaround for Sylva West eastbound, signalId:blockId pairs, empty = off), the coast-band pickup horizon, the water-stop approach speed and distance, starting-resistance standing time, the marker lamp positions, WaypointQueueCompat, LogCarKeys and the sample interval.

Install

Needs Railroader 0.6.0 or later; uses the game's built-in mod loader.

  1. Unzip into Documents\Railroader\Mods, so you have Mods\CollegeEducatedAutoEngineer\CollegeEducatedAutoEngineer.dll, 0Harmony.dll and Info.json.
  2. Start the game and enable "College Educated Auto Engineer" in the game's mod list.
  3. Settings: press Ctrl+F8 in game; changes apply at once and are saved to Mods\CollegeEducatedAutoEngineer\Settings.xml (written with the defaults on first start). Options without a control are edited in that file and need a game restart.

At start-up the mod checks that everything it patches is still in the game. Features whose targets are missing are switched off and the rest keep working; the result is one summary block in the game log (Player.log).

Compatibility

Built for Railroader 0.6.x (played on 0.6.3; still runs on 0.6.2). Patches the engineer's rollout controller commands, its target list, contextual target speed and start-up throttle, the planner's signal-sight distances, and (with Wheelslip Prototype) when Wheelslip's brake lock law runs. Other mods patching the same code may conflict. Officially supports Waypoint Queue; works with Wheelslip Prototype (optional). Disable it in the game's mod list to restore stock behaviour.

Known limits

Tested on steam-hauled freight up to 1-2% grades and on diesel freight on mostly level track (EMR 1000, 1200 and 9000, with and without sand). The slip guard learns each locomotive as it goes, so the first start after the engineer is switched on can still slip once. Diesel fuel use follows the game's own model, which burns nothing at idle. Fuel savings depend on the route and train.

About

Makes the auto-engineer drive like a person: a smooth throttle, early gentle braking for signals and speed limits, no creeping past stops, a stall guard on grades the train cannot climb, and optional realistic fuel use.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages