Sid Meier's Civilization VI

Sid Meier's Civilization VI

통계 보기:
이 토론은 잠겼습니다.
Jaerv 2022년 8월 2일 오전 2시 43분
37
21
4
19
7
3
3
2
2
38
I actually may have fixed my crashes/end turn freezing...
Or let's say I'm cautiously optimistic that I did.
I recently set out on the quest to finally find out what's causing the game to constantly crash/freeze for me and my wife and pretty much everyone I know in rl who's playing the game.
Here's a link to the post where I'm describing my autoplay testing method:
https://steamcommunity.com/app/289070/discussions/0/3464975177697999473/?ctp=3#c3453716250586673098

After some further testing it became pretty obvious that the game became more unstable the more official content I activated. The crashes don't seem to be caused by some specific DLC, but by the number of additional content.
That fact and the reports of other players on the internet made me think that there's probably something wrong with the game's multithreading implementation. The more content has to be calculated, the higher the chance for something to go wrong if the MT is wonky.
It would also explain the unpredictability of the crashes and why folks with lower end systems don't experience as many problems. The game determines the level of MT according to the hardware and thus it wouldn't be as heavily multithreaded on their machines.

Next I looked for a way to restrict the level of MT done by the game and found a setting in the AppOptions.txt file in the ...\Documents\My Games\Sid Meier's Civilization VI directory that seems to do the trick.

After I changed the line "MaxJobThreads -1" to "MaxJobThreads 1" the crashes stopped for me. Completely.
EDIT: After some further testing and feedback from other players, it seems that to achieve the best stability, the values for MaxGameCoreThreads, GameCoreReserveThreads, MaxGameCoreUnitMovementThreads and MaxGameCoreTradeRouteThreads should be set to 1 as well.
Also, make sure to start a new game to avoid issues with savegame corruption.

You could try setting them to a higher value, but for me the only 100% stable setting was 1.
The game still seems to run multithreaded, but if I understand it correctly this setting allows the game only to use one single thread per job.

I have now run 17 autoplay games on both our machines together without any issues beyond turn 400 with all DLC content enabled. Before the change this was next to impossible, the game would crash/freeze every single time before turn 100.
Fingers crossed it stays that way.

Performance, at least on our systems, is still ok. Loading times got longer, but turn times and fps are perfectly fine so far. Your mileage may vary.

TLDR:
There seems to be something wrong with the game's multithreading, which most likely causes the crashes.

Try setting the values for MaxJobThreads, MaxGameCoreThreads, GameCoreReserveThreads, MaxGameCoreUnitMovementThreads and MaxGameCoreTradeRouteThreads from -1 to 1 in the AppOptions.txt file in your ...\Documents\My Games\Sid Meier's Civilization VI directory, thus restricting the game's use of MT.
Give it a go, if possible with a new game to avoid issues due to savegame corruption.


IMPORTANT EDIT:
Kevin_H did a very good in-depth analysis of the game's multithreading related inner workings. He also posted a guide detailing which settings to use according to your hardware. So if this works for you, but you're unhappy with the game's performance or loading times, take a look at his post:
https://steamcommunity.com/app/289070/discussions/0/3453716776424294825/?ctp=10#c5733664933459216548


On Linux, the file is located in the .local/share/aspyr-media/Sid Meier's Civilization VI directory under the home folder, .
A big thank you to rgx107 for this information!

I know this solution is far from perfect, but until 2K/Firaxis finally manage to fix their code, it's possibly the best we got.
At least I can finally play the damn game now. :D
Jaerv 님이 마지막으로 수정; 2022년 8월 14일 오전 5시 14분
첫 게시자: antoca:
This guide is not actual since december update. Now it only hurts performance. Return your settings to default!
< >
전체 댓글 415개 중 136~150개 표시 중
tulle040657 2022년 8월 12일 오전 4시 06분 
Jaerv님이 먼저 게시:
tulle040657님이 먼저 게시:
This makes sense. This means it's a timing issue and exactly what hardware you have will determine if you have the crashing problem or not. It explains why some people don't have any problem at all

Agreed.
Right now only a minority seems to suffer stability issues. Makes total sense if you think about it.
It's only affecting people with high end systems. But of those it seems to hit pretty much everyone. All the folks with good systems that I personally know are having problems with the game.

