Simple plugin for Mod Organizer 2 that will optimize CPU affinity for Anomaly.exe to reduce stutters and may improve performance in CPU bound cases. It will force Anomaly to use only physical cores and avoid core 0 or E-cores.
This plugin is nothing more than automated version of manually setting your CPU affinity thorough task manager. It have some simple logic to optimally determine affinity for different CPUs.
This is NOT ultimate solution for stutters! Not every system will benefit from affinity optimization, but it cost nothing to try.
There are 2 versions of the script: Automatic and Manual
Anomaly is bad at multithreading and always sets it's main thread to core 0, which also is usually used by system processes or other applications. This potentially may lead to fighting for resources and cause stutters. This can be avoided by disabling CPU 0 affinity for Anomaly.exe, so game main thread will use other, less overloaded core.
The game can't recognize the virtual and physical cores when your CPU have Hyperthreading, so it will assign threads randomly, which may lead to overloading one core while others are idle. This plugin will make sure to assign only physical cores to the game.
Anomaly also can't differentiate P-cores and E-cores in newer Intel architectures, so it can assign game threads to less powerful E-cores. This plugin make sure that only P-cores are used by the game.
Currently we can do this by manually changing CPU affinity for Anomaly process, but it can be annoying because this operation requires many actions every time after the game is launched.
Alternatively we can use external program like Process Lasso, which can do it automatically but need to be running in the background all the time and will constantly monitor all of your system processes.
Mod Organizer 2 obviously.
The installation process is very simple:
If you don't know where is your ModOrganizer folder, click RMB on shortcut that launches ModOrganizer > "Open file location." There should be plugin folder.
After next Mod Organizer 2 launch, inside the puzzle dropdown menu, you should see "Anomaly CPU Affinity" field.
This is simple 3 clicks process:
This process need to be repeated every time you launch Anomaly!
To check if affinity is set correctly you have to open Task Manager, select "Details" tab, Right-click on Anomaly.exe and select "Set affinity". You can see there which cores are used by the application.
I provide no support for the Manual version. Use it only if you know what are you doing.
Average
9.245 votes submitted.
Mod Organizer just released update 2.5.0 with significant changes to the backend.
Be aware that updating MO will delete all third-party plugins!
Anomaly CPU Affinity plugin Update 1.1 is up!
- Added support for ModOrganizer 2.5.0
- Plugin is backwards compatible with previous MO versions.
I actually wanna hear is this thing actually work and how it affect others computers.
I have an old PC so i dont wanna risk(
me too
I released this mod on GAMMA discord sever yesterday and got positive feedback. Plugin working as intended on variety of hardware.
Works as intended for me. Thank you :)
Aye good on ya for this. Maybe this will help with all the people who cant read basic instructions in those servers lol
I have a i7 12700k and with this script I get huge 4-5 seconds freezes every once in a while
Can you tell me which cores are assigned to Anomaly.exe?
Open Task Manager, select "Details" tab, right-click on Anomaly.exe and select "Set affinity". You can see there which cores are used by the application.
Cores 2, 4 ,6 ,8 ,10 ,12 ,14
That's seem correct. hmmm... you can try to enable core 0.
Are you sure that without this plugin there were no freezes? I had one tester with an i7 12700kf and he reported no issues.
I have tiny microfreezes without the script. But with the script it literally freezes for several seconds wich had never happened before.
Still the same with core 0 enabled
Then it may be scheduler in new Intel architecture messing with affinity. Unfortunately looks like you won't get anything from this plugin. Thanks for feedback tho.
Edit: After deeper googling seems like new Intel architecture (12th and 13th gen) don't like changing affinity. It works best with all cores enabled.
No worries, thank you for trying. I hope one day we get Anomaly to play nice with modern cpus
I think you need Windows 11 to make your CPU deal with the scheduler properly.
I am on win 11
same things
If only there would be the way, so it will start automatically with anomaly it would be absolutely amazing. Either way it's a great tool that really boosts fps.
I tried, but after few hours of dragging my face through mo2 documentation I gave up. It should be possible but need someone who knows mo2 environment well.
Edit: If anyone knows any plugin for MO2 that run automatically with game launch, I can reverse engineer it and try to implement in to this plugin.
we need the help of Skyrim mod lords
This comment is currently awaiting admin approval, join now to view.
Can I use JSGME insted of Mod organizer?
Unfortunately no. This plugin relays on Mod Organizer 2 libraries.
its year 2023 why people still use that outdated apps
Isn't this more like a save some clicks type of plugin rather than an automated one since you still have to manually start the script by clicking "Anomaly CPU Affinity" everytime you run the game? I am currently using a free version of Process Lasso which does the job automatically. If you figure out how to run the script automatically then this plugin is a full 10/10.
On the other hand I don't know if Process Lasso is able to make Stalker Anomaly avoid the E cores and virtual cores. So I guess I'll give this a try and see if Stalker Anomaly performs better than with Process Lasso.
For now it's only "save some cilicks" type of plugin, but it sets affinity automatically depending on your CPU. It's quite user friendly and don't require any external software.
If you have process lasso already installed and have some well working setup there is no reason to use this plugin.
I'm looking for solution to automatically run this plugin with game start. Maybe this will be possible in future.
Well, I know a way to automatically load custom dlls on game start (if you don't find any other solution)
A task scheduler in windows should be able to launch it after anomaly starts. One can even create a delay for the task. Quite possibly same scheduler could launch a powershell script setting affinity.. idk, it needs googling.
Tested this with AMD Ryzen 7 4800H, no dice. Still stuttering, maybe even worse. /cry.
Tested on AMD Ryzen 5 4600G with Radeon Graphics and in really improves, because i think stalker dont run very well with AMD but this helps a lot! thanks!
Removed the stutters! Sometimes i were playing with 40fps but it seemed 20 just because of the sttuters, now they are gone! Tks for it!
Hey so, the plugin always fails to load upon MO2 loading. With this error: Imgur.com
This error is covered in Troubleshooting section on modpage. TLDR you have incomplete/corrupted installation of Mod Organizer 2
This fixed all my problems. I can't thank you enough.
thanks i play with zcp and varous other mods that introduced some stutter but affinity thing helped before so this makes it less annoing to restart my game
thanks again
ryzen 5600x btw
My setup right now is an MSI Gaming Trio RTX-2080ti and an AMD Ryzen 9 3950x, both overclocked. Do you think this mod would even be necessary for me?
The fact is, the newer hardware, the plugin should give more, as game were never optimized for modern CPUs.
Give it a try, it's not invasive and after all you can just not use it.
Приветствую! Подскажите, что делать если плагин перестал работать ? Было 35-45 фпс на минимальных настройках, а с использованием плагина 130 -150 фпс на максимальных настройках , но после вылета игры и включении плагина снова фпс не растет выше 35-45 fps . Иногда вырастает до 50 -65 fps в зданиях (Greetings! Tell me what to do if the plugin stopped working? It was 35-45 fps at the minimum settings, and using the plugin 130-150 fps at the maximum settings, but after the game crashes and the plug-in is turned on again, the fps does not grow above 35-45 fps. Sometimes it grows up to 50 -65 fps in buildings)
It seems that something else is going on, cause this fps differences are too drastic.
Try turning off unnecessary applications while playing. Alternatively fps drops may be caused by some mod conflicts or poorly written scripts.
I play on a clean version of Anomaly without mods, only your plugin.
my pc spec:i5-8400 gtx 1060 6gb 16 gb ram
I have almost identical CPU as you (9400f) and never had issues like that.
I assume without using plugin fps is still low?
Try to start game without using plugin, disable core 0 affinity manually and check if anything change.
40-45 fps
Well, then something else must have broken. Sorry, but I don't know how to help you and this problem is not related to the plugin.
Hello, I was seeing if a name swap in the file would work due to me using the game with Nvidia filters through GeForce Experience (renamed exe in use to anselintegrationtestapp.exe) but it wouldnt work. I was wondering if there is a way to get it to work with your file.
Yes it is possible, but I don't have GeForce Experience and never used Nvidia filters.
If you really want to, dm me and I can tell you how to modify plugin.
With your help, maybe I will add support for Nvidia filters.
thanks for responding. I sent you a message I think. I am not sure how to dm on here compared to nexus
Freeze and lags after 20 min of playing sometimes, useless unfortunately (tryed both AVX and not, all the same) Ryzen 5500
This causes massive lags from time to time on my R7 5800 X3D. Like, MASSIVE. 0 FPS for like 30 seconds.
Can you check if affinity is properly applied? On your CPU active cores should be: 2,4,6,8,10,12,14
If not then some software is messing with affinity.
Tested on an i5-11400H. The CPU load went from being at 100% all the time to being more dynamic depending on the scenario. I ******* love you!!!
Is it possible to used it without MO2(
This comment is currently awaiting admin approval, join now to view.