CE Turret Performance Patch

If you liked this item, please rate it up on Steam Workshop page.

Author: Fixer

Last revision: 8 Jun at 20:35 UTC

File size: 50.38 KB

On Steam Workshop

Description:
Throttle target searching for Combat Extended turrets[/

In vanilla RimWorld, turrets scan for targets every single tick. With Combat Extended, this becomes extremely expensive in colonies with many turrets especially during sieges where turrets track idle mechanoids through

This mod adds a lightweight throttling cache to Building_TurretGunCE.TryFindNewTarget(), reducing CPU load by ~30× when turrets are idle or no valid targets are in

Before / After

Profiled during a siege with 12+ mechanoids and 20+ CE turrets:

• FindAttackTargetForRangedAttack CPU load: 10.5% → 0.6% (~30× fewer calls)
• TPS at 3× speed: ~100 → ~150–250 (up to 2.5× improvement)
• Turret target scanning: every tick → once per 30 ticks (0.5 sec)

Actual results depend on colony size, turret count and raid intensity.

Similar Mods
  • Turret Performance Tweaks vanilla-only, does nothing for Combat Extended turrets.
  • FPS Stabilizer reduces rendering load, good companion for CPU-bound colonies.
  • Performance – Slower Pawn Tick Rate throttles non-player pawns, improves TPS.
  • RuntimeGC / RocketMan general-purpose colony optimizers (garbage collection, think nodes, pathing).

How it works

• Turrets skip expensive target scans for 30 ticks (0.5 sec at 1× speed) if the last scan found nothing.
• Forced targets are never delayed manual override always works instantly.
• Warmup, cooldown, rotation and shooting logic remain untouched.
• Fully savesafe and can be added / removed mid-game.

Compatibility

• Requires Harmony and Combat Extended.
• Works with all CE turret sub-classes (Building_TurretGunCE, Building_CIWS_CE, etc.).
• Patches the virtual TryFindNewTarget() method, so any mod inheriting from CE turrets also benefits.