According to the latest Steam hardware survey over 75% of players are still using 6 core cpus and below. Those people probably won't have any issues at all. That number's probably even higher for Civ 6 players. The 4x community isn't exactly a fps enthusiast power gamer crowd. Also, the crashes only seem to become intolerable when most of the official content is installed, limiting that group even further.

Thing is, with more and more people migrating to stronger hardware, this problem will explode. Guaranteed. If the devs don't fix it, this will blow up in their faces and haunt the game for years to come.

Civ 5 had a similar issue. it would crash if it used more than 8 cores
Jaerv 2022년 8월 12일 오전 4시 21분 
tulle040657님이 먼저 게시:

Civ 5 had a similar issue. it would crash if it used more than 8 cores

Interesting. Did they eventually fix it?
It's been a while since I've played a longer game of Civ 5.
tulle040657 2022년 8월 12일 오전 4시 24분 
Jaerv님이 먼저 게시:
tulle040657님이 먼저 게시:

Civ 5 had a similar issue. it would crash if it used more than 8 cores

Interesting. Did they eventually fix it?
It's been a while since I've played a longer game of Civ 5.
I don't know for sure, he is the info I have

https://gaming.stackexchange.com/questions/328111/civ-crashes-on-a-newer-high-end-system
grognardgary 2022년 8월 12일 오전 6시 59분 
This is almost certainly why they've moved on to civ VII and probably why its going to be a while before we see seven. I get the feeling it is going to damn hard to create a game that can deal with the every conceivable CPU format with out the players having to be a lot more familiar with their systems than many currently. The easy way of course would simply be to have the player in put the number of cores and his graphics card and the game downloads what is appropriate for your system.
Gametheus 2022년 8월 12일 오전 8시 54분 
So I'm having an issue with this method that I haven't been able to find any help for on Google: I don't seem to have an AppOptions.txt file??

I just got the game with the sale, haven't even launched it yet but I was so excited to finally get into the series; then i found out about the issue and was Very Sad until I found this thread, which reignited my hope for the game... and then I just don't have the file.

I installed the game on the D: drive so that may have something to do with it but idk?
I looked up a YouTube video to see how they find the file and it looked, Totally different from my directory. They had folders like Cache and Mods and Logs and such, and they had files beneath those folders, whereas I only have six folders: 2KLauncher, Base, CTP, Debug, DLC, and Launchpad. I, frankly, have no idea what I'm looking at here but I've Control+F'ed in so many files of code looking for MaxJobThreads that I think I'm absorbing a game design degree through osmosis.

Going to Documents/My Games reveals that it only has one game in it, that being Tabletop Simulator, and I have many games on both the C: and the D: drives. Looked in the My Games folder in C:, over in Users, and only found the Binding of Isaac. Didn't find a directory for it in Program Files x86 or Program Files either. I also tried searching my entire PC for the file to little avail. Tried the %appdata% thing to no avail. I've got no clue what to do anymore.
tulle040657 2022년 8월 12일 오전 8시 57분 
Gametheus님이 먼저 게시:
So I'm having an issue with this method that I haven't been able to find any help for on Google: I don't seem to have an AppOptions.txt file??

I just got the game with the sale, haven't even launched it yet but I was so excited to finally get into the series; then i found out about the issue and was Very Sad until I found this thread, which reignited my hope for the game... and then I just don't have the file.

I installed the game on the D: drive so that may have something to do with it but idk?
I looked up a YouTube video to see how they find the file and it looked, Totally different from my directory. They had folders like Cache and Mods and Logs and such, and they had files beneath those folders, whereas I only have six folders: 2KLauncher, Base, CTP, Debug, DLC, and Launchpad. I, frankly, have no idea what I'm looking at here but I've Control+F'ed in so many files of code looking for MaxJobThreads that I think I'm absorbing a game design degree through osmosis.

Going to Documents/My Games reveals that it only has one game in it, that being Tabletop Simulator, and I have many games on both the C: and the D: drives. Looked in the My Games folder in C:, over in Users, and only found the Binding of Isaac. Didn't find a directory for it in Program Files x86 or Program Files either. I also tried searching my entire PC for the file to little avail. Tried the %appdata% thing to no avail. I've got no clue what to do anymore.
Most people don't have any problems running Civ 6. You should ignore this thread unless your game is crashing a lot
SLG 2022년 8월 12일 오전 9시 02분 
Gametheus님이 먼저 게시:
So I'm having an issue with this method that I haven't been able to find any help for on Google: I don't seem to have an AppOptions.txt file??

