Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CommunityShaders.json is generated blank with PrivateProfilereDirector < 0.6.2 #624

Closed
matm-git opened this issue Oct 10, 2024 · 16 comments · Fixed by #735
Closed

CommunityShaders.json is generated blank with PrivateProfilereDirector < 0.6.2 #624

matm-git opened this issue Oct 10, 2024 · 16 comments · Fixed by #735
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@matm-git
Copy link

matm-git commented Oct 10, 2024

Linked issue: 536
Issue identified in CS version: 2024-09-17 VR Screen Space Reflections - RC and all following builds up to 2024-10-10
Skyrim version used: SkyrimVR
Reporting users: jepster
Reproducable: Yes, every start of the game
Initial analysis:

  1. I activate the latest CS version in MO2. I deactivate the previous shadercache and CS.json which are in a separate mod. I deactivate previous CS version and shadercache with jsons. I double check, there is no CS.json or CSUser.json left.
  2. I start SkyrimVR via MO2, some shadercache is created but it goes much faster (like 4 times faster) than normal.
  3. Sometimes the game starts, but sometimes it also freezes. If the game starts and I open CS.menu I can see that no features are shown in the CS menu. If I load a savegame the game looks very broken with grass floating. This was sometimes reported by other users.
  4. In previous versions I have been able to click on 'load config' in the CS menu. This created a new valid CS.json in the background. With the latest build this is not possible. If clicking on 'load config' the game crashes with this errorlog: https://pastebin.com/EdJdMZPn
  5. Afterwards MO2 reports an error for Community Shaders (which has also been reported by some other users): https://imgur.com/a/8liP32k

Workaround: The workaround for this is to obtain a valid CS.json and place it in overwrite or a mod \SKSE\Plugins. With the next game start the shadercache is created correctly and everything is fine.

@alandtse

This comment was marked as outdated.

@alandtse

This comment was marked as outdated.

@matm-git

This comment was marked as outdated.

@alandtse

This comment was marked as outdated.

@alandtse alandtse added help wanted Extra attention is needed good first issue Good for newcomers labels Oct 11, 2024
@matm-git

This comment was marked as outdated.

@matm-git
Copy link
Author

matm-git commented Oct 14, 2024

Documentating my analysis here as I get distracted too often. I inserted some debug logs to find out where the issue originates. Within state.cpp method Save progresses fine until the following line, stopping there:
upscaling->SaveSettings(upscalingJson);
If I comment the line (and two lines before) the method completes, but CS.json is still empty.

If I dig deeper into Upscaling::SaveSettings method (Upscaling.cpp) I can see that the flow proceeds until:
iniSettingCollection->WriteSetting(setting);

The class iniSettingCollection does not have a WriteSetting method but inherits from SettingCollectionList from CommonLibSSE NR. As this is a foundational library I do not think there is much use digging into this class.

May have to try some debug output of settings / wait or try-catch.

@alandtse
Copy link
Collaborator

Thanks. You should consider perma linking to the code in the repo so we can easily cross reference. Otherwise I gotta dig into whatever branch it's on to find the code.

@alandtse

This comment was marked as outdated.

@matm-git
Copy link
Author

Just learned something about permalinks :-)
Commenting out iniSettingCollection->WriteSetting(setting); allows the SaveSettings method to complete. But ofc CS.json remains empty.

Introducing a 5 second wait before doing any save did not help

@matm-git
Copy link
Author

I just had a fluke.
After seeing that the issue is related to the WriteSettings funtions I took a look at my modlist.
One mod caught my eye: PrivateProfileRedirector
After disabling the mod, CS.ini is created successfully. Tried it twice and worked both times.
Reactivated PrivateProfileRedirector and CS.ini is not created anymore and the game hangs.
This also explains why some people have the issue while others do not have it.

@matm-git
Copy link
Author

I saw that PrivateProfileRedirector was updated on 18th June: This update led to a lot of changes to INI processing features. Most were reimplemented to conform known specifications and assumtions based on the mod scope (Bethesda games and their mods), but the new implementation may differ from the old versions behavior. The new behavior is, hopefully, more correct.

I tested with CommunityShaders_AIO-2024-10-11T23-30Z and PrivateProfileRedirector version 0.5.3 and 0.6.2.
0.5.3: The game cannot create the CS.json and freezes
0.6.2: The game creates a CS.json, builds shaders and starts fine

So simple fix, users reporting the issue should be asked to update PrivateProfileRedirector.
Please feel free to close the issue.

@alandtse
Copy link
Collaborator

alandtse commented Oct 19, 2024

Probably should detect privateprofileredirector and either require an update or just not try to save settings.

@matm-git
Copy link
Author

I believe we can use Commonlib's LookupLoadedModByName to detect the plugin, but I am not sure how to check for the version

@alandtse
Copy link
Collaborator

No that won't do it. LookupLoadedModByName is just for plugins. PPD is a dll so we'd have to detect it onload like we detect other dlls.

We'll probably want to do a version check or something and spit out messages, etc. Might be a good first issue for someone or I might get to it.

@alandtse alandtse added the bug Something isn't working label Oct 19, 2024
@alandtse alandtse changed the title Recurring - CommunityShaders.json is generated blank, thus most shaders are not compiled CommunityShaders.json is generated blank with PrivateProfilereDirector < 0.6.2 Oct 19, 2024
@matm-git
Copy link
Author

Thank you for the hint. Feel free to ingore my attempts and implement this if you like.
I will give it a try and if something comes out of it create a PR

@alandtse
Copy link
Collaborator

No worries. You contributed enough finding out the cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants