Crash to Desktop

Hi, I thought as far, seeing as there are several lines in there saying “Failed to open file”, but I didn’t comment on it as I thought that probably was expected on first launch.

However, this is starting to annoy me slightly. Switching off Google Disk sync and uninstalling OneDrive completely did not help, then I thought there might have been something with my Antiransomware, but alas. Then there’s these permissions which is quite weird, as the folder is generated by D4 itself. I’ve even set the folder to read-write-execute permissions for all, with no luck.

I have one last thing up my sleeve; Running Windows in safe mode. Let’s see if that works. I doubt it though.

That did not work, annoyingly.

@cliffski Which file is it looking for? I could try creating an empty txt file with the name it’s looking for and see what happens then.

This is so weird… I tried moving the location of the documents folder, meaning D4 would generate these files in a completely different location, and it still gives me the same error. And I’m on a completely different device now than I used before…

The volume stuff will be in this file:
\my documents\my games\democracy 4\config.txt
The file creates it, full of defaults, on first run if it does not exist. It seems like something is stopping the game creating, or reading that file.

here are sample contents (from my laptop)

[config]
OPTIONS_UI_ANIM_DURATION = 1
OPTIONS_SFX = 0.5
OPTIONS_MUSIC = 1
OPTIONS_MASTERVOLUME = 1
OPTIONS_POLICYOUTLINES = 1
OPTIONS_TRANSITIONS = 1
OPTIONS_DILEMMAS = 1
OPTIONS_MANIFESTOS = 1
OPTIONS_HONEYMOON = 1
OPTIONS_AUTOSAVE = 1
OPTIONS_LEADERBOARDS = 1
OPTIONS_ASSASSINATIONS = 1
OPTIONS_RANDOMSTART = 0
EDUCATION_VOTE_LINK = 1
palette_file = Light
neuron_scaler = WEIGHTED
OPTIONS_LANGUAGE = English
OPTIONS_POLITICALCAPITAL = 1
OPTIONS_MUTEALTTAB = 1
OPTIONS_LOCK60FPS = 1
MAXIMUM_THREADS = 3
SORT_ORDER_CLUSTERSORTMODE = 0
SORT_ORDER_CLUSTER_DIR = 1
SORT_ORDER_EFLIST_SORT_MODE = 0
SORT_ORDER_SORT_DIRECTION = 1
SORT_ORDER_MIN_SORT_CRITERIA = 2

this is very weird because clearly the game is allowed to WRITE to disk, otherwise you would have no debug files. It does sound like an issue with permissions and the location of the my games\democracy4 folder.
Are you running as a limited user? (it should still work but…)

  1. Reinstalling Windows & reformatting my drive did not help at all, so it’s not inherently an issue with my computer it seems like, unless Windows’ own installers are corrupt.
  2. I am running with elevated privileges.
  3. Entering your sample data, D4 starts up with no issues. This file did exist and was populated from before. The data in my config.txt was populated with the following data at first launch:

[config]
OPTIONS_UI_ANIM_DURATION = 1
OPTIONS_SFX = 0,5
OPTIONS_MUSIC = 1
OPTIONS_MASTERVOLUME = 1
OPTIONS_POLICYOUTLINES = 1
OPTIONS_TRANSITIONS = 1
OPTIONS_DILEMMAS = 1
OPTIONS_MANIFESTOS = 1
OPTIONS_HONEYMOON = 1
OPTIONS_AUTOSAVE = 1
OPTIONS_LEADERBOARDS = 1
OPTIONS_ASSASSINATIONS = 1
OPTIONS_RANDOMSTART = 0
EDUCATION_VOTE_LINK = 1
palette_file = Light
neuron_scaler = WEIGHTED
OPTIONS_LANGUAGE = English
OPTIONS_POLITICALCAPITAL = 1
OPTIONS_MUTEALTTAB = 1
OPTIONS_LOCK60FPS = 1
SORT_ORDER_CLUSTERSORTMODE = 0
SORT_ORDER_CLUSTER_DIR = 1
SORT_ORDER_EFLIST_SORT_MODE = 0
SORT_ORDER_SORT_DIRECTION = 1
SORT_ORDER_MIN_SORT_CRITERIA = 2
MAXIMUM_THREADS = 7

