// Management · RimWorld Mod

Milira Race - Float Menu Fix

Milira Race - Float Menu Fix mod preview for RimWorld

Milira Race - Float Menu Fix About the General Float Menu Optimizer Float-menu slowdown may be caused by multiple mods at the same time.

Milira Race - Float Menu Fix

About the General Float Menu Optimizer

Float-menu slowdown may be caused by multiple mods at the same time. Installing one targeted fix may therefore not resolve every related performance problem in a large mod list. As of August 24, 2026, I have confirmed that the tested versions of the following mods may cause sustained FPS loss while a map float menu remains open:
  • MoeLotl: Rigor Mortis
  • Milira Race
  • Milira: Wings of Democracy
Float Menu Performance Optimizer includes these targeted fixes and provides Frame, Time, and Manual modes to reduce repeated menu-generation costs. New users are encouraged to use the general optimizer: https://steamcommunity.com/sharedfiles/filedetails/?id=3784467506 The standalone fix remains available for users who only need the Milira Race fix. If both are enabled, the standalone fix will not load duplicate patches. The integrated version will be handled by the general optimizer. Collection of related fixes and the general optimizer: https://steamcommunity.com/sharedfiles/filedetails/?id=3784994455 Float-menu performance monitoring tool: https://steamcommunity.com/sharedfiles/filedetails/?id=3783963046

The Problem

Testing found that Milira Race's solar-fuel WorkGiver could perform expensive checks on ordinary items, cells, and storage buildings during map float-menu generation and revalidation. The problem usually becomes more noticeable when more Things occupy the clicked cell. Storage mods may amplify the slowdown, but they are not the root cause.

Let the Game Run Before Testing

The general optimizer and targeted fixes take effect immediately after loading and do not write any additional fix state into the save. However, the original float-menu performance problem may not appear immediately after loading a save while the game is still paused. Some related work checks are activated only after game ticks advance and pawn jobs, reservations, building comps, or map components update their state. Before comparing performance, let the game run unpaused for a while, then compare the menu-closed and menu-open states. A lack of slowdown immediately after loading a save while paused does not prove that the problem is absent or that the fix has no effect.

Main Fixes

1. Prefilter unrelated solar-fuel targets Milira_EmptySunLightFuelContainer could perform a map scan when right-clicking ordinary items, cells, or storage buildings. The fix allows only buildings with the solar-fuel generator component to enter the original logic. Unrelated targets are skipped immediately. 2. Avoid repeated expensive searches for valid buildings When generating a float menu for a Solar Energy Conversion Collection Tower containing output, the original work checks could repeatedly search for storage. This patch skips the unnecessary global ShouldSkip scan only while evaluating a valid tower from the float menu and briefly caches the final menu result. Building and output states are still checked, and normal extraction remains unchanged. Normal AI work scanning does not use this float-menu-specific optimization.

Current Test Results

The comparison was measured with Float Menu Performance Monitor. The general optimization mode was Disabled, while other fix settings remained unchanged. During one complete float-menu generation in the same test scenario:
  • Without the Milira Race fix: Milira_EmptySunLightFuelContainer used approximately 13.8–16.7 ms.
  • With the fix: the WorkGiver no longer appeared among the main performance hotspots.
  • Total menu-generation time: approximately 47.3–51.9 ms → approximately 37.5 ms.
These values measure execution time inside the float-menu code path, not FPS directly. They demonstrate the mechanism of the fix and do not guarantee the same improvement on every device, save, or mod list.

Compatibility and Saves

This Harmony patch adds target prefiltering and brief result caching. It does not modify Milira Race files, normal AI work scanning, or save data. It should be safe in theory to add or remove from an existing save. Fully restart RimWorld after changing the mod list and keep normal backups of important saves. This patch targets Milira Race only. Wings of Democracy and Milira Imperium require separate fixes. When used with Float Menu Performance Optimizer, the general optimizer handles its integrated version while the standalone fix stops loading its own DLL. The patches are not applied twice.

Monitoring and Reports

To profile the original unoptimized behavior, open the general optimizer settings and: 1. Set the general optimization mode to Disabled. 2. Disable the relevant entry under the integrated fix settings. Disabling only the general optimization mode does not disable the integrated targeted fixes. You may send the monitoring results and Player.log to an AI for analysis, or send them to me. I may review and respond to reports from time to time.

Development Notes

OpenAI Codex assisted with investigating the call chain, diagnosing the problem, and writing the patch. In-game functionality and performance results were verified through actual A/B testing by the author.