I just got the game with the sale, haven't even launched it yet but I was so excited to finally get into the series; then i found out about the issue and was Very Sad until I found this thread, which reignited my hope for the game... and then I just don't have the file.

I installed the game on the D: drive so that may have something to do with it but idk?
I looked up a YouTube video to see how they find the file and it looked, Totally different from my directory. They had folders like Cache and Mods and Logs and such, and they had files beneath those folders, whereas I only have six folders: 2KLauncher, Base, CTP, Debug, DLC, and Launchpad. I, frankly, have no idea what I'm looking at here but I've Control+F'ed in so many files of code looking for MaxJobThreads that I think I'm absorbing a game design degree through osmosis.

Going to Documents/My Games reveals that it only has one game in it, that being Tabletop Simulator, and I have many games on both the C: and the D: drives. Looked in the My Games folder in C:, over in Users, and only found the Binding of Isaac. Didn't find a directory for it in Program Files x86 or Program Files either. I also tried searching my entire PC for the file to little avail. Tried the %appdata% thing to no avail. I've got no clue what to do anymore.
Play the game first. You might not have any issues.
Jaerv 2022년 8월 12일 오전 9시 11분 
If you haven't started the game yet, the file won't be there. It's created on the first startup.
I agree with tulle040657 and SLGray, don't use this method if you don't have any issues.
Jaerv 님이 마지막으로 수정; 2022년 8월 12일 오전 9시 40분
YaBoiBeanz 2022년 8월 12일 오후 1시 12분 
The problem is if the problem doesn't present itself within the first hour they forfeit their chance for a refund. Then Devs don't even realize there is a problem since they already got paid
Kevin the Red 2022년 8월 13일 오후 5시 32분 
3
2
TL;DR at the start.
For Intel users you should be safe setting MaxJobThreads and MaxGameCoreThreads to same value of PHYSICAL cores your processor has (so my i5-10600K has 6 physical cores, but with hyper threading looks like it has 12) if you don't have hyper threading like an older 7th gen i5 I have the 4 physical cores it has means setting it to 4 is safe. If you really want to tweak read the details and go 60% of the auto spawned value. I'm not fully sure with AMD systems since I don't have one to test on, but I'd imagine the 60% of what the game thinks it can use will be fine too.

Keep MaxGameCoreUnitMovementThreads and MaxGameCoreUnitMovementThreads smaller than MaxGameCoreThreads. This only tends to matter for large maps with lots of units late game.

Still not fully sure about GameCoreReserveThreads I've mostly just been leaving it at 2.

More Detail
OK so I haven't been able to trace everything but do have some more insight.

For anyone else who wants a basic windows tool to check things and follow along more closely get process monitor (the answer in this thread covers it very well. You DO NOT need the symbols for this so you can stop at step 5: SuperUser forum answer[superuser.com]). There are other tools I've used but since this is basically something MS cut out of the OS to keep things simpler it's usable by anyone.

The game fires up several threads that we have no config options for, and really wouldn't matter if we did. You'll get several threads for controlling videos (the threads started at bink2w64 if you have a process viewer and are curios). You'll get a couple for input control (mine are Logitech). You'll get a network controller (MSWSOCK), you'll get 3-6 for you video card (nwf2xumx in my case). You'll get a couple for audio (AUDIOSES.DELL and xaudio2_9.DLL). Then you'll get about 6 asset control threads (CivilizationVI_DX12.exe!ForgeUI...) those control the various info in the user interface. Those thread sets basically never change and seem to all be well behaved. I've never seen any real errors with any of them. If you have different hardware you'll get different start addresses for some of them but they should be fairly obvious.

The threads spawned from uctrlbase.dll and the ntdll.dll!TpReleaseCleanupGroupMembers are the ones that you can have some influence on. While those threads aren't always active they are primary game control threads. It definitely seems like the controls for MaxGameCoreUnitMovementThreads and MaxGameCoreTradeRouteThreads are instructions for how many of primary control threads those functions can use. Keeping those values lowers than MaxGameCoreThreads seems to help stability in late game high unit situations. It also has an impact on turn times in very late game scenarios.

As for setting MaxJobThreads and MaxGameCoreThreads which have the biggest influence it seems that 60% of the autoset (leaving them at -1 in the config file) value seems to always be safe. So on my big rig I'll get 10 threads with a start address of ucrtbase.dll when things are set at default. I can set both MaxJob and MaxGameControl to 6 and haven't seen a crash. On a slightly older rig it fires up 8, 4 was always safe, but 5 or more would sometimes still crash.

