You are viewing a potentially older version of this package.
View all versions.
PathfindingLagFix Beta
Improves performance of Lethal Company AI to increase frame rates. BETA VERSION. MAY CAUSE CRASHES.
Date uploaded | 11 hours ago |
Version | 2.0.4 |
Download link | Zaggy1024-PathfindingLagFix_Beta-2.0.4.zip |
Downloads | 619 |
Dependency string | Zaggy1024-PathfindingLagFix_Beta-2.0.4 |
This mod requires the following mods to function
BepInEx-BepInExPack
BepInEx pack for Mono Unity games. Preconfigured and ready to use.
Preferred version: 5.4.2100README
PathfindingLagFix
Moves long-running pathfinding tasks off the main thread to improve frame rates significantly, especially for hosts.
Most patches must be tailored to each AI, so this will not affect modded enemies in most cases.
Frametime graph comparisons:
Before/After on March with late night spawns:
Patches
The enemy behaviors currently patched to run their pathfinding off the main thread include:
- General enemies:
- The roaming search patterns used by many enemies (thumpers, hoarding bugs, jesters, etc), including any modded enemies that use this vanilla functionality
- The checks for valid paths to players to be targeted
- Bracken:
- The search for a hiding spot away from the main entrance when no players are targetable
- The search for a hiding spot away from a player when it is spotted
- The pathing towards the player out of line of sight when it is hunting
- Snare flea:
- The search for a hiding spot at a certain number of paths away from main when no players are present
- The search for a hiding spot near a player when they are targetable
- Spore lizard:
- The search for a hiding spot away from a player when it is spotted
- Manticoil:
- The search for a node to fly to when it is disturbed by a player at close range
- More to come!
CHANGELOG
Version 2.0.4 (Beta)
- Added a patch to prevent stutters when enemies are trying to target players in large lobbies.
- Removed the crash warning from the readme, as 2.0.3 appears to have remained stable.
Version 2.0.3 (Beta)
- Added a workaround to prevent crashes that would occur when the navmesh is modified while pathfinding jobs are running.
Version 2.0.2 (Beta)
- Added a warning to the readme and description about potential crashes.
Version 2.0.1 (Beta)
- Modified threaded code in an effort to prevent crashes. The crashes are extremely rare, so these fixes are unconfirmed, and crashes may still be present.
- Fixed some issues that may cause unintended inconsistencies in pathfinding versus the vanilla code.
Version 2.0.0 (Beta)
- Rewrote the mod to run any pathfinding patches off the main thread via Unity Jobs, reducing the performance impact to near zero.
- Patches have been completely rewritten and now include:
- All roaming AI
- Bracken hunting, evasion, and hiding spot pathfinding
- Snare flea hiding spot pathfinding
- Spore lizard evasion pathfinding
- Manticoil evasion pathfinding
Version 1.4.0
- Brought back the patch for lag caused when the Bracken has no player target and is therefore pathing to the furthest position from the interior entrance. This would often occur when the player jumps.
Version 1.3.1
- Updated mod icon and Thunderstore summary.
Version 1.3.0
- Updated to support v60/v61, removing patches for the Bracken and Spore Lizard now that vanilla uses an async method for those AI.
Version 1.2.1
- Removed some debug spam that would happen while a Snare Flea is retreating with no target players.
Version 1.2.0
- Prevent stutters caused by Snare Fleas finding a far location when there are no players to target.
- This pathfinding would always happen if a Snare Flea spawned while no players are within the building.
- More often in normal gameplay, it would occur if the Snare Flea fell off the playable area, since this would make all players untargetable, as well as make the search for a far location eventually fail.
- NOTE: This may not cover all cases of lag caused by Snare Fleas. When they are running from a kill, they look for the nearest location that is accessible out of line of sight. If all line of sight checks fail, there may be stutters.
Version 1.1.0
- Fixed stutters that would happen when Spore Lizards run from the player.
Version 1.0.1
- Removed printing of the FlowermanAI.DoAIInterval() bytecode.
Version 1.0.0
- Fixed stutters that could occur when Brackens are retreating.
- Fixed stutters that always occur when Brackens spawn outside or are not on the nav mesh.