railroader-setons-special-s.../README.md
seton edf6a8a14e Map Module 0.2.5: icon culling, EOTD, gear menu icons, font fix
Icon culling hides car icons when zoomed out past a configurable threshold
(default 40%), keeping only locomotive icons visible. Locos scale up
automatically when culling is active (configurable boost). An option also
hides MU trailing units. All managed by the new MapIconCuller class with
smooth fade transitions.

EOTD (End-of-Train Device): a blinking red dot at the rear of each consist.
Shown by default when car icons are hidden. Dot size and visibility conditions
are configurable. Implemented in EotdSystem as a programmatically generated
circle texture to avoid asset dependencies.

Added an Icons submenu to the gear menu containing all icon and EOTD settings.
Controls grey out to reflect dependencies: culling sub-settings (MU hide, loco
boost, EOTD) grey out when culling is off; EOTD dot size and hide-when-visible
grey out when EOTD is off. Changes round-trip via UICmd events, persist to
PopoutSettings, and call MapIconCuller.Refresh(). Native state is seeded from
C# on window init via RRPOPOUT_SetIconCullingState.

Settings completeness: added Right-click recenters toggle and Map BG opacity
slider to the UMM settings panel (were only accessible from the gear menu).

Replaced four FindObjectOfType<MapWindow> calls with PanelFinder.GetMapWindow().

Fixed AV false-positive on release zips: ImGui's built-in font blob contained
the substring "UPX", matching the heuristic for UPX-packed binaries. Added
IMGUI_DISABLE_DEFAULT_FONT to strip the blob; ProggyClean.ttf is now shipped
as a separate file alongside the DLL and loaded at runtime instead.
2026-06-22 18:46:12 -04:00

161 lines
9.4 KiB
Markdown

