Code Monkey home page Code Monkey logo

Comments (14)

jmquigs avatar jmquigs commented on May 24, 2024

It does actually support launchers, I use it with several games that use them, including a couple steam games and one with its own launcher. Usually it is sufficient to make sure that the ModelMod launcher is launching the main game executable, and not the game launcher. Also you can try increasing the launch time in the UI.

However there may be launchers that are using a method that MM can't detect. Does it produce any logs? If so, please attach them or email them to me.

Injecting into a pre-launched game is probably quite hard, because you'd have to swap out its D3D renderer after its been created. However there are other methods of injection which I could investigate, such as making the main modelmod.dll file be loadable as d3d9.dll (it isn't currently).

from modelmod.

FineNerds avatar FineNerds commented on May 24, 2024

Well, when I try running ModelMod with games that use a launcher, it asks me to reinstall the game. I assume this is because you have the executable running from ModelMod's binary folder? It appears that way, at least. I'm not familiar with F# so the source isn't easily readable for me.

from modelmod.

jmquigs avatar jmquigs commented on May 24, 2024

Oh, interesting. I suspect the game wants some command line flag that is passed by the launcher, and exits otherwise.

As a clunky workaround, you could try bypassing the MM launcher and using its loader process directly.

  1. In the modelmod bin folder, create a shortcut to MMLoader.exe
  2. Right click the shortcut and select "Properties", then go to "Shortcut" tab
  3. For the Target field: use something like this:
"C:\PathToModelMod\Bin\MMLoader.exe "C:\PathToGame\GameExecutable.exe" -waitperiod 60 -logfile "modelmodloaderlog.txt"
  1. For the Start in field, use the game path:
"C:\PathToGame"
  1. Click OK.
  2. Double click the shortcut. You should see the hourglass briefly, but it won't create a window. You should see "MMLoader" in your task manager process list though.
  3. Start the game as you normally would. MMLoader should try to inject once it sees the game process. It will create two files, "[game path]\modelmodloaderlog.txt", and (hopefully) "[modelmoddir]\logs\modelmod.game.exe.log.
  4. MMLoader will exit within 60 seconds if you don't start the game, or, 60 seconds after the game exits after a successful attach.

I realize this process is byzantine; I will look at ways of making this easier.

By the way, the loader (injector) is actually written in C++:
https://github.com/jmquigs/ModelMod/blob/master/MMLoader/MMLoader.cpp#L348
The F# command which starts it is here: https://github.com/jmquigs/ModelMod/blob/master/MMLaunch/ProcessUtil.fs#L139

from modelmod.

FineNerds avatar FineNerds commented on May 24, 2024

It doesn't create the modelmodloaderlog.txt, but when it properly injects it does create the game log. For one game in particular, Smite, the .dll can't attach to the process, and I think this is because it's injecting too soon. The game has a really long wait period between the the launcher and when the game actually starts, but the process is in the list. And on certain games I cannot tell what the issue with injecting the .dll is because the log file isn't being created.

from modelmod.

jmquigs avatar jmquigs commented on May 24, 2024

Ok. It may not be able to create modelmodloaderlog.txt because it can't write to the game directory. You can either run the mmloader shortcut as administrator, or, specify a full path to the output directory on the command line in the shortcut. For example

-logfile "C:\ModelModDir\Logs\modelmodloaderlog.txt"

For Smite, you can try increasing the launch time on the shortcut. For example, this would use a wait period of 5 minutes:

-waitperiod 300

Sorry this is so tedious. I am just gathering information so that I know what changes I should make to the injector.

from modelmod.

FineNerds avatar FineNerds commented on May 24, 2024

Strange. Smite ended up throwing an error, so it must have some conflicting problem. For now it will be under the incompatible list. For games such as borderlands that throw a CLR error, and then when trying to take snapshots, they don't actually do anything. Is there a fix or are they unsupported for now?

from modelmod.

jmquigs avatar jmquigs commented on May 24, 2024

Can you post the CLR error that borderlands throws?

from modelmod.

FineNerds avatar FineNerds commented on May 24, 2024

