REPOPathfinder
Draws a dot trail on the floor to the current extraction point, or to the truck when every extraction is done. F4 trail on/off, F5 extraction or truck, F6 panel for color, size, speed and spacing. Client-side.A BepInEx plugin for R.E.P.O. that draws a dot trail on the floor along the walkable path to the current extraction point, or back to the truck once every extraction is done. It reads the same game state the dots on the in-game map follow, and draws the route in the world so you can follow it without opening the map.
Hotkeys (configurable, all default to F-keys):
- F4 — toggle the trail on / off.
- F5 — switch the destination between Auto (current extraction, or the truck when all are complete) and Truck (always the truck, for going back to charge items mid-run). The choice is saved.
- F6 — open the customization panel: RGBA color sliders, hex input, color presets, and live sliders for dot size / flow speed / spacing. Esc or F6 closes it. Changes are saved to the BepInEx config.
While you are dead, the trail starts from the player you are spectating.
What the DLL actually does
On plugin Awake(), it:
- Reads its config. A standard BepInEx config file (
BepInEx/config/isaia.repopathfinder.cfg) defines all hotkeys, dot visuals, animation tunables, and the path-recompute threshold. A[Internal] ConfigVersionkey migrates stale defaults from prior versions in place — values that exactly match a previous default get overwritten with the current default; user-customized values are left alone. The file is written once at startup and once each time the F6 panel closes. - Binds the game fields it reads. If the three the trail cannot work without are missing (a game update renamed them), one error line names them, the trail stays off, and F4 shows "needs an update for this game version".
- Creates a
DontDestroyOnLoadGameObject. Adds twoMonoBehaviours to it:PathfinderManager(path / animation / rendering) andPathfinderCustomizeUI(the F6 IMGUI overlay).
It installs no Harmony patches. If drawing the trail throws, the error is logged once; after 5 failed frames in a row the trail turns itself off until you press F4 again.
Path computation
The path is cached in world space, not recomputed every frame:
-
Target. Truck mode:
LevelGenerator.LevelPathTruck. Auto mode:RoundDirector.extractionPointCurrent, or the truck onceRoundDirector.allExtractionPointsCompletedis set. The target point is moved onto the NavMesh (up to 4 m) before the search. -
Start.
PlayerAvatar.LastNavmeshPosition; if that is more than 10 m from the player (stale), the player's own position moved onto the NavMesh. While dead: the spectated player's position, or no trail when nobody is being spectated. -
Recompute trigger. A new path is computed only when:
- There is no cached path yet,
- The target changed (different extraction, Auto↔Truck, or a new level), or
- The player has drifted further than
OffPathRecomputeThresholdMeters(default3.0) from the cached polyline.
Searches are at least 0.2 s apart, and 0.75 s apart after one that found nothing.
-
Compute & cache.
NavMesh.CalculatePathis called once. The corners and prefix arc-distances are stored; the displayed dots reference these stable world-space points for as long as the cache lives. When only a partial route exists, the trail shows it and a short notice says so. Each new target logs one line (Path to <name>: <status>, <n> corners, <m> m.). -
Each frame. The player is projected onto the cached polyline to produce a
playerArcscalar; that's the trail's "back end". Walking forward changes onlyplayerArc; the cached corners are untouched, so dot world positions stay stable regardless of how the player moves.
Animation & rendering
- A pool of
MaxDots(default 30) sphere primitives, colliders stripped, sharing one material with per-dot color set viaMaterialPropertyBlock. - A single shared
_animOffset∈ [0, spacing) advances byFlowSpeedm/s. When it crossesspacingthe circular pool pointer_frontPooldecrements, which makes every sphere's slot index increment by 1 simultaneously. Spacing stays perfectly even regardless of howavailableLength = totalLength - playerArcchanges. - The single sphere whose slot wraps from
MaxDots-1to0per cycle has its smoothing flag cleared in the same step, so it snaps to its new position at the player end of the trail instead of being lerped across the room. - World position per dot:
CachedPointAtDistance(playerArc + slot*spacing + animOffset), plusGroundOffseton Y. The result is exponentially smoothed toward the displayed position with ratePositionSmoothRate(default251/s) for the rare cases where the path is re-cached. - Alpha fade per dot:
min(SmoothStep(0..fadeZone, d), SmoothStep(0..fadeZone, endpoint-d))whered = slot*spacing + animOffset,endpoint = min(availableLength, activeCount*spacing)andfadeZone = max(0.05, min(spacing, endpoint/2) * FadeZoneFraction). Hides the wrap and the path's own ends behind alpha-0 transitions. - The material's shader is the first of
Sprites/Default,Unlit/Color,Hidden/Internal-Colored,Standardthat the game build contains (a warning is logged if none is)._ZWrite0 andSrcAlpha/OneMinusSrcAlphablend are set if the chosen shader exposes those properties; render queue is3500.
Customization UI
PathfinderCustomizeUI (default F6) is a draggable GUILayout.Window:
- RGBA sliders (0–255 readout),
#RRGGBBAAtext field with Apply, preview swatch over a white underlay so transparency is obvious, eight color presets. - Sliders for
DotScale,FlowSpeedMetersPerSec,SpacingMeters. - Reset Visuals writes each of the above ConfigEntries back to its
DefaultValue. Close, F6 or Esc dismisses the panel. - Edits go straight to the BepInEx ConfigEntries, so the dots in the world update while you drag. The config file itself is written when the panel closes.
- While the panel is open the game's controls are held still with the game's own switches (
InputManager.DisableMovement,DisableAiming,DisableControlsExcept) and the cursor is freed withCursorManager.Unlock, the same calls the game's menus use. You cannot walk, look, grab or open the pause menu until it closes; push-to-talk keeps working. The hold lasts a quarter of a second past the last frame the panel was open, so the click or key that closed it does not reach the game.
Install
Install with a mod manager, or by hand: drop REPOPathfinder.dll into <profile>/BepInEx/plugins/REPOPathfinder/. Requires BepInEx-BepInExPack.
Compatibility
- Checked against R.E.P.O. v0.5.3 (Unity 6) with BepInEx 5.4.23.
- Client-side. The plugin is purely local: it reads
PlayerController.instance.playerAvatarScript,RoundDirector.instance,LevelGenerator.InstanceandSpectateCamera.instanceto compute its own path and renders its own GameObjects. No RPCs, no Photon traffic. Each player can install independently; nothing about the plugin requires the host or other clients to have it. - No Harmony patches. The game's
internalfields are read through typed accessors; nothing in the game or in Unity is patched. The F6 panel uses the game's public input and cursor switches, so it does not conflict with mods that patch input. - No NavMesh modifications. The plugin calls
NavMesh.CalculatePathfor itself; it does not bake or alter the game's NavMesh.
Changelog
0.7.3
- Checked against the current game (R.E.P.O. v0.5.3, Unity 6).
- The F6 panel now holds the game's controls with the game's own input switches: no walking, looking, grabbing or pause menu while it is open, and Esc closes it. The Unity input patches from 0.7.2 are gone; the plugin no longer patches anything.
- While you are dead, the trail starts from the player you are spectating.
- When no full route exists, the trail shows the closest one and says so. The target is moved onto the walkable area, so an extraction point slightly off the NavMesh still gets a trail.
- The cached route is dropped when the level changes, and lowering
MaxDotshides the extra dots straight away. - If a game update removes something the plugin reads, the log names it and F4 says the mod needs an update. Repeated errors turn the trail off instead of logging every frame.
- The config file is written once at startup and when the panel closes. Six trail settings now have ranges.
Every version is in CHANGELOG.md.
Credits
REPOPathfinder is built by two developers:
- Mentalize (IsaiahAnson), co-developer
- Pez (KaydenceComalander), co-developer and tester.
The Thunderstore release is published under their shared handle, MentalizePez.
