How is the Multi-threading done in X4? 16 Cores Vs 8 Cores At Higher Per Thread Performance.

This forum is the ideal place for all discussion relating to X4. You will also find additional information from developers here.

Moderator: Moderators for English X Forum

User avatar
StoneLegionYT
Posts: 1478
Joined: Fri, 4. Nov 05, 01:18
x4

How is the Multi-threading done in X4? 16 Cores Vs 8 Cores At Higher Per Thread Performance.

Post by StoneLegionYT »

So I heard a few people building new pc's. I'm wondering what would be more beneficial.

So No AMD vs Intel but rather more generic question strictly speaking for X4.

No HT in this example question and a random number to indicate per core performance.:
8 Cores 1000 performance
16 Cores 750 performance

So in the end the 8 cores would be 8000 performance in total where 16 cores is 12000 but per core is of course less.

How does the X4 Engine work with something like this? Would there still be a single task needing that extra per thread performance before it bottlenecks everything?

Thanks :)
User avatar
ishmaeltheforsaken
Posts: 381
Joined: Sun, 15. Oct 06, 17:37
x4

Re: How is the Multi-threading done in X4? 16 Cores Vs 8 Cores At Higher Per Thread Performance.

Post by ishmaeltheforsaken »

CBJ has answered this in this thread:
CBJ wrote: Thu, 7. Dec 17, 20:51 As with X Rebirth, X4 will use two cores pretty heavily for its primary activities (simulation and rendering) and as many other cores as are available for other peripheral tasks (such as path-finding and asset loading). Drivers and APIs used by the game, such as Vulkan, may also be able to make use of more than one core. Overall, the game is likely to work best on a system with at least 4 cores, and the benefits of more than that will probably tail off fairly rapidly.
User avatar
StoneLegionYT
Posts: 1478
Joined: Fri, 4. Nov 05, 01:18
x4

Re: How is the Multi-threading done in X4? 16 Cores Vs 8 Cores At Higher Per Thread Performance.

Post by StoneLegionYT »

ishmaeltheforsaken wrote: Tue, 16. Oct 18, 01:42 CBJ has answered this in this thread:
CBJ wrote: Thu, 7. Dec 17, 20:51 As with X Rebirth, X4 will use two cores pretty heavily for its primary activities (simulation and rendering) and as many other cores as are available for other peripheral tasks (such as path-finding and asset loading). Drivers and APIs used by the game, such as Vulkan, may also be able to make use of more than one core. Overall, the game is likely to work best on a system with at least 4 cores, and the benefits of more than that will probably tail off fairly rapidly.
Thanks as I had expected.

Thanks for the info :)
nemesis1982
Posts: 812
Joined: Wed, 29. Oct 08, 12:10
x4

Re: How is the Multi-threading done in X4? 16 Cores Vs 8 Cores At Higher Per Thread Performance.

Post by nemesis1982 »

I'll leave my conclusion based on my interpretation here because I haven't seen this answered concretely.

For system specs there is one mayor and important aspect and that is CPU. With the most important benchmarks being:
- 4+ cores
- Single Core performance
- Quad Core performance

The two most important and demanding threads will each be bound to the maximum single threaded performance. Windows and all other processes and X4 process threads should be using the other cores, to make optimal use.

In practice (theoretically, if anyone knows how to achieve this please let me know) using my CPU a i7-7700k as an example, which has a fairly good single thread performance and is 4 core with hyper threading.

Now I'm a bit mixed on hyper threading in this case. I would turn it to make sure the two main processes get as much single core performance as possible. However if you have many things running in the background and there are many threads spawned by X4 it might be beneficial. HT basically optimizes thread switching, if you want to run a single thread on a single core as efficiently as possible it should be off. If you expect a lot of thread switching it should be on.

Now let's assume we enable HT. Since in theory we can have our cake and eat it to :) In WIndows Logical processors are interleaved so 0,1 are core 1.

We'll want to limit Windows and all other programs to CPU 0 and 2 (core 1,2).
We'll give X4 a real time priority and bind it to CPU 1,2,3,4,6 (core 1,2,3,4)
CPU 4 will be limited to simulation thread
CPU 6 will be limited to rendering thread
So CPU 5 and 7 will be IDLE, we want this to make sure core 3 and 4 are dedicated to one task.

Now for how to actually achieve this. Binding to cores can be done by affinity for a process through task manager (which is a shit load of work!). The priority of a process can also be set through task manager. The rest is a mystery.
Save game editor XR and CAT/DAT Extractor
Keep in mind that it's still a work in progress although it's taking shape nicely.

If anyone is interested in a new save game editor for X4 and would like to contribute to the creation of one let me know. I do not have sufficient time to create it alone, but if there are enough people who want it and want to contribute we might be able to set something up.
Alci
Posts: 887
Joined: Tue, 27. Aug 13, 13:06
x4

Re: How is the Multi-threading done in X4? 16 Cores Vs 8 Cores At Higher Per Thread Performance.

Post by Alci »

HT is almost always better off when you need to maximize few heavy threads (especially when you need them to be predictable/consistent like many renderers do). HT is supposed to help where you have many threads doing the same job (video processing, HTTPS responses, etc.), especially when the job cannot be optimized and rely heavily on dependent computations (which is not case for "standard" code).

New CPUs don't even have HT. Only Xeon and X-series will have one (if for any reason 8-16 physical cores is not enough for gaming :P).

What you do not consider however is TurboBoost which is MUCH more valuable for gaming then HT. And it will be for X4. TB allows automatic overclock of few cores if you don't use the others. This process is automatic, managed by Intel CPU and handled by Windows.

It means that if you plan to use 2 heavy threads it is usually better configuration to keep small ones at the same cores rather then spread them all over. That will let the two cores to overclock high enough to manage the background job and still boost the main threads.

But it all depends on many things ("heavy thread" is way too much vague without knowing what exactly and with what timing it is doing). Therefore it's better to leave all the planning to OS rather then trying to set affinities yourself, especially if you don't have any idea what HW you are currently on (from game's perspective). Just setting heavy threads high priority so they are less delayed and it's ok.
User avatar
StoneLegionYT
Posts: 1478
Joined: Fri, 4. Nov 05, 01:18
x4

Re: How is the Multi-threading done in X4? 16 Cores Vs 8 Cores At Higher Per Thread Performance.

Post by StoneLegionYT »

Please don't state new CPU's don't have HT. It's proven that HT is better for performance even in gaming if used correctly. The issue here is MS is trying push gamers from I7 to I9 in Gen 9. It's clear what their game is even more so since they faked the benchmarks like crazy.

This thread might end up turning off topic so if a Mod like to move it or lock it I'm fine with either.
CBJ
EGOSOFT
EGOSOFT
Posts: 54242
Joined: Tue, 29. Apr 03, 00:56
x4

Re: How is the Multi-threading done in X4? 16 Cores Vs 8 Cores At Higher Per Thread Performance.

Post by CBJ »

Since we already have a lot of similar discussion in the System requirements thread, I'm going to take you up on that and lock this one. :)

Return to “X4: Foundations”