-
Notifications
You must be signed in to change notification settings - Fork 32
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
Added fix for Gothic Playable Teaser #141
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
"""Game fix for Gothic Playable Teaser""" | ||
|
||
from pathlib import Path | ||
from protonfixes import util | ||
from protonfixes.logger import log | ||
|
||
|
||
def main() -> None: | ||
"""Performance fixes and cleanup of excessive logs""" | ||
modify_settings() | ||
clear_logs() | ||
|
||
|
||
def modify_settings() -> None: | ||
# Assure that the settings folder exists | ||
path = Path('GothicRemake/Saved/Config/WindowsNoEditor/') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For sanity, I would use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't we make sure we are in the right directory before running the fix? This would make all fixes cleaner, easier to read and implement. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should continue depending on the client to change to the correct directory and in the case of Steam, it's There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the context of this fix, I think it would be better to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, but yeah. Maybe there should be a prerequisite before applying any fixes if some are going to be manipulating or creating files. Perhaps we can skip applying Steam fixes all together if |
||
if not path.is_dir(): | ||
log.info(f'Creating settings folder "{path}".') | ||
path.mkdir(parents=True, exist_ok=True) | ||
|
||
# Assure, that the settings file exists | ||
# Necessary defaults will still be created by the game | ||
path = path / 'Engine.ini' | ||
if not path.is_file(): | ||
log.info(f'Creating empty settings file "{path}".') | ||
path.touch(exist_ok=True) | ||
|
||
# Disable excessive (as in gigabytes) logging | ||
# Disable motion blur / depth of field / lens flare | ||
game_opts = """ | ||
[Core.Log] | ||
Global=off | ||
LogInteractiveProcess=all off | ||
|
||
[SystemSettings] | ||
r.MotionBlur.Max=0 | ||
r.MotionBlurQuality=0 | ||
r.DefaultFeature.MotionBlur=0 | ||
r.DepthOfFieldQuality=0 | ||
r.LensFlareQuality=0 | ||
""" | ||
util.set_ini_options(game_opts, path, 'utf-8', 'game') | ||
|
||
|
||
def clear_logs() -> None: | ||
# Clear all logs > 10 MB | ||
log_files = Path('GothicRemake/Saved/Logs').glob('*.log') | ||
for file in log_files: | ||
file_size = file.stat().st_size # Bytes | ||
file_size = file_size // 1000 // 1000 # Megabytes | ||
if file.is_file() and file_size > 10: | ||
log.info(f'Removing log file "{file}" with a size of {file_size} MB.') | ||
file.unlink() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard to say if we should do this. Clearing the logs would be a plus, but wouldn't make the game more playable compared to the
modify_settings
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, though, I would want the logs removed to save some space. 1GB+ of generated logs would be a problem for me and I'd hate it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thinking was to "fix" what the game was doing wrong. So it could be seen as a kind of "game fix." 😊
It's pretty unlikely to cause any harm, but it might also be seen as outside the scope of what we're aiming for.