Will CK2 support two cores (4 threading) intel CPU [i.e. i3, i5, i7]? What about system requirements?
Will CK2 support two cores (4 threading) intel CPU [i.e. i3, i5, i7]? What about system requirements?
The problem with making a dual-core program is that technically a dual-core program is two separate programs that happen to use the exact same RAM to store all their data.Will CK2 support two cores (4 threading) intel CPU [i.e. i3, i5, i7]? What about system requirements?
In future games like Crusader Kings 2 I’ve had the luxury of not having to add multi-threading afterward, so the core processing things are built with this in mind. It's not as good as if our engine was built from the ground up for MT support but it makes things much easier than adding in support later. The model we follow there is also based around limiting any locks and works by splitting up tasks with shared data like this:
I'll use a simplified example from CK2, before we would have a single Character:: DailyUpdate function run serially for each character for anything that needed to be done on a daily basis, now this is split up in 3 steps:
In step 1 a character is free to look at the public data of any other character and modify its secret internal data only. In step 2 the character is free to modify its public data, but not read any data from other characters. If it needs to decide something based on another characters data it would have to store this data in its secret internal data as part of step 1. Finally step 3 is run in serial for any algorithms too complex or slow to split up in the above way.Code:step 1: Character:: DailyUpdateOnlyChangeSafePrivateAndCache (run in parallel) step 2: Character::DailyUpdateSelfDontReadOthers (run in parallel) step 3: Character::DailyUpdateSerial (run serially)
This means that we don’t need any locks at all that slow things down while guaranteeing that we always get the same results from calculations no matter what order characters are processed. Processing wise it is perhaps not 100% optimal but strikes a good balance between 1) being easy to use (important for developers to get stuff done) and 2) not wasting lots of memory by duplicating all states that multiple threads need to modify.
There are different ways to use multiple cores (threads, processes being the most widely used), that may or may not share memory and can communicate in different ways.The problem with making a dual-core program is that technically a dual-core program is two separate programs that happen to use the exact same RAM to store all their data.
It's no harder then writing a single-core program if you know what you're doing. OTOH adapting a single-core program to run on dual cores is virtually impossible. And CK2 is based on a single-core game engine.
Nick
Well if any one have read the last dev diary for "For the Mother Land" then you see that I have been working on it.
There are different ways to use multiple cores (threads, processes being the most widely used), that may or may not share memory and can communicate in different ways.
Writing parallel software and using multiple cores efficiently is still a major issue in computer science, if you know am easy way to do it you can make a lot of €€€ as a software developer or architect. Paralleling a sequential program is doable and theoretically at least appropriate for games (you most probably have independent task to be run in parallel), it depends though on how the specific software was written and in any case costs money to do. It is up to PI to decide if it is worth the effort.
Offtopic, but are you really from my hometown? I really didn't expect this here.Well if any one have read the last dev diary for "For the Mother Land" then you see that I have been working on it.
Ops, That schold say "they not "I"You have? Thanks!![]()
Offtopic, but are you really from my hometown? I really didn't expect this here.![]()
Offtopic, but are you really from my hometown? I really didn't expect this here.![]()
In theory threads will be spread out over any available cores anyway, you don't need specific 6 core/8 core/50 core stuff.
Will there be a way to tell the game what cores it can use? For example in a 4+ core system i might not want to use core 1 for the game, only core 2-4.
Will there be a way to tell the game what cores it can use? For example in a 4+ core system i might not want to use core 1 for the game, only core 2-4.
You can do that via your OS already. It's called affinity in windows AFAIK.