It seems what may cause this error is the line “OPTIONS_SFX”. Whereas mine is populated with a comma, it seems yours is populated with a full stop. In other words, mine reads “OPTIONS_SFX = 0,5” whilst yours, which is working, reads “OPTIONS_SFX = 0.5”.

Might this be a localization issue? I live in Norway, and we use commas to denote decimals and full stops to denote thousands – opposite of the English language.

EDIT: I’ve done some testing, and it seems like it indeed is the comma vs full-stop that is the problem.

Happy holidays!

haha amazing!
FWIW I am aware of the comma issue and the game actually forces the system to use full stops when it runs BUT it might be that this one file gets written just before the locale gets set! i will fix it…

2 Likes

Yup, it’s great that we found a soluition to this :slight_smile:

Now it’s just crashing when I start a new game :\ Dunno if that’s a localization issue as well or what it is.

[12:54:14:399]- ----DEBUG FILE----
[12:54:14:399]- Windows 7 detected
[12:54:14:399]- Game version: 1.18
[12:54:14:400]- Failed to open file: C:\Users\henri\Documents/My Games/democracy4/mod_status.ini : 2
[12:54:14:400]- GBufferedFile failed to open file [C:\Users\henri\Documents/My Games/democracy4/mod_status.ini]
[12:54:18:38]- Setting Color palette
[12:54:18:38]- Updating BG shader
[12:54:18:38]- BG shader updated
[12:54:18:38]- Saving options
[12:54:18:39]- Options saved
[12:54:18:39]- Color palette set
[12:54:18:42]- Desktop resolution is 1920 x 1080
[12:54:18:42]- Loaded Config: 1920x1080@0 [fullscreen]
[12:54:18:42]- GEngine::Init Engine mode: 1920x1080
[12:54:18:42]- GEngine::Desktop mode: 1920x1080
[12:54:18:42]- Matching desktop res
[12:54:18:42]- Calling SDL_CreateWindow: 1920x1080@0 [fullscreen]
[12:54:19:332]- Attempting to initialise steam
[12:54:20:39]- Steam initialisation success
[12:54:20:39]- Checking steam workshop subscriptions...
[12:54:20:55]- Requesting steam stats...
[12:54:20:55]- ...Steam stats requested
[12:54:20:56]- Initialising 3D Engine
[12:54:20:207]- OpenGL Vendor  : NVIDIA Corporation
[12:54:20:207]- OpenGL Renderer: GeForce GTX 1060/PCIe/SSE2
[12:54:20:207]- OpenGL Version : 4.6.0 NVIDIA 419.71
[12:54:20:210]- Initialising global vertex buffer
[12:54:20:602]- Failed to open file: C:\Users\henri\Documents/My Games/democracy4/stats.ini : 2
[12:54:20:602]- GBufferedFile failed to open file [C:\Users\henri\Documents/My Games/democracy4/stats.ini]
[12:54:20:945]- Initialisizng Vector Engine
[12:54:21:385]- Setting vector Engine Dimensions
[12:54:21:389]- VE Clearing existing textures to replace with new [1920]x[1080]
[12:54:21:391]- Initializing Text
[12:54:21:391]- Creating font config
[12:54:21:392]- font config created
[12:54:21:392]- adding font directory
[12:54:21:752]- font map created
[12:54:21:752]- creating pango layout
[12:54:21:758]- pango layout created
[12:54:21:758]- PANGO context font map font families:
[12:54:21:758]- Noto Sans
[12:54:21:758]- Sans
[12:54:21:758]- Serif
[12:54:21:758]- Monospace
[12:54:21:763]- Initializing Input
[12:54:21:764]- Initializing sound
[12:54:21:764]- Initialising Sound Engine
[12:54:21:764]- Resetting Sound volumes to maximum
[12:54:21:764]- Loading in volume presets
[12:54:21:764]- Creating IrrKlang Device
[12:54:21:786]- ESOD_AUTO_DETECT worked ok
[12:54:21:786]- Finished Initialising Sound Engine
[12:54:21:798]- Failed to open file: C:\Users\henri\Documents/My Games/democracy4/tut_seen.ini : 2
[12:54:21:798]- GBufferedFile failed to open file [C:\Users\henri\Documents/My Games/democracy4/tut_seen.ini]
[12:54:21:798]- Setting game mode to splashscreen
[12:54:22:23]- Found 0 workshop subscriptions
[12:54:22:24]- Socialism LB size:19740

