maximegmd / CyberEngineTweaks

Cyberpunk 2077 tweaks, hacks and scripting framework
MIT License
4.48k stars 284 forks source link

[Improvement Wiki] - Updated instructions (again) for Steam Deck/Linux users (Proton) #821

Closed Deytron closed 1 month ago

Deytron commented 1 year ago

I don't know if this is the right place for that, feel free to close the issue and move it if needed

Starting with Proton 8.0, Linux users don't need to do anything with protontricks anymore, as it looks like included libraries with newest Wine versions work properly now. What's left is just the DLL override.

New instructions

Make sure you've installed Cyber Engine Tweaks with your preferred mod manager, or manually (not recommended). You can find guides on the Internet to mod Cyberpunk 2077 on your machine

If you bought the game on Steam

WINEDLLOVERRIDES="version=n,b" %command%

If you plan on using Red4ext, which is necessary for a lot of mods, you will also need to add something:

WINEDLLOVERRIDES="version=n,b;winmm=n,b" %command%

If you bought the game on GOG

image

That's pretty much it. Right when launching the game, you should get a prompt to bind a key for the menu.

C0rn3j commented 1 year ago

Not true at least on Proton_GE 8-2, haven't tested with pure Proton.

NOTES: You will also need to install d3dcompiler_47 with winetricks to get it to work now, contribution on how to do this would be much appreciated!

This line should be replaced with the following:

protontricks 1091500 d3dcompiler_47

Deytron commented 1 year ago

Well this is strange.

I decided to test again by nuking my Cyberpunk prefix. Now using Lutris-GE-Proton8-5.

I tried to launch the game without overriding the version dll. Game launched, but without CET (menu wouldn't open by pressing the corresponding key). I added the override and boom, worked perfectly. No need to use Protontricks at all. I don't know what could have happened on your side. Make sure you have a clean install of the game before installing CET or any mod.

Hearthing commented 1 year ago

I followed these instructions for OpenSUSE and I still can't get the console to load when I launch the game for some reason. I also don't have a .log or .config file in my CET folder. Clean install as well using Proton 8.0-2.

WSSDude commented 1 year ago

version.dll override is redundant when you rename it to bink2w64.dll and rename former bink2w64.dll to bink2w64Hooked.dll.

Would probably mention this as it is easier to setup right.

Installing VC++ 2022 redistributable through protontricks may help some cases, but just renaming version.dll seems to do most heavy lifting.

Installing VC++ 2019 redistributable is an error if someone does that... Either get rid of the redist or try installing VC++ 2022 one on top.

WSSDude commented 1 year ago

Pinned this instead of the older issue for now, should be unpinned and closed when wiki updates.

teleprint-me commented 1 year ago

vcrun2022 crashes the game and won't run for me. vcrun2019 worked like a charm. I did a clean run for each trial. So, stating vcrun2019 or 2022 as a valid solution seems like a misnomer. They're just libraries, so having an idea of what dep versions would help if it's an option.

WSSDude commented 1 year ago

They are not" just libraries", CET is compiled with VS2022 and requires VC++ 2022 runtime for correct execution. VC++ 2019 was proven more than few times to cause issues. Default wrappers for these in proton seem to work just fine for most though (hence why renaming of version.dll may be sufficient without installing any redists)

Unless you pirate and use older CET builds of course... In that case, 2019 runtime will be needed. But that runtime is wrong in context of any CET made in like past year if not more at this point in time.

teleprint-me commented 1 year ago

What logs would help to identify and clarify my situation?

I'm using official steam runtime with the official game with latest updates. I have all my deps, latest drivers, software, and latest distribution.

This isn't my first rodeo.

Believe it or not, Linux users are less likely to pirate than Windows users. The presumption seems unnecessary as well as out of context.

I've written enough software to understand the difference between a library and a runtime. The runtime will install the VC deps as a result. So, if I see a file with an extension such as dll, so, a, etcetera, it's a library to me. I'm looking for the dep that will allow the binary to execute as a result.

It's possible the runtime fails due to conflicts with different versions being installed simultaneously or one had a reference that is missing or overrides something else.

I haven't dug into the code, just offering my experience, observation, and outcomes.

WSSDude commented 1 year ago

Btw, not necessarily trying to point fingers with that pirate thing, there may be something weird going on in proton (it is a piece of HL emulation sort of, there may be some other issue in the background) but it is first thing that comes to mind at least why one works and one doesnt.

WSSDude commented 1 year ago

I honestly dont have that much experience debugging proton issues so this is a bit hard for me to tell (what logs etc. could be useful).

Did you try to instal VC++2022 runtime specifically or the 2015-2022 combo pack?

Would give the combo of 2015-2022 redists a go if you had not tried with that one, believe that is the one linked in troubleshooting also.

WSSDude commented 1 year ago

Hm, I actually cant even find a link from microsoft for standalone VC++ 2022, only the combo of multiple redists when I try to download latest one :suspect:

https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#visual-studio-2015-2017-2019-and-2022

What is everyone downloading and installing lol, now I'm curious...

teleprint-me commented 1 year ago

I tried every option according to the official wikis, docs, etcetera. The rest was just intuiting the process.

I initially missed the new prerequisite, so that threw me off.

I already documented my process and posted it in iss #829 .

I initially went for 2019 because of previously documented results and decided to try out 2022 once I ironed out the process and it failed, as I originally stated earlier.

Considering the issue seems to be in getting imgui and cet to launch as an overlay and it requires certain bins and libs to be present, it makes sense that there's not much to go off of.

When I have some time, I'll run it with the proton log env variable set and see if any comes up. I'm currently tied up in a bunch of stuff, otherwise I would just dig into it.

FYI, I have incredibly surface level knowledge on proton. I haven't spent much time using wine or related tools, but wanting to use CP2077 mods changed that, so I've been picking stuff up here and there over time. Slowly familiarizing myself with the prereqs, tools, libs, etcetera. It's been around for awhile and is big and complex, so it's all good. No worries. We work with what we have and do what we can in the mean time.

teleprint-me commented 1 year ago

As for the 2022 dist, there's a loader built into wine components which downloads and runs the setup exes for the runtime installers.

WSSDude commented 1 year ago

Hm, I would probably just try to use official installer under the same wine prefix CET and CP77 are installed if that doesn't change something. Unsure now what exactly is getting installed that way (which exact toolset version the DLLs correspond to, nor if they are copies of real ones) but this could rule out at least DLL version mismatches I hope.

teleprint-me commented 1 year ago

We do things on Linux very differently. We usually don't download random stuff and we're very picky about our pipelines.

Usually, the downloader will handle anything for you, winetricks components installer in our case, and you follow any neccessary prompts until you get the build or exe to run.

Loaders will, in 99% of cases (there are exceptions and take the percentage as an embellished exaggeration) download and install the official binary from the official source which is verified via public auditing.

The rationale is to validate integrity and allow for repeatable actions (e.g. it would work the same across different hardware, distros, and software stacks ideally).

My install will break at some point, I'm in the middle of looking for a mod that breaks my setup, so I'll take screen shots of the process to give you guys a visual. If I have time, I'll do a screen recording.

teleprint-me commented 1 year ago

Since wine runs apps in a contianer, it's usually better to let the authoring software hande it for you to avoid breakage, conflicts, mangled setups, etcetera.

It's also the same pipeline Steam and Valve are using, so it should be compatible in most cases.

kainzilla commented 1 year ago

version.dll override is redundant when you rename it to bink2w64.dll and rename former bink2w64.dll to bink2w64Hooked.dll.

This single line was the ticket for me - I've set WINE DLL overrides plenty of times before and I know what I'm doing, and for some reason Cyberpunk 2077 absolutely would not load the version DLL while it was named version but worked instantly when I performed this renaming step.

Additional notes in case it helps others:

If you are trying to solve this same problem and you need to clear your WINE prefix, be sure to rename it to a .bak folder in case you need to grab your save games or configuration files, as those are stored in the prefix. Steam Cloud covers saves but not game configuration.

Here's an example command to move the prefix folder for Steam users (Lutris users would need to move a different folder):

mv $HOME/.local/share/Steam/steamapps/compatdata/1091500/pfx $HOME/.local/share/Steam/steamapps/compatdata/1091500/pfx.bak

Thank you for posting this!

kaosimian commented 1 year ago

version.dll override is redundant when you rename it to bink2w64.dll and rename former bink2w64.dll to bink2w64Hooked.dll.

this is what solved my issues too. I stayed on proton experimental, didn’t make any other changes apart from a clean install of the new cet version

teleprint-me commented 9 months ago

I had to do a fresh install, so I wanted to try out renaming version.dll and bink2w64.dll. Renaming it did not work for me at all. I made multiple attempts at this before giving up. It's possible I did something wrong here, but the process seems straightforward enough.

I did figure out all we need to do is add version and d3dcompiler_47. I got it working without installing vsrun2019 or vsrun2022 and completely skipped the process. There's an extra step that simply requires checking off d3dcompiler_47 and that's it.

GrabbenD commented 4 months ago

Thank you a ton!!

REDscript/RED4ext/TweakXL

REDmod

REDmods (mods/) needs to be compiled and this can be done either by:

WSSDude commented 1 month ago

Any changes to the wiki should be discussed on Discord. It can be edited by anyone, there is an invite link.

Closing this as this is ancient and current Linux guides there should cover it all. If they dont, as said, there is an invite on Discord. Can do/discuss changes going from there.