originalnicodr / CinematicUnityExplorer

UnityExplorer mod fork focused on providing tools for creating marketing material for Unity games.
GNU General Public License v3.0
113 stars 11 forks source link

[Bug] DREDGE gets stuck on mainmenu after the new controller support update #77

Open originalnicodr opened 5 months ago

originalnicodr commented 5 months ago

Are you on the latest version of CinematicUnityExplorer?

Which release are you using?

MelonLoader Mono

Which game did this occur on?

DREDGE

Describe the issue.

For some reason, when adding other nugget packages and DLLs to the project, the game gets stuck on the main menu (despite being able to fully load Cinematic Unity Explorer).

However, at least in the case of SharpDX (the library being used for controller support), MelonLoader complained about missing dependencies. There are the following (with .csproj formatting):

  <ItemGroup>
    <Reference Include="Accessibility">
      <HintPath>$(windir)\Microsoft.NET\Framework64\v2.0.50727\Accessibility.dll</HintPath>
    </Reference>
    <Reference Include="System.Deployment">
      <HintPath>$(windir)\Microsoft.NET\Framework64\v2.0.50727\System.Deployment.dll</HintPath>
    </Reference>
    <Reference Include="System.Runtime.Serialization.Formatters.Soap">
      <HintPath>$(windir)\Microsoft.NET\Framework64\v2.0.50727\System.Runtime.Serialization.Formatters.Soap.dll</HintPath>
    </Reference>
    <Reference Include="System.Windows.Forms">
      <HintPath>$(windir)\Microsoft.NET\Framework64\v2.0.50727\System.Windows.Forms.dll</HintPath>
    </Reference>
  </ItemGroup>

And when including these, that being on the UserLib folder or repacking them with the main mod DLL, the game would load just fine.

Since this problem was only present in this game I decided to merge the controller support branch into the main one. If this comes up with another game I will consider adding these DLLs with the releases, but I would need to research that including them wouldn't cause incompatibility with other games.

If you want to use this mod with DREDGE, for now, I suggest looking up these DLLs on your PC (after installing net framework) and putting them in the UserLib folder inside the main game folder. That should get this going.

Relevant log output

No response

etra0 commented 3 weeks ago

I don't know if this issue has been raised for any other game, but have you thought on binding the Windows API for controllers instead? It might be an alternative to have a third party dependency that can cause issues.

originalnicodr commented 3 weeks ago

Forgot to mention, because of other problems these changes brought I reverted this PR on cc34a50e21ca86b8941c735a3c1c68db60481a8b, but the changes are still alive on the controller-support branch.

I am not sure what Windows API you are referring to specifically. Since I have some very old .NET versions being supported in this repo I don't really know if I am even able to use modern XInput APIs.

So, if you happen to have some references I would love to give them a look!

etra0 commented 3 weeks ago

I meant manually binding to the Windows API regarding xinput, since in .net you can bind to c functions, but that would involve a bit of boilerplate to write. It is just a suggestion in case this causes too much trouble but otherwise I'd advise against it.

Basically what we did for igcsdof is to bind to a C dll, you can do the same with windows api itself! since xinput is available system wide.