[12:54:22:24]- Liberalism LB size:19738

[12:54:22:24]- Received stats and achievements from Steam

[12:54:22:40]- Exiting splashscreen
[12:54:22:354]- Failed to open file: C:\Users\henri\Documents/My Games/democracy4/compass.ini : 2
[12:54:22:354]- GBufferedFile failed to open file [C:\Users\henri\Documents/My Games/democracy4/compass.ini]
[12:54:24:228]- Failed to open file: translations/English/missions/italy.txt : 2
[12:54:24:228]- GBufferedFile failed to open file [translations/English/missions/italy.txt]
[12:54:24:228]- Failed to open file: translations/English/missions/italy.txt : 2
[12:54:24:228]- GBufferedFile failed to open file [translations/English/missions/italy.txt]
[12:54:24:233]- Failed to open file: translations/English/missions/spain.txt : 2
[12:54:24:233]- GBufferedFile failed to open file [translations/English/missions/spain.txt]
[12:54:24:233]- Failed to open file: translations/English/missions/spain.txt : 2
[12:54:24:234]- GBufferedFile failed to open file [translations/English/missions/spain.txt]
[12:54:26:896]- Starting thread:[0][New Game]
[12:54:26:897]- New Game thread created OK
[12:54:26:897]- Starting new game...
[12:54:26:904]- SIM_GetSimulation()->Initialise()...
[12:54:26:904]- Debug: closing attack manager
[12:54:26:904]- Debug: attack manager closed
[12:54:26:956]- SIM_GetSimValueManager()->Initialise()...
[12:54:26:968]- SIM_GetVoterManager()->Initialise()...
[12:54:27:100]- No potential sympathy groups found, trying to find defaults...
[12:54:27:100]- No potential sympathy groups found, trying to find defaults...
[12:54:27:100]- No potential sympathy groups found, trying to find defaults...
[12:54:27:100]- No potential sympathy groups found, trying to find defaults...
[12:54:27:100]- No potential sympathy groups found, trying to find defaults...
[12:54:27:100]- No potential sympathy groups found, trying to find defaults...
[12:54:27:100]- No potential sympathy groups found, trying to find defaults...
[12:54:27:100]- No potential sympathy groups found, trying to find defaults...
[12:54:27:100]- No potential sympathy groups found, trying to find defaults...
[12:54:27:100]- No potential sympathy groups found, trying to find defaults...
[12:54:27:100]- No potential sympathy groups found, trying to find defaults...
[12:54:27:100]- No potential sympathy groups found, trying to find defaults...
[12:54:27:100]- No potential sympathy groups found, trying to find defaults...
[12:54:27:100]- No potential sympathy groups found, trying to find defaults...
[12:54:27:100]- No potential sympathy groups found, trying to find defaults...
[12:54:27:100]- No potential sympathy groups found, trying to find defaults...
[12:54:27:101]- SIM_GetPressureGroups()->Open()...
[12:54:27:101]- Debug: closing attack manager
[12:54:27:101]- Debug: attack manager closed
[12:54:27:113]- Debug: opening attack manager
[12:54:27:113]- Debug: closing attack manager
[12:54:27:113]- Debug: attack manager closed
[12:54:27:217]- SIM_Attacks loaded
[12:54:27:222]- Debug: attack manager opened
[12:54:27:222]- SIM_GetDilemmaManager()->Initialise()...
[12:54:27:765]- SIM_GetEventManager()->Initialise()...
[12:54:28:505]- SIM_GetPolicyGroupManager()->Initialise()...
[12:54:28:511]- Initialise Scenemnager
[12:54:28:511]- Initialised Scenemnager
[12:54:28:571]- SIM_GetPolicyManager()->Initialise()...
[12:54:29:169]- Ministers Initialise...
[12:54:29:169]- No potential sympathy groups found, trying to find defaults...
[12:54:29:169]- No potential sympathy groups found, trying to find defaults...
[12:54:29:169]- No potential sympathy groups found, trying to find defaults...
[12:54:29:169]- No potential sympathy groups found, trying to find defaults...
[12:54:29:170]- No potential sympathy groups found, trying to find defaults...
[12:54:29:170]- No potential sympathy groups found, trying to find defaults...
[12:54:29:170]- No potential sympathy groups found, trying to find defaults...
[12:54:29:170]- No potential sympathy groups found, trying to find defaults...
[12:54:29:170]- No potential sympathy groups found, trying to find defaults...
[12:54:29:170]- No potential sympathy groups found, trying to find defaults...
[12:54:29:170]- No potential sympathy groups found, trying to find defaults...
[12:54:29:170]- No potential sympathy groups found, trying to find defaults...
[12:54:29:170]- No potential sympathy groups found, trying to find defaults...
[12:54:29:170]- No potential sympathy groups found, trying to find defaults...
[12:54:29:170]- No potential sympathy groups found, trying to find defaults...
[12:54:29:170]- No potential sympathy groups found, trying to find defaults...
[12:54:29:170]- No potential sympathy groups found, trying to find defaults...
[12:54:29:170]- No potential sympathy groups found, trying to find defaults...
[12:54:29:170]- No potential sympathy groups found, trying to find defaults...
[12:54:29:170]- No potential sympathy groups found, trying to find defaults...
[12:54:29:172]- PreCalcCoreSimulation...
[12:54:29:172]- Starting PreCalcCoreSimulation...
[12:54:29:896]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\engine\TextEngineUTF8.cpp,2096]]
[12:54:29:907]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\app\app_game.cpp,591]]
[12:54:29:929]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\engine\TextEngineUTF8.cpp,2096]]
[12:54:29:940]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\app\app_game.cpp,591]]
[12:54:29:941]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\engine\TextEngineUTF8.cpp,2096]]
[12:54:29:957]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\app\app_game.cpp,591]]
[12:54:29:957]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\engine\TextEngineUTF8.cpp,2096]]
[12:54:29:973]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\app\app_game.cpp,591]]
[12:54:29:974]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\engine\TextEngineUTF8.cpp,2096]]
[12:54:29:990]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\app\app_game.cpp,591]]
[12:54:29:991]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\engine\TextEngineUTF8.cpp,2096]]
[12:54:30:6]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\app\app_game.cpp,591]]
[12:54:30:7]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\engine\TextEngineUTF8.cpp,2096]]
[12:54:30:23]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\app\app_game.cpp,591]]
[12:54:30:24]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\engine\TextEngineUTF8.cpp,2096]]
[12:54:30:40]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\app\app_game.cpp,591]]
[12:54:30:41]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\engine\TextEngineUTF8.cpp,2096]]
[12:54:30:56]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\app\app_game.cpp,591]]
[12:54:30:57]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\engine\TextEngineUTF8.cpp,2096]]
[12:54:30:73]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\app\app_game.cpp,591]]
[12:54:30:74]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\engine\TextEngineUTF8.cpp,2096]]
[12:54:30:90]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\app\app_game.cpp,591]]
[12:54:30:91]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\engine\TextEngineUTF8.cpp,2096]]
[12:54:30:107]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\app\app_game.cpp,591]]
[12:54:30:108]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\engine\TextEngineUTF8.cpp,2096]]
[12:54:30:123]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\app\app_game.cpp,591]]
[12:54:30:124]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\engine\TextEngineUTF8.cpp,2096]]
[12:54:30:140]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\app\app_game.cpp,591]]
[12:54:30:141]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\engine\TextEngineUTF8.cpp,2096]]
[12:54:30:157]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\app\app_game.cpp,591]]
[12:54:30:157]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\engine\TextEngineUTF8.cpp,2096]]
[12:54:30:173]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\app\app_game.cpp,591]]
[12:54:30:174]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\engine\TextEngineUTF8.cpp,2096]]
[12:54:30:254]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\app\app_game.cpp,591]]
[12:54:30:255]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\engine\TextEngineUTF8.cpp,2096]]
[12:54:30:270]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\app\app_game.cpp,591]]
[12:54:30:270]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\engine\TextEngineUTF8.cpp,2096]]
[12:54:30:285]- Waiting for render thread [D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\engine\TextEngineUTF8.cpp,2096]]
[12:54:30:970]- 

PreCalcCoreSimulation time: 1,80 seconds


[12:54:30:970]- Calculating voter values
[12:54:31:1]- Failed to find Neuron: [0,00]:D:\programming\democracy 4\builds\Democracy4\src\_all_operating_systems\sim\SIM_Neuron.cpp 470

Dunno why it references D:\programming\democracy 4\ as there is no such directory. D4 is installed on my C: drive. I can try again on my main PC when I get access to that again, but I think this is weird. It also crashes when I try to change the graphics settings. Welp.

[0,00]

This is localization issue.

Okay, there’s a major localization issue here, because manually changing the comma and group separator symbols used by Windows fixes all of my issues. I guess I just have to live with weird symbols for now.

The issue probably exists because I am using an English (US) locale, but have customized certain elements of the locale to fit my liking. It’s not an issue for me to change these customizations according to the game’s needs, but you should probably inform new players about this?

Still is weird that D3 runs w/o any of these issues.

That said, this does fix my issues.

Aha, this explains everything, because its not happening to anybody else. What exactly have you changed? I specifically have the game force the locale to be En-US for numeric purposes (to insist on full stops and not commas). It never occurred to me that people can actually override that, and that the setlocale() stuff would not take precedence if they did.

Why writing to file and reading from file would be depending on locale at first place?
Dot is dot, comma is comma…