[DllMain]: Direct3DCreate9 called
[DllMain]: Starting Lazy Init
[DllMain]: Preparing for CLR launch
[DllMain]: Error: failed to copy MM app domain file from C:\Users\FineNerds\Desktop\ModelMod\Bin\ModelModCLRAppDomain.dll to C:\Program Files (x86)\2K Games\Borderlands 2 - Game Of The Year Edition\Binaries\Win32\ModelModCLRAppDomain.dll, cannot init CLR
[DllMain]: Finished Lazy Init
[DllMain]: Replacing d3d9 with hook interface

This is exactly what happens. When it highlights a model, it appears black or grey, not green. I've manually compiled and added the .dll to both directories to see if that would fix the issue, but it hasn't.

from modelmod.

jmquigs avatar jmquigs commented on May 24, 2024

Yeah, you won't be able to drop in ModelModCLRAppDomain ahead of time. For security and code freshness, I made the main injector dll make sure that only the appdomain file it expects gets copied/loaded, rather than whatever file might be lurking in the game directory.

I would guess that the copy fails because the game directory is not writable by your user. You could try running MMLoader as an administrator, it may be able to copy ModelModCLRAppDomain then.

Sounds like I need to work on this case. Perhaps add some more options for running the loader and a "inject as adminstrator" option. Previously I had it injecting as admin by default, but I disabled that because I did not think it was necessary.

from modelmod.

FineNerds avatar FineNerds commented on May 24, 2024

[DllMain]: Starting Lazy Init
[DllMain]: Preparing for CLR launch
[DllMain]: Copied app domain file into game dir
[NativeInterop]: Searching for CLR
[NativeInterop]: Found CLR runtime version v4.0.30319
[NativeInterop]: Found CLR in directory C:\Windows\Microsoft.NET\Framework\v4.0.30319
[NativeInterop]: Starting CLR
[NativeInterop]: Failed to start the clr
[NativeInterop]: unknown catastrophic error
[DllMain]: Init CLR returned: -7fffbffb
[DllMain]: Finished Lazy Init

I assume this is a sign of incompatibility?

from modelmod.

FineNerds avatar FineNerds commented on May 24, 2024

Here's a screenshot of what happens in game. https://i.gyazo.com/92326a551dc76ee77d5c7637ffe88064.jpg

from modelmod.

jmquigs avatar jmquigs commented on May 24, 2024

I've seen that error before with mass effect 1 or 2. Unfortunately nothing will work without the CLR. I hope to add support for the CoreCLR at some point in the future, which may fix this issue - or at least allow me to debug it, since the CoreCLR is open source. I actually traced into the assembly at one point to try to debug this, but it didn't go well.

Do you know if you are using the version of Borderlands that uses SecuROM? I suspect that software interferes with CLR launch. MassEffect supposedly disabled it for the Steam version, but I know that some part of it is still in there from stack traces that I saw while in the debugger.

Anyway I'm going to open up a couple bugs for the injection issues you found, since really the launcher should be able to handle those cases.

Thanks for trying it out! Your feedback is very useful.

from modelmod.

FineNerds avatar FineNerds commented on May 24, 2024

I'm not sure if I was or not. And no problem, I really like what this
project can do :)
On Mar 23, 2016 5:16 PM, "John Quigley" [email protected] wrote:

I've seen that error before with mass effect 1 or 2. Unfortunately nothing
will work without the CLR. I hope to add support for the CoreCLR at some
point in the future, which may fix this issue - or at least allow me to
debug it, since the CoreCLR is open source. I actually traced into the
assembly at one point to try to debug this, but it didn't go well.

Do you know if you are using the version of Borderlands that uses SecuROM?
I suspect that software interferes with CLR launch. MassEffect supposedly
disabled it for the Steam version, but I know that some part of it is still
in there from stack traces that I saw while in the debugger.

Anyway I'm going to open up a couple bugs for the injection issues you
found, since really the launcher should be able to handle those cases.

Thanks for trying it out! Your feedback is very useful.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#4 (comment)

from modelmod.

jmquigs avatar jmquigs commented on May 24, 2024

Going to close this since I made tickets for the discovered issues.

from modelmod.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.