On the big rig I've put the UnitMovement and TradeRoutes to 4 each and I've just been leaving CoreReserveThreads at 2, I'm not sure what it does still.

I have noticed that problems are likely to happen if the ntdll.dll!TpReleaseCleanupGroupMembers threads start closing and not coming back. I do think the CoreReseveThreads might be the minimum the game tries to keep open. But when I get down to just 1 or 2 of those threads being alive I'll usually see a crash in the next dozen turns or so. Shutting down and restarting the game seems to buy me more time. So if you really want to squeeze everything out of your system you can likely monitor those threads and exit restart when you see them dropping. Of course I don't really think you need to since a setting of 4 on Job and GameCore threads performs just fine on newer systems.

If you don't have a process monitor tool to check that, I'd say on an Intel system just go with the number of physical cores you have (remember if you have hyper threading physical cores will be half of what you see in task manager/process monitor, etc).
Jaerv 2022년 8월 14일 오전 3시 52분 
Thanks a lot for the very in-depth analysis! Great stuff.
I don't have a lot of time today, but I'll make sure to do some testing in the next days.

One thing I can say for sure right now, though, is that, at least on my system, setting MaxJobThreads and MaxGameCoreThreads to the amount of physical cores seems to be highly unstable.
I've got an i7 12700k, which means I've got 8 physical P-cores and 4 E-cores. I did a quick test run this morning with the five settings set to 8/8/2/2/2 and my game crashed at turn 17. I then deactivated my E-cores in Bios, just in case they were messing something up, but results were pretty much the same.
Another quick autoplay test run with settings at 6/6/2/2/2 ran perfectly stable until turn ~400, though. So you're definitely unto something here. However, I'm certain that I already had two test run crashes with MaxJobThreads and MaxGameCoreThreads set to 4 in the past. Those seem to be pretty rare though.

Again, thanks for you work! I'll put a link to your post in the OP.
Jaerv 님이 마지막으로 수정; 2022년 8월 14일 오전 4시 41분
Propex 2022년 8월 14일 오전 3시 57분 
In every game of civ I would crash and I have tried so many solutions in order to fix it, with no luck what so ever. So I had my doubts when trying this solutions, but I was wrong having these doubts. It works! So thank you so much. This should be a pinned post, or in some way shown on the store page for everyone to see.
Propex 님이 마지막으로 수정; 2022년 8월 14일 오전 3시 58분
Jaerv 2022년 8월 14일 오전 6시 10분 
@Propex: You're very welcome. Glad it worked out for you!

@Kevin_H:
Alright, I had time for another test run while I've been doing some other stuff in the house.

Sadly, with another round of the same settings as before (6/6/2/2/2) the game crashed this time at turn 84. Interestingly, with exactly the same starting position. I loaded a turn 1 savegame that I made the last time.
I had a look at my thread count on default settings and I'm getting 18 threads with a start address of ucrtbase.dll with everything set to -1. So the reference point for a stable game of 60% seems to be off, at least for my system.
Jaerv 님이 마지막으로 수정; 2022년 8월 14일 오전 6시 12분
Seyfti 2022년 8월 14일 오전 6시 39분 
Managed to finish a late game on 4 that is I started with 2 threads. Started up a new game with 4 job threads and of course crashed again around turn 80 or so just like you. Reloading the save gets me past the crash but looks like it's just a matter of time before it crashes again. Might need to reduce the job threads again but I am not happy with the performance then.
Kevin the Red 2022년 8월 14일 오전 10시 28분 
@Jaerv

Well dang thought the 60% would work well. Good to know it doesn't. I also wonder why the 6/6/2/2/2 is less stable for you than for me. That sucks. I thought we had something. Guess not, but at least the data points are out there for people and at least many of us who couldn't play at all can again thanks to you finding and posting about the file. I just want to find a stable way for people to be able to get stable games without sacrificing too much performance.

What video mode were you using? I've been running borderless windowed so that it's easy to use the tools and record results and such. Wonder if that has an impact.

It does seem that 6 job threads is the max I've never been stable on any system over that and it doesn't seem like anyone else has either.
Kevin the Red 님이 마지막으로 수정; 2022년 8월 14일 오전 10시 29분
< >
전체 댓글 415개 중 136~150개 표시 중
페이지당 표시 개수: 1530 50

게시된 날짜: 2022년 8월 2일 오전 2시 43분
게시글: 415