# S³ - Seton's Special Sauce
<p align="center"><img src="S3 Logo - clean.png" width="480" alt="S3 - Seton's Special Sauce"></p>
An umbrella "everything mod" for [Railroader](https://store.steampowered.com/app/1638770/Railroader/),
built on [Unity Mod Manager](https://www.nexusmods.com/site/mods/21).
S³ is a thin core that hosts independent, optional **modules**, each disabled by
default. Open the S³ settings page in the UMM in-game menu and expand a module's
foldout to enable and configure it. Module enable/disable applies on the next
game launch.
I originally planned on releasing individual mods, but considering my workflow of just making what I want when I want it, I figured a unified platform for all my tweaks and additions would be more convenient for myself (one repo to manage) and the community.
## Modules
| Module | What it does |
|---|---|
| Physics Optimizer | Cuts CPU spent on train physics (LOD fast-path + auto-freeze), with a profiler overlay and debug car tinting. Console: `/rpf` |
| Map Module | In-game map overlay and detachable popout window for a second monitor. Themes, custom colors, opacity controls, map rotation, and optional MapEnhancer integration. |
Both are disabled by default; enable them per-module from the S³ settings page. A game restart is required for enable/disable to take effect. More modules will follow; S³ is designed to grow.
---
## Map Module
Replaces the base-game map with a floating in-game overlay (toggle with **M** or your configured hotkey) and lets you pop it out into a detached resizable OS window for a second monitor. The toolbar, compass, and follow/jump menus are identical in both surfaces.
### Settings
Configure everything from the S³ UMM settings page: hotkey, drag-to-cancel follow behavior, right-click to recenter on player, theme, three independent opacity controls (Window, Map Elements, Map Background), icon culling and EOTD settings, the detach button, and a full per-element custom color editor.
Most settings are also reachable directly from the gear menu on the map toolbar without opening UMM.
![Map Module settings panel](img/map/map_settings_umm.png)
### Themes
Six themes built in: five named presets plus a **Custom** slot you tune with per-element hex input and live R/G/B/A sliders. Any preset can be copied into Custom as a starting point. Theme changes apply instantly without restarting.
<table>
<tr>
<td align="center"><img src="img/map/map_themes/s3-default.png" alt="S3 Dark"><br><b>S3 Dark</b> (default)</td>
<td align="center"><img src="img/map/map_themes/railroader.png" alt="Railroader Classic"><br><b>Railroader Classic</b></td>
<td align="center"><img src="img/map/map_themes/high-vis.png" alt="High Visibility"><br><b>High Visibility</b></td>
</tr>
<tr>
<td align="center"><img src="img/map/map_themes/red-night.png" alt="Night Mode"><br><b>Night Mode</b></td>
<td align="center"><img src="img/map/map_themes/retro_green.png" alt="Retro Terminal"><br><b>Retro Terminal</b></td>
<td align="center"><i>+ fully customizable</i></td>
</tr>
</table>
### Transparency
The in-game overlay has three independent opacity controls. **Window** sets the chrome opacity (toolbar, compass, and frame), with an automatic minimum of 50% while the mouse is over the overlay so the controls stay reachable at any setting. **Map Elements** fades the map image independently. **Map Background** controls how transparent the empty space behind terrain is - turn it down and the game world shows through where there is no map content.
<video src="https://git.farmtowntech.com/setonc/railroader-setons-special-sauce/raw/branch/main/img/map/map_opacity/opacity_controls.mp4" controls></video>
![Opacity controls settings panel](img/map/map_opacity/opacity_settings.png)
### Map Rotation
Rotate the map manually with the rotation control, or lock it to your player camera heading so it always faces the direction you're looking. Switch between free and locked at any time without losing your current view.
<video src="https://git.farmtowntech.com/setonc/railroader-setons-special-sauce/raw/branch/main/img/map/map_rotation/rotate_manual_and_player_locked.mp4" controls></video>
### Icon Controls
When zoomed out past a configurable threshold (default 40%), car icons are hidden and only locomotive icons remain. Locomotives scale up automatically so they stay easy to spot. A separate option hides MU trailing units, keeping just the lead locomotive per consist. A blinking red EOTD dot marks the rear of each consist, giving you a quick sense of train length without cluttering the map with car icons.
All of these options are available from the gear menu Icons submenu on the map toolbar, or from the S³ UMM settings page.
<video src="https://git.farmtowntech.com/setonc/railroader-setons-special-sauce/raw/branch/main/img/map/map_optimizations/hiding_cars_and_eotd_demo.mp4" controls></video>
![Icon controls settings](img/map/map_icons_config.png)
### Popout Window
Pop the map into a detached native OS window. Drag it to any monitor, resize it freely, and pin it always-on-top via the window's right-click title bar menu. Re-attach it back into the game overlay at any time from the settings panel without losing your position, zoom, or rotation.
<video src="https://git.farmtowntech.com/setonc/railroader-setons-special-sauce/raw/branch/main/img/map/map_popout/map_popout_reattach.mp4" controls></video>
![Always on Top option in the popout window title bar menu](img/map/map_popout/always_on_top.png)
### MapEnhancer Integration
S³ auto-detects any installed version of MapEnhancer at startup with no configuration required. If MapEnhancer is installed, the toolbar gear menu expands with follow controls and a settings panel. The **Follow** submenu lets you follow the player camera, the selected locomotive, or any consist picked from a live-updated list. **Jump to Location** is also available. The **Settings** panel gives you live control over all MapEnhancer rendering options without leaving the map: marker visibility toggles, scale sliders for flares, junctions, track lines, and crossings, and bulk switch reset buttons.
![MapEnhancer gear menu showing follow submenu and settings panel](img/map/map_enhancer_follow_mode.png)
Both the original official builds and the [community fork](https://github.com/Refizar08/rr-mapenhancer-fix) are supported. Features added by the community fork - turntable control, road crossing markers, passenger stop tracking, industry area colors, modded spawn points, and bulk switch reset - are grayed out when an older build is detected. All controls that the installed version supports remain fully functional.
<table>
<tr>
<td align="center"><img src="img/map/map_enhancer_full.png" alt="Community build - all features available"><br><b>Community build</b></td>
<td align="center"><img src="img/map/map_enhancer_grayedout.png" alt="Older official build - community features grayed out"><br><b>Older build - community features grayed</b></td>
</tr>
</table>
---
## Physics Optimizer
Reduces CPU time spent on train physics with two complementary strategies:
- **LOD Fast-Path**: cars beyond a configurable distance switch to dead-reckoning, skipping expensive 3D constraint updates. A staggered resync keeps them accurate without a sudden full-update spike.
- **Auto Freeze**: consists that are far away and nearly stopped skip the Verlet integration tick entirely, replacing the stock freeze heuristic with a tighter distance + speed threshold.
Locomotives can be excluded from either strategy. A console profiler overlay (`/rpf`) and debug car tinting (yellow = frozen, cyan = fast-path, magenta = full) let you verify the LOD and freeze behavior in your session.
### Settings
![Physics Optimizer settings](img/physics_optimizer/umm_settings.png)
### Performance
LOD fast-path and Auto Freeze together cut per-car physics cost from ~28.6 µs to ~10.5 µs (63% reduction) and FixedUpdate time from 6.7 ms to 3.8 ms on the same 156-car scene. Numbers from the built-in profiler overlay:
| Before | After |
|:---:|:---:|
| ![Profiler before, Physics Optimizer OFF](img/physics_optimizer/pofiler_before.png) | ![Profiler after, Physics Optimizer ON](img/physics_optimizer/profiler_after.png) |
| Physics Optimizer **OFF** (6.7 ms/frame) | Physics Optimizer **ON** (3.8 ms/frame) |
---
## Migrating from the standalone mods
S³ replaces the separate **Physics Optimizer** (`RailroaderPhysicsOverhaul`) and
**PopOut Windows** (`RRPopout`) mods. Uninstall those before installing S³.
Settings do not carry over, so re-configure each module from the S³ settings page.
If these mods are detected you will be prompted to disable them in the S³ settings page.
---
## Building
Requires the .NET SDK (`dotnet`). The native module additionally needs CMake +
the MSVC toolchain.
- **Local test install:** `.\dist\build-local.ps1` builds and copies into the
game's `Mods\S3\` folder.
- **Release zip:** `.\dist\build-release.ps1` produces
`dist\SetonsSpecialSauce-<version>.zip` for upload.
The game install path is set once in [`Directory.Build.props`](Directory.Build.props)
(`GameDir`); override per-build with `/p:GameDir=...` or the build script's
`-GameDir` parameter.
## Layout
```
src/ single managed assembly (S3.dll, netstandard2.1)
Main.cs UMM entry point
Core/ module framework: IModule, registry, settings, settings panel
Modules/ one folder per module
native/ shared Win32 + D3D11 + Dear ImGui external-window UI engine
dist/ build + packaging scripts
```