soulsmods / ModEngine2

Runtime injection library for modding Souls games. WIP
MIT License
876 stars 157 forks source link

Elden Ring Mod Engine 2 closes immediately with very few log lines #136

Open utkugrkn opened 1 year ago

utkugrkn commented 1 year ago

Hello! I have an official copy of Elden Ring (on Steam) that I'm trying to mod. As mentioned on another issue, the mod engine immediately closes after I try launching it. I tried all the steps I could find, including using full paths, running as admin, etc. but I suspect my case is different. In the crash logs, the process never gets farther than this line:

[2023-07-29 14:22:38.192] [modengine] [info] ModEngine version 2.0.0-preview3-d673e6000e50d5c559364b6276057f6bde09accb initializing for Elden Ring
[2023-07-29 14:22:38.193] [modengine] [info] Local settings loaded: true, Global settings loaded: false
[2023-07-29 14:22:38.193] [modengine] [info] Main thread ID: 20072

In other discussions I see online, the next log line is supposed to be the following: [modengine] [info] Enabling extension base

Can anybody help me figure out why my process could be exiting before reaching here and how I can fix it?

I'm pretty confident my command in the .bat file is accurate as it's not giving any path errors anymore: "C:\Program Files (x86)\Steam\steamapps\common\ELDEN RING\Game\modengine2_launcher.exe" -t er -c "C:\Program Files (x86)\Steam\steamapps\common\ELDEN RING\Game\config_eldenring.toml" --game-path "C:\Program Files (x86)\Steam\steamapps\common\ELDEN RING\Game\eldenring.exe"

On the other hand, I don't think the process makes it as far as locating the mod file, because even with dummy paths in config_eldenring.toml I don't see any path-related errors. Here is what mine currently says:

mods = [
    { enabled = true, name = "default", path = "C:\\Program Files (x86)\\Steam\\steamapps\\common\\ELDEN RING\\Game\\mod\\randomizer" }
]

I'm on Windows 11.

Any help would be greatly appreciated!

orpheusgensui commented 1 year ago

Had this same issue. Fixed it by launching a separate instance of PowerShell (cmd works too) with the same level of elevation as Steam, and then running launchmod_eldenring.bat Double-clicking the bat file still opens a shell for a split second before closing it, and otherwise doing nothing.

arkillik commented 10 months ago

Had this same issue. Fixed it by launching a separate instance of PowerShell (cmd works too) with the same level of elevation as Steam, and then running launchmod_eldenring.bat Double-clicking the bat file still opens a shell for a split second before closing it, and otherwise doing nothing.

What do you mean by "same level of elevation"?

orpheusgensui commented 10 months ago

Sorry, got my jargon mixed up. Same level of privilege. So if you're running Steam as user, you run cmd/PowerShell as a user. If you're running Steam as an admin, you run cmd/PowerShell as an Admin.

utkugrkn commented 10 months ago

Thank you for your suggestion, @orpheusgensui. Unfortunately this did not work for me. @arkillik: did you have any luck with this?

I looked into the code a bit. It seems like pretty much right after the "Main thread" log, the program tries to load and attach extensions. Since I don't get any logs about an extension getting enabled, I suspect the issue is with loading them or reading the extension-related config, which is before trying to actually enable them.

Edit: I actually got it to work! Not fully clear what did it, but I'll add another comment later with some details.

Pachero112 commented 10 months ago

Thank you for your suggestion, @orpheusgensui. Unfortunately this did not work for me. @arkillik: did you have any luck with this?

I looked into the code a bit. It seems like pretty much right after the "Main thread" log, the program tries to load and attach extensions. Since I don't get any logs about an extension getting enabled, I suspect the issue is with loading them or reading the extension-related config, which is before trying to actually enable them.

Edit: I actually got it to work! Not fully clear what did it, but I'll add another comment later with some details.

yeah bro can u PLEASE help I really want to try out new mods but modengine2 just doesn't launch

utkugrkn commented 10 months ago

@Pachero112, yeah, while I'm still not fully sure what worked at the end I can share some steps that helped me.

  1. I gave read/write access to my User for Program Files (where my game is installed) and all the mod directories. While many mod guidelines suggest running in Admin mode for troubleshooting, that never worked for me. The reasoning might be what @orpheusgensui mentioned. Instead, I double-click on the batch file to start the game (as my default User), and it's working now.
  2. Some mods provide convenient download packages that install both ModEngine2 and the mod's files. Instead, I downloaded ModEngine2 directly from GitHub, then manually added the mod directories.
  3. As mentioned earlier, some mods have specific instructions on how to launch/troubleshoot. For example, the Randomizer mod has a graphical interface for creating the seed and launching the game, but it never launches successfully for me. So instead after creating the seed, I manually launch by double-clicking the batch file.
  4. With Convergence, a common advice is to rewrite the command written in the batch file with full directory paths. This turned out to be unnecessary in my case. I left the file as is.

Hope this helps, but it's entirely possible you're running into different issues. Let me know how it goes, and I'll also share updates if I realize I missed any significant steps.