Simulation Flow Unleashed: A Reworked Simulation Lag Fix
Description
9th October Update: I accidentally swapped the lower and upper bounds of a parameter, so this update only corrects that mistake. There are no other changes to the mod. Sorry for the oversight and any inconvenience caused.
📢 v2.3 is officially released!
This update adds pressure control, an autonomy wait guard, status checks, and measurement recording, and improves activation after loading a lot.
⚙️ The bundled CFG now uses a lower, more conservative autonomy timeline execution threshold. You can still adjust it based on your gameplay results.
🔍 Not sure how to adjust the settings? See SFU Settings and Measurement Guide on Patreon.
🎯 What is SFU?
Simulation Flow Unleashed (SFU) is a rework of Simulation Lag Fix that aims to reduce idle Sims, sluggish autonomy, and some simulation delays on crowded lots.
It moves autonomy request processing onto a separate timeline. The main simulation completes its current update first, then the time taken determines whether autonomy work can run. The two timelines still run sequentially. This does not create another CPU thread or run them simultaneously.
The Simulation Lag Fix version I used as a reference fixes the main simulation time slice at 17 ms and runs the autonomy timeline only when the main update takes less than approximately 17 ms. SFU makes these settings configurable through the CFG and gives the autonomy timeline its own time budget. The values bundled with v2.3 are 33 / 25 / 33, in that order.
SFU lets players choose settings that suit their hardware, save, and gameplay. It offers another option, but cannot guarantee that every save will run faster or resolve every failed interaction, routing problem, or stuck object.
📂 Installation and updating
-
Remove the old SFU script and CFG you are replacing, along with any older autonomy tuning package you no longer intend to use.
-
Place the v2.3 .ts4script and bundled CFG in the same folder. Script mods must be placed no more than one subfolder deep inside Mods.
-
The autonomy tuning package is optional. If you want to use it, install the version corresponding to v2.3. Installing the package alone does not create an autonomy timeline.
-
Enable “Custom Content and Mods” and “Script Mods Allowed” in the game options, then restart the game.
-
After loading a save, enter sfu.status to check the state and settings.
Install only one SFU version at a time, and do not use it alongside another Simulation Lag Fix mod. Keep only one SFU CFG in the same folder.
⚙️ Settings and adjustments
The settings bundled with v2.3 are:
[SimulationFlowUnleashed]
main_time_slice_ms = 33
update_threshold_ms = 25
autonomy_time_slice_ms = 33
autonomy_timeline_enabled = true
autonomy_wait_guard_enabled = true
loop_cap_enabled = true
autonomy_service_loop_cap_ms = 50
The three main values control:
- main_time_slice_ms: the time budget used each time the main simulation timeline advances.
- update_threshold_ms: when the main update takes less than this value, the autonomy timeline is normally allowed to run once.
- autonomy_time_slice_ms: the time budget used when the autonomy timeline is allowed to run.
All three are measured in milliseconds (ms). The threshold and time budget are separate settings: a threshold of 25 ms does not mean the autonomy timeline can run for only 25 ms.
For explanations of every setting, their valid ranges, and the full comparison procedure, see the Patreon settings guide.
🛡️ Safeguards and adjustments in v2.3
- Pressure control: at normal game speed, when the main simulation remains behind and autonomy work is still pending, SFU temporarily caps the processing budget of newly started autonomy requests. The cap is released after the load decreases and remains stable for a while.
- Autonomy wait guard: at normal game speed, autonomy work that has gone roughly two seconds without an execution opportunity can receive a small processing opportunity with a 5 ms budget. This does not bypass loading or startup protection.
- Autonomy retry interval: the optional package changes the wait for some autonomy retries to 0.3–0.7 game minutes when no primary interaction meets the game's criteria, to reduce repeated attempts that make no progress. This is not an extra wait after every action.
- Activation after loading: SFU enters normal scheduling only after confirming that the current lot has loaded and passing the initial stability checks. Sims may briefly be less active just after entering a lot.
These time budgets are not hard limits that forcibly interrupt work. Actual processing can exceed the configured values.
Lot 51 Core Library is not required. When installed, SFU uses its lot loading completion event, reducing overlap with other mods that wrap the same Zone method. Without it, SFU uses the game's loading completion callback.
If Lot 51 is detected but cannot be imported or its event cannot be registered, SFU disables its autonomy functionality and produces a report. If a valid event for the current lot has not yet arrived, SFU continues waiting.
🔍 Checking status and recording measurements
Press Ctrl + Shift + C to open the console:
- sfu.status: shows the current mode, activation state, settings, current main simulation delay, and recording status.
- sfu.log: starts a recording. Enter it again to stop and save the report.
Reports are saved in the folder containing the .ts4script file. Each recording uses a different filename. During a recording, reports are saved approximately every 60 seconds. Returning to the main menu or exiting normally also saves them. A crash may lose unsaved data.
Reports group results by game speed and include:
- Median and P95 main simulation delay: how far the main timeline is behind the game clock, measured in ticks. This is not milliseconds or the wait time for an individual command. P95 means approximately 95% of eligible samples are at or below the displayed value or range upper bound.
- Autonomy timeline execution rate: the percentage of eligible updates in which the SFU autonomy timeline ran. This is not a Sim action success rate, and higher is not necessarily better.
Loading, startup protection, paused updates, and updates in which the game clock does not advance are excluded from the statistics.
Setting autonomy_timeline_enabled to false keeps autonomy work in the game's normal simulation system while leaving status checks and recording available. This disables only SFU's script scheduling and controls. The package and other mods remain active, and the autonomy execution rate displays N/A.
For comparisons, use the same starting save, scene, speed, other mods, warm-up period, and recording duration. Consider both the measurements and actual Sim responsiveness. Lower main simulation delay alone does not establish that gameplay is better.
⚠️ Compatibility and limitations
Additional autonomy processing still uses CPU time and may cause more stuttering on hardware or lots that are already struggling. Pressure control and the autonomy wait guard currently operate only at normal game speed.
The optional package modifies autonomy.autonomy_modes. Avoid using it alongside other mods that override the same tuning, such as:
- Zero's Faster Autonomy and Less Idle.
- tyjokr's Less Frequent Idles.
- Coolspear's Quicker Autonomy and Simulation Lag Improvement.
I have tested SFU alongside tyjokr's Queue Guard and TURBODRIVER's Simulation Timeline Unclogger, and players have also shared positive feedback. They address different problems and are not required dependencies. Results can still vary between versions and saves.
📝 Errors and feedback
SFU may generate disabled, configuration warning, or runtime error reports. Keep these reports and use sfu.status to check the current state. If the CFG cannot be read, multiple CFG files are found, or the autonomy toggle is invalid at startup, SFU leaves its autonomy functionality disabled. After correcting the issue, fully restart the game.
You are welcome to report issues in the comments or the Discord reporting channel. Please include:
- Your game and SFU versions, CFG, and sfu.status output.
- SFU reports and LastException, if available.
- The lot where the issue occurred, what the Sims were doing, and whether it still happens after removing SFU.
SFU appearing in a traceback does not necessarily mean it caused the error, but it does not rule out its involvement either. The circumstances and comparison tests are still needed to judge the cause.
📖 Want to learn more?
For v2.3's design considerations, test results, and the reasons behind its adjustments, see my Patreon development notes. You can also find earlier testing with MCCC's Game Time Speed setting there.
🤝 Credits
First, thank you to simmythesim for the original concept behind Simulation Lag Fix. The core idea of processing autonomy work on a separate timeline was not my invention.
SFU is based on the Simulation Lag Fix source code provided by Xerox. Thank you to Xerox for subsequent maintenance, and to SrslySims for maintaining the version used by the community. I first encountered one of those later maintained versions. Using it led me to study the mechanism more deeply and develop SFU. Thank you also to SrslySims for taking an interest in SFU and recommending it.
Some autonomy weighting settings were inspired by Zero's Faster Autonomy and Less Idle. The direction of my adjustments to FULL_AUTONOMY_STATISTIC_SCORE_VARIANCE was inspired by Coolspear's Quicker Sim Autonomy & Simulation Lag Improvements, after which I chose settings based on my own testing.
Thank you to Lot 51 for Core Library's event system, which allows SFU to activate through a lot loading completion event. Thank you also to tyjokr and TURBODRIVER for works such as Queue Guard and Simulation Timeline Unclogger, which have given me more tools for playing and testing mod combinations.
Finally, thank you to all the players who have shared error reports, gameplay feedback, and test results. You have shown me situations I might not encounter in my own game and helped me keep reconsidering SFU's design.
I hope SFU makes your game a little smoother. :)
Thank you for reading. I hope SFU makes your game a little smoother. :)
🍵 Enjoyed AveryPing's Sims 4 mods?
👉 Click here to treat me to a cup of nice tea! 🍵
-----------------------------------------------------------
📢 v2.3正式版已發布!
這次加入高負載保護、自主等待保護,以及狀態查詢與測量功能,並改善地段讀取後的啟動方式。
⚙️ 隨附CFG的自主時間軸執行門檻已調低,採用較保守的預設值。你仍可依實際遊玩表現調整。
🔍 不知道如何調整?請看Patreon上的SFU設定與測量教學
🎯 SFU是什麼?
Simulation Flow Unleashed(SFU)是以Simulation Lag Fix為基礎重新調整的模組,希望改善人物發呆、自主反應遲鈍,以及地段人數較多時的部分模擬延遲。
它將自主請求的處理移到另一條時間軸,先讓主模擬完成當次更新,再依耗時決定是否執行自主工作。兩條時間軸仍然依序執行,不會增加CPU執行緒,也不會同時運作。
我參考的Simulation Lag Fix版本,將主模擬時間片固定為17ms,並在主更新耗時低於約17ms時,才執行自主時間軸。SFU將這些設定改為可透過CFG調整,並將自主時間軸的時間預算獨立設定。v2.3隨附值依序為33/25/33。
SFU希望讓玩家依設備、存檔與遊玩情況選擇適合的設定。它是另一種選擇,並不能保證每個存檔都更快,也無法解決所有互動失敗、尋路或物件卡住的問題。
📂 安裝與更新
-
移除要替換的舊版SFU腳本與CFG,以及不再使用的舊版自主調校package。
-
將v2.3的.ts4script與隨附CFG放在同一個資料夾。腳本模組在Mods中最多只能放進一層子資料夾。
-
自主調校package為選用項目。若要使用,請安裝對應v2.3的版本;只安裝package不會建立自主時間軸。
-
在遊戲選項啟用「自訂內容與模組」及「允許腳本模組」,重新啟動遊戲。
-
進入存檔後,輸入sfu.status確認狀態與設定。
一次只安裝一個SFU版本,請勿同時使用其他Simulation Lag Fix模組。同一資料夾中也請只保留一份SFU CFG。
⚙️ 設定與調整
v2.3隨附設定如下:
[SimulationFlowUnleashed]
main_time_slice_ms = 33
update_threshold_ms = 25
autonomy_time_slice_ms = 33
autonomy_timeline_enabled = true
autonomy_wait_guard_enabled = true
loop_cap_enabled = true
autonomy_service_loop_cap_ms = 50
三個主要數值的用途:
- main_time_slice_ms:主模擬時間軸每次推進的時間預算。
- update_threshold_ms:主更新耗時低於此值時,允許正常執行一次自主時間軸。
- autonomy_time_slice_ms:自主時間軸獲准執行時的時間預算。
單位都是毫秒(ms)。門檻與時間預算是不同的設定:25ms的門檻不代表自主時間軸只能執行25ms。
如果想調整,可以先從update_threshold_ms著手。在我的測試中,25–40ms是較平衡的範圍。提高門檻會增加自主工作的執行機會,但也可能增加主模擬負擔;數值越高,不代表效果越好。
請一次只改一項,留意人物反應、動作是否更容易中斷,以及遊戲是否更不順。也可以使用下方的測量功能,比較調整前後的差異。
一般時間預算與保護設定修改後,可回主選單再載入存檔套用;修改autonomy_timeline_enabled則需要完全關閉並重新啟動遊戲。請用sfu.status確認實際載入的設定。
各項設定的用途、可調整範圍與完整比較步驟,請見頁面開頭的Patreon設定教學。
🛡️ v2.3的保護與調整
- 高負載保護:正常速度下,主模擬持續落後且仍有自主工作等待時,暫時限制新開始處理的自主請求所使用的時間預算;負載降低並穩定一段時間後解除。
- 自主等待保護:正常速度下,自主工作約兩秒未獲得執行機會時,可獲得一次5ms的小額處理機會。這不會跳過讀取與啟動保護。
- 自主重試間隔:選用package將沒有符合遊戲判定的主要互動時,部分自主重試的等待調為0.3–0.7遊戲分鐘,減少反覆嘗試卻沒有進展的情況。並非每個動作結束後都要額外等待。
- 讀取後啟動:確認目前地段讀取完成,並通過初期穩定檢查後,才進入正常排程。剛進入地段時,人物可能短暫較不積極。
這些時間預算並非強制中斷工作的硬性上限,實際處理可能超過設定值。
Lot 51 Core Library並非必要。有安裝時,SFU使用其地段讀取完成事件,減少與其他模組包裝同一個Zone方法的重疊;沒有安裝時,則使用遊戲的讀取完成回呼。
若偵測到Lot 51,但匯入或事件註冊失敗,SFU會停用自主功能並產生報告。若尚未收到目前地段的有效事件,則會繼續等待。
🔍 查看狀態與記錄數據
按Ctrl + Shift + C開啟控制台:
- sfu.status:查看目前模式、啟動狀態、設定、主模擬延遲與記錄狀態。
- sfu.log:開始記錄;再次輸入即可停止並儲存報告。
報告儲存在.ts4script所在資料夾,每次記錄使用不同檔名。記錄期間約每60秒儲存一次,回主選單或正常退出遊戲也會儲存;當機可能遺失尚未儲存的資料。
報告依遊戲速度分組,包含:
- 主模擬延遲的中位數與P95:主時間軸落後遊戲時鐘的程度,單位為ticks,並非毫秒或個別指令的等待時間。P95表示約95%的有效樣本不高於該數值或顯示的區間上限。
- 自主時間軸執行比例:有效更新中,SFU自主時間軸實際執行的比例。這不是人物動作成功率,也不是越高越好。
讀取、啟動保護、暫停與遊戲時鐘未前進的更新不納入統計。
將autonomy_timeline_enabled設為false,可在保留查詢與記錄功能的情況下,讓自主工作回到遊戲原本的模擬系統。這只關閉SFU的腳本排程與控制,package和其他模組仍然有效;自主執行比例會顯示N/A。
比較時,請使用相同起始存檔、場景、速度與其他模組,並採用相同暖機及記錄時間。同時觀察數據與人物實際反應,不能只靠較低的主模擬延遲判斷效果。
⚠️ 相容性與限制
額外的自主處理仍會使用CPU時間,在原本就吃力的設備或地段上,可能增加卡頓。高負載保護與自主等待保護目前只在正常遊戲速度下運作。
選用package修改autonomy.autonomy_modes,請避免與覆寫相同調校的模組同時使用,例如:
- Zero的Faster Autonomy and Less Idle。
- tyjokr的Less Frequent Idles。
- Coolspear的Quicker Autonomy and Simulation Lag Improvement。
我曾搭配tyjokr的Queue Guard與TURBODRIVER的Simulation Timeline Unclogger測試,也收到玩家的正面回饋。它們處理不同問題,並非必要依賴,效果仍會因版本與存檔而異。
📝 錯誤與回報
SFU可能產生停用、設定警告或執行錯誤報告。請保留報告,並使用sfu.status確認目前狀態。若啟動時CFG無法讀取、出現多份CFG,或自主開關設定無效,SFU會保持自主功能關閉;修正後請完全重新啟動遊戲。
歡迎在留言區或Discord回報頻道提供:
- 遊戲與SFU版本、CFG、sfu.status結果。
- SFU報告,以及可取得的LastException。
- 發生問題的地段、人物當時的行為,以及移除SFU後是否仍會發生。
SFU出現在錯誤堆疊中,不一定代表它是原因,也不能據此排除它的影響,仍需依實際情況與比較測試判斷。
📖 想了解更多?
v2.3的設計考量、測試結果與各項調整的理由,請見我的Patreon開發紀錄。其中也有先前與MCCC時間速度設定搭配的測試說明。
🤝 Credits
首先,感謝simmythesim提出Simulation Lag Fix的原始概念。將自主工作移到獨立時間軸的核心想法,並非我的發明。
SFU以Xerox提供的Simulation Lag Fix原始碼為基礎。感謝Xerox的後續維護,也感謝SrslySims維護社群使用的版本。我最初接觸的就是後續維護版本,使用後才開始深入研究這個機制,並發展出SFU。也謝謝SrslySims關注並推薦SFU。
部分自主權重設定受到Zero的Faster Autonomy and Less Idle啟發;FULL_AUTONOMY_STATISTIC_SCORE_VARIANCE的調整方向,則受到Coolspear的Quicker Sim Autonomy & Simulation Lag Improvements啟發,之後再依自己的測試選擇設定值。
感謝Lot 51提供Core Library的事件系統,讓SFU能透過地段讀取完成事件啟動。也感謝tyjokr與TURBODRIVER的Queue Guard、Simulation Timeline Unclogger等作品,讓我在遊玩與測試模組組合時有更多工具可用。
最後,謝謝所有提供錯誤報告、遊玩回饋與測試結果的玩家。你們讓我看見自己的遊戲中未必會遇到的情況,也幫助我持續重新檢視SFU的設計。
希望SFU能讓你的遊戲順暢一些。:)