Also time is written as number by the way - another locale problem.
That is 00 or 000 is always written as 0 in files.

you would think so wouldn’t you :smiley: But C++ actually checks the setting for locale when formatting numbers :frowning:

So most likely third party software is messing up somewhere.

I specifically take the following steps when I set up the locale to my liking:

  1. Win Key, search for Region, go into regional settings.
  2. Click Additional Time, Date, & regional settings
  3. Click Change date, time, or number formats - under Region
  4. On the bottom of the Formats tab, click the Additional Settings… button
  5. Change the Decimal symbol to a comma (,)
  6. Change the Digit grouping symbol to a full stop (.)
  7. Done

With the above settings, I’ve never experienced any problems with any kind of software, but to play D4 I need to revert the decimal symbol to a full stop and the digit grouping symbol to a comma.

Since Windows syncs all settings to the cloud these days, these settings are indeed the same across devices. I guess setlocale(); doesn’t really help in this instance as I think I am de facto redefining the locale itself by changing these settings. So if I for example used the English (UK) locale and did these changes to the decimal and digit grouping symbols, I doubt I’d have the same issues (given that you’re forcing the US locale).

It was a long process, but we got to it in the end :slight_smile: Thank you for being so swift in your replies, especially during the holidays! Would probably not have gotten there w/o knowing what should be in the config.txt file.

And @raxo2222: If you’d call Windows OS “third party software” and define “messing up” as doing what it’s supposed to do, then yeah, you’re completely correct in your statement :stuck_out_tongue:

EDIT: I’d still like to know how this differs from D3. I’m no programmer, I work in cybersec and like to reverse engineer software rather than actually write code. It’s like with human languages: It’s easier to understand a foreign language than to be understood in that language. I guess D3 uses fixed point values?

I meant Cliffski using third-party stuff for his game.
Normally writing to file and reading from file is completely independent from locale stuff.
He must be using write/read functions from third party software that uses - one depending on locale stuff.

1 Like

Ahh, I see. Yeah, that seems like a plausible explanation :stuck_out_tongue:

annoyingly the piece of code that writes this out was not written by me and seems to use BOOST. I am investigating now, as this may be a trivial fix to remove this crapware (I never use boost myself), and use good old fashioned ordinary code…

Ok I think its fixed for good now…

To fix an issue reported earlier, the game sets the locale of the app to be EN-US so that the decimal operator is always . which the code expects. This works fine UNLESS someone has manually edited the EN-US locale to use something else. We now force the locale ‘C’ which is uneditable by the user and always uses a decimal . operator.

2 Likes

Awesome. I can’t imagine this would be a problem for many, but it’s great that you actually implemented a solution!

Honestly, the things you find reading the troubleshooting of PCs. It boggles the mind. A zero here, a comma there.