rockerbacon / modorganizer2-linux-installer

An easy-to-use Mod Organizer 2 installer for Linux
GNU General Public License v3.0
956 stars 77 forks source link

Cyberpunk 2077 support #370

Open mattcaron opened 2 years ago

mattcaron commented 2 years ago

Creating an issue to track a feature I'm going to try to implement this weekend - adding support for Cyberpunk 2077 to the installer.

According to the (release notes)[https://github.com/ModOrganizer2/modorganizer/releases/tag/v2.4.0] Cyberpunk 2077 has been supported since 2.4.0. Since 2.4.4 is currently installed, this should be as simple as adding the game's .sh file and menu entries to the installer and submitting a PR.

If anyone wants to chime in with advice, here there be dragons warnings, etc. feel free, as I am new to this codebase.

mattcaron commented 2 years ago

I have the installer working but, unfortunately, starting the program (no mods installed) from MO2 gives the dreaded "2077 has flatlined" error.

I will dig into this more later this weekend.

jake770321 commented 2 years ago

I'm a bit late with this so i'm not sure if this'll still be useful to you https://github.com/rockerbacon/modorganizer2-linux-installer/issues/291#issuecomment-1013203823 These were the steps given to me by rockerbacon to add support for new games.

mattcaron commented 2 years ago

Yeah, I figured those out via judicious use of grep. Now I just need to stop it from flatlining. Feels like a proton thing. Time to put on some Johnny Mnemonic and start digging, choom.

mattcaron commented 2 years ago

So, this is not ready for a PR yet, but here is the current state of code:

https://github.com/rockerbacon/modorganizer2-linux-installer/compare/master...mattcaron:modorganizer2-linux-installer:add_cyberpunk_2077_support

And here's where I'm stuck.

Before install, I'm using Proton 6.3-8, as recommended. Click play on steam, starts launcher, click play in launcher, game starts and runs.

After install, I click play on Steam, MO2 starts, I set everything up first time run, correct the launcher to use _REDprelauncher.exe, click play, launcher starts, click play in launcher, launcher disappears, then I get the standard "you've flatlined" dialog when 2077 crashes.

If I go into .steam/steam/steamapps/common/Cyberpunk 2077 and replace REDPrelauncher.exe with _REDPrelauncher.exe, then click play on steam, it works as it does originally - no issues.

So, this is what has me confused - the integration works by hijacking what is hardcoded into Steam to launch so MO2 launches in that prefix, and then MO2 (which thinks its running in Windows) is quite happy to run the game, right? Everything should work, because it works when not launched via MO2. So why doesn't it work when launched via MO2?

Any insight would be appreciated - I'm going to actually play some games, then try some more tomorrow.

ksangers commented 1 year ago

@mattcaron I tried your branch today, and it seems to work just fine for me. I did have to adjust the executable of Cyberpunk to "...\steamapps\common\Cyberpunk 2077\_REDprelauncher.exe" (it didn't have the underscore). You might want to try it out again.

Edit: Add missing path delimiter.

mattcaron commented 1 year ago

@ksangers I assume you mean "...\steamapps\common\Cyberpunk 2077_REDprelauncher.exe" (note the additional path delimiter), because I don't have anything at the exact path you list.

Now, that said, I did try it (after 1.6 update) and the behavior is still the same.

Further, it's worth mentioning - with the release of REDmod and official mod support, is MO2 a better experience?

I haven't had a change to try REDmod so I can't answer this, but I feel the question is worth asking.

ksangers commented 1 year ago

@mattcaron You are correct on the invalid path, my bad.

I'm not sure about it being a better experience. As far as I understand the new REDmod feature, MO2 is currently still more complete. Most mods on Nexus mods have not yet been converted to the REDmod format. If I understand REDmod: it does not (yet) support changes outside of scripts, tweaks and sounds.

ksangers commented 1 year ago

After further testing, I noticed that I still had some leftover mods outside of MO2. CET only appears to load when copied in manually, and it requires to be reloaded each time. So… pretty spotty functionality all in all.

poperigby commented 1 year ago

Any progress on this?

mattcaron commented 1 year ago

I haven't worked on it any further. It should work, it doesn't, and I can't figure out why.

Now, that said, I haven't tried it with 1.61.

poperigby commented 1 year ago

Thanks for trying to get it to work. I wonder if it would be easy to make it work with Vortex.

Azurion42 commented 1 year ago

@ksangers I assume you mean "...\steamapps\common\Cyberpunk 2077_REDprelauncher.exe" (note the additional path delimiter), because I don't have anything at the exact path you list.

Now, that said, I did try it (after 1.6 update) and the behavior is still the same.

Further, it's worth mentioning - with the release of REDmod and official mod support, is MO2 a better experience?

I haven't had a change to try REDmod so I can't answer this, but I feel the question is worth asking.

From my experience with REDmod and modifying 2077, it'll work fine so long as you're not doing anything with RED4EXT, but throw that into the mix and your game will flatline, so I don't use REDmod at all. And it's not like it's much harder to drop everything in the original mod folder.

rockerbacon commented 7 months ago

master...mattcaron:modorganizer2-linux-installer:add_cyberpunk_2077_support

And here's where I'm stuck.

Before install, I'm using Proton 6.3-8, as recommended.

Has anyone tried this patch with a more recent version of the installer and/or Proton?

LethalManBoob commented 3 months ago

How has this not been added yet?

urrrr... pls :3

edit: oh yes and btw it doesnt work. it cant find the modmanager

jSQrD-dev commented 2 months ago

So, this is not ready for a PR yet, but here is the current state of code:

master...mattcaron:modorganizer2-linux-installer:add_cyberpunk_2077_support

And here's where I'm stuck.

Before install, I'm using Proton 6.3-8, as recommended. Click play on steam, starts launcher, click play in launcher, game starts and runs.

After install, I click play on Steam, MO2 starts, I set everything up first time run, correct the launcher to use _REDprelauncher.exe, click play, launcher starts, click play in launcher, launcher disappears, then I get the standard "you've flatlined" dialog when 2077 crashes.

If I go into .steam/steam/steamapps/common/Cyberpunk 2077 and replace REDPrelauncher.exe with _REDPrelauncher.exe, then click play on steam, it works as it does originally - no issues.

So, this is what has me confused - the integration works by hijacking what is hardcoded into Steam to launch so MO2 launches in that prefix, and then MO2 (which thinks its running in Windows) is quite happy to run the game, right? Everything should work, because it works when not launched via MO2. So why doesn't it work when launched via MO2?

Any insight would be appreciated - I'm going to actually play some games, then try some more tomorrow.

I haven't worked on it any further. It should work, it doesn't, and I can't figure out why.

Now, that said, I haven't tried it with 1.61.

Have you looked at the updated Cyberpunk Wiki Entry on the MO2 GitHub?

mattcaron commented 2 months ago

Have you looked at the updated Cyberpunk Wiki Entry on the MO2 GitHub?

I have had neither the time nor the inclination. I've actually pretty much stopped playing video games in favor of TTRPGs and miniature wargames, so I don't know if I will ever get to it.

If someone wants to take my code as a starting point and build off it, feel free. Such things are not precious to me.