Skip to content

Conversation

@SadPencil
Copy link
Member

@SadPencil SadPencil commented Jan 4, 2026

Implements CnCNet/cncnet-yr-client-package#793

Ref:

In CnCNetYR before version 9.0.0, ProcessorAffinity was set to 2 via SingleCoreAffinity to make it run on cpu1 (the second processor). Since version 9.0.0, the Ares extension has been introduced, which has a -AFFINITY parameter that also controls ProcessorAffinity and defaults to 1, meaning the game will run on cpu0, the first processor only. Therefore, here we explicitly set the value of this command-line parameter to make it consistent with the behavior before 9.0.0.

The current issue: running game on CPU 0 exclusively results in a bad performance because of driver implementation and system interrupts etc., which varies from machines to machines

Reference 1: https://www.reddit.com/r/GlobalOffensive/comments/1dzci78/disabling_core_0_fps_boost/
Reference 2: ~3 years ago, my previous PC playing MO 3.3.6 with cnc-ddraw (old version), Windows 10, E5 2666v3, RX 580. With CPU 0 assigned: the game renderers literally like a PowerPoint slide show. With other CPU thread assigned (I made a tool to automatically do it), the game plays smoothly. Note that this observation might differs a lot upon different kinds of hardware.

@SadPencil SadPencil marked this pull request as draft January 4, 2026 13:18
@github-actions
Copy link

github-actions bot commented Jan 4, 2026

Nightly build for this pull request:

  • artifacts.zip
    This comment is automatic and is meant to allow guests to get latest automatic builds without registering. It is updated on every successful build.

Comment on lines +162 to +167
if (overrideProcessorAffinity && ClientConfiguration.Instance.ClientGameType == ClientType.Ares)
{
// Ares defaults to use CPU 0 exclusively, unless explicitly overridden.
arguments += " " + "-AFFINITY:" + processorAffinity.ToString(CultureInfo.InvariantCulture);
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am going to disappoint you: we can't really rely on this anymore with upcoming SyringeEx, because there command line params to be passed to the exe are defined as --args="-command -line -params".

@SadPencil
Copy link
Member Author

SadPencil commented Jan 4, 2026

Update: hold off this PR because it seems both the spawner and cnc-ddraw/ts-ddraw/ddrawcompat overrides the affinity mask. Currently this PR is only effective on Mental Omega 3.3.6 (Ares only, without phobos) and with old version ddrawcompat/without ddraw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants