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

Cyberpunk full support #105

Merged
merged 16 commits into from
Oct 15, 2023
Merged

Cyberpunk full support #105

merged 16 commits into from
Oct 15, 2023

Conversation

ZashIn
Copy link
Contributor

@ZashIn ZashIn commented Nov 19, 2022

Current state and workarounds (to be integrated) are described in the wiki page for Cyberpunk 2077

Features

Implemented features in this plugin update

  • profile specific config (.ini)
  • profile specific savegames, based on Add BasicLocalSavegames (basic_feature) #122
  • savegame preview & metadata, based on Add metadata to BasicGameSaveGameInfo(Widget) #109
  • Auto mod installation (ModDataChecker): see table below
    • RedMod: auto deployment before game launch, with load order from MO
  • Auto framework installation
    • redscript
    • RED4ext & CET: get moved into root to be either copied manually into game install dir or automatic via RootBuilder
  • Sync mod settings back to mods (some are currently saved to overwrite, since config files get created after game launch)
  • Enforce MOs load for .archive (archive/pc/mod/modlist.txt) and REDmod (-modlist)
  • RootBuilder config: working default config set automatically (once)

Mod support

Here is an overview of the mod / framework support as of MO 2.5 beta 14 (Cyberpunk game plugin v2.1) and the compatibility with MOs virtual file system USVFS:

Support: mods / framework
Mod type / framework Mod folder (files) Auto install* USVFS
archive archvie/... (.archive) ✔️/ – ✔️/ –
redscript r6/... (.reds) ✔️/✔️ ✔️/✔️
RED4ext red4ext/... (.dll) ✔️/✔️root ✔️/❌*
Cyber Engine Tweaks (CET) bin/x64/plugins/... (.lua) ✔️/✔️root ✔️ 1.27 / ❌*
REDMod mods/* (info.json, ...) ✔️/❌(DLC) ✔️/❌(DLC)

root: Auto install only into (virtual) root folder, compatible with RootBuilder (copy/hardlink). Alternative: copy manually into game dir.

* Remarks

  • RED4ext: Only the framework (2 .dll files) need to be copied / hard linked to root, dependent mods work with USVFS then.
  • Cyber Engine Tweaks (CET):
    • Cyberpunk v2.01, CET ≥1.27: only CET framework needs to be copies / hard linked into root (all files), mods work with USVFS.
    • Cyberpunk v1.x, CET ≤1.26: is not compatible with USVFS, see CET issue / PR for details.
  • RedMod: precompilation is now supported
  • RootBuilder can be used to automate hard linking / coping root files into game dir (only frameworks RED4ext and CET, no mods)

Tested with:

  • Cyberpunk 2077 v2.01
  • MO v2.5.0 beta 12+
  • RootBuilder 4.4 (copy mode) and 4.5 (hard link mode)

Related issues:

@ZashIn ZashIn changed the title fix: Cyberpunk ini files (path) WIP: full Cyberpunk support Apr 24, 2023
@ZashIn
Copy link
Contributor Author

ZashIn commented Apr 24, 2023

I have repurposed this PR to the full Cyberpunk support update (WIP), since I forgot to split the the commits into a separate branch after the initial fix (first commit) for the ini files errror.
Added status update in the first comment.

@ZashIn ZashIn changed the base branch from qt6 to master July 15, 2023 21:48
@ZashIn ZashIn force-pushed the cyberpunk branch 2 times, most recently from 06141cc to b43557d Compare September 28, 2023 20:17
@ZashIn
Copy link
Contributor Author

ZashIn commented Sep 28, 2023

With hard links only mode from the upcoming RootBuilder update (Kezyma/ModOrganizer-Plugins#13) everything should work, except Redmods (still needs manual precompilation).
Although this basically disables UVFS completely and use only hard links as a workaround.

@Holt59
Copy link
Member

Holt59 commented Sep 29, 2023

I'm not sure I want to include in basic games a game plugin that heavily depends on a third-party plugin. Maybe the best option here would be to make your third-party plugin for Cyberpunk. Note that you should still be able to use basic games feature, you simply need to change the relative imports.

@ZashIn
Copy link
Contributor Author

ZashIn commented Oct 7, 2023

CET v1.27 for Cyberpunk 2.01 added a compatibility fix for USVFS, which requires only the frameworks CET and Red4ext to be copied / hard linked into game root.
So except for Redmod, all mods should work with USVFS.

Will update the PR after some testing.

@ZashIn
Copy link
Contributor Author

ZashIn commented Oct 7, 2023

Updated to work with CET v1.27 (Cyberpunk 2.01).
I removed the RootBuilder config and incomplete redmod handling for now.

As described in the wiki, CET and RED4ext frameworks need to be copied or hard linked into root.
Except for redmod, all other mods should work then with USVFS: archive, redscript, CET and RED4ext.

Based on #122 and #109, so they should be merged first.

Copy cache files to overwrite before game start to catch file overwrites.

Fix wrong log message (onAboutToRun, qInfo)
Generating archive/pc/mod/modlist.txt from MOs load order
(enforce_archive_load_order=True by default)
- auto_deploy_redmod = True (default)
  Deploy redmod before game launch if necessary
- enforce_redmod_load_order = True (default)
  Enforce the current load order on redmod deployment

Clears the deployed files when not needed or for redeploy
on load order change.
@ZashIn
Copy link
Contributor Author

ZashIn commented Oct 13, 2023

Added REDmod support with auto precompilation in MOs load order.
Still not quite sure about best RootBuilder config (or whether to include one at all). See also Kezyma/ModOrganizer-Plugins#18

Applied once (setting "configure_RootBuilder") on UI init or RB enabled
@ZashIn
Copy link
Contributor Author

ZashIn commented Oct 14, 2023

If RootBuilder is installed, compatible default settings are now applied.
The minor RootBuilder bug with hard link mode is (more or less) already fixed in latest release 4.5.2, Even without the fix, everything works, just some file conflicts with duplicated framework files in overwrite can show up after REDmod precompilation.
Copy mode works and is fallback for earlier versions anyways.

Only thing left might be to check redmod.exe exit code, and abort game launch on fail.

@ZashIn ZashIn changed the title WIP: full Cyberpunk support Cyberpunk full support Oct 15, 2023
@ZashIn
Copy link
Contributor Author

ZashIn commented Oct 15, 2023

PR ready for merge.

@Holt59 Holt59 merged commit cf2a700 into ModOrganizer2:master Oct 15, 2023
1 check passed
@Lhyris
Copy link

Lhyris commented Oct 15, 2023

Giving your plugin a try, but a small annoyance is that supplementary files, such as .png files, will throw off the move= part of the GlobPatterns. So far I've tried this with Wingdeer's Hair Collection mod, but any .zip that contains more than just the .archive, will require manual adjusting during installation. Could you look into this please? :)

@ZashIn
Copy link
Contributor Author

ZashIn commented Oct 16, 2023

@Lhyris can you test this fix, accepting basically all extra files: cyberpunk-v2.2.2

@death0serpent
Copy link

death0serpent commented Aug 11, 2024

Is there any comprehensive and up-to-date guide that will help me successfully set up MO2 for CP2077 step-by-step?!

@ZashIn
Copy link
Contributor Author

ZashIn commented Aug 11, 2024

The Cyberpunk wiki is up to date, although a bit technical.
But the basic setup is quite easy: you just need to install the requirements CET and RED4ext either manually (see Framework installation) into game folder or via RootBuilder (install the MO2 extension, then you can just add CET and RED4ext as normal mods within MO2).
It only can get complicated with for load order etc., but I tried to cover that in the wiki.

All other mods should then install and work automatically in MO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants