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

[Windows, Linux][x64] UnderRail #3

Open
0x0ade opened this issue Sep 15, 2017 · 8 comments
Open

[Windows, Linux][x64] UnderRail #3

0x0ade opened this issue Sep 15, 2017 · 8 comments

Comments

@0x0ade
Copy link
Owner

0x0ade commented Sep 15, 2017

URL: https://www.gog.com/game/underrail

[Optional] Game Version: GOG 1.0.2.4

XnaToFna Version: 17.09.1 devbuild

Windows: playable with no bugs
Linux: heavy bugs (See discussion)

XnaToFna arguments: --content Data --remove-public-key-token sfmlnet-audio-2 --remove-public-key-token sfmlnet-window-2 --skip-xnb

Description: I haven't played the game enough yet, but from my short tests, it's bug-free.

Changes required:

Screenshots:

@HK47196
Copy link

HK47196 commented Oct 30, 2017

Doesn't appear to work with the latest build of XnaToFna available, on Linux with Mono anyways. I compiled it manually, but I get an error converting the data

[ERROR] FATAL UNHANDLED EXCEPTION: Microsoft.Xna.Framework.Content.ContentLoadException: Could not find ContentTypeReader Type. Please ensure the name of the Assembly that contains the Type matches the assembly in the full type name: Microsoft.Xna.Framework.Content.ListReader`1[[Microsoft.Xna.Framework.Rectangle, Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553]] (Microsoft.Xna.Framework.Content.ListReader`1[[Microsoft.Xna.Framework.Rectangle, FNA, Version=17.10.0.0, Culture=neutral, PublicKeyToken=null]])
  at Microsoft.Xna.Framework.Content.ContentTypeReaderManager.LoadAssetReaders (Microsoft.Xna.Framework.Content.ContentReader reader) [0x00268] in <21dda9a9fc49466bbb558e6527d7810f>:0 
  at Microsoft.Xna.Framework.Content.ContentReader.InitializeTypeReaders () [0x0000c] in <21dda9a9fc49466bbb558e6527d7810f>:0 
  at Microsoft.Xna.Framework.Content.ContentReader.ReadAsset[T] () [0x00001] in <21dda9a9fc49466bbb558e6527d7810f>:0 
  at Microsoft.Xna.Framework.Content.ContentManager.ReadAsset[T] (System.String assetName, System.Action`1[T] recordDisposableObject) [0x0023e] in <21dda9a9fc49466bbb558e6527d7810f>:0 
  at Microsoft.Xna.Framework.Content.ContentManager.Load[T] (System.String assetName) [0x00074] in <21dda9a9fc49466bbb558e6527d7810f>:0 
  at XnaToFna.ContentHelper.TransformContent (System.String path) [0x00045] in <2c86ec2bb97f4628941f1bfa4df5a08b>:0 
  at XnaToFna.ContentHelper.UpdateContent (System.String path, System.Boolean patchXNB, System.Boolean patchXACT, System.Boolean patchWindowsMedia) [0x00017] in <2c86ec2bb97f4628941f1bfa4df5a08b>:0 
  at XnaToFna.XnaToFnaUtil.<UpdateContent>b__62_0 () [0x00022] in <2c86ec2bb97f4628941f1bfa4df5a08b>:0 
  at XnaToFna.ContentHelperGame.Initialize () [0x00026] in <2c86ec2bb97f4628941f1bfa4df5a08b>:0 
  at Microsoft.Xna.Framework.Game.DoInitialize () [0x0000f] in <21dda9a9fc49466bbb558e6527d7810f>:0 
  at Microsoft.Xna.Framework.Game.Run () [0x00016] in <21dda9a9fc49466bbb558e6527d7810f>:0 
  at XnaToFna.XnaToFnaUtil.UpdateContent () [0x0006a] in <2c86ec2bb97f4628941f1bfa4df5a08b>:0 
  at XnaToFna.Program.Main (System.String[] args) [0x00538] in <2c86ec2bb97f4628941f1bfa4df5a08b>:0 

Going to guess an error on my end likely due to my lack of knowledge in compiling mono programs, so I'll give an update when a new XnaToFna build is available.

BTW — It seemed to convert the locale folder, but it's huge(~20GB!)

@0x0ade
Copy link
Owner Author

0x0ade commented Oct 30, 2017

Since a few commits ago, XnaToFna tries to update .xnbs. Judging from the stack trace, the way mono behaves prevents FNA from accessing the content readers properly.

What version of Mono are you using? Maybe a Mono update can fix it, otherwise I'll need to work around this issue when using Mono.

For now, you can disable the XNB transformer by passing --skip-xnb

@HK47196
Copy link

HK47196 commented Oct 30, 2017

Thanks for the speedy reply.

mono --version
Mono JIT compiler version 5.4.0.201

--skip-xnb seemed to run without errors, but running the game itself just black screens though, no errors.
Interestingly, it works fine under wine with wine-mono. Wine seems to use version 4.7.1 of mono, closest native version I could find was 4.8 and I got the same issue as before.

@0x0ade
Copy link
Owner Author

0x0ade commented Oct 30, 2017

You need to apply more changes than the ones in the main post for Linux 😅 After all, this issue is a progress issue for Windows... lemme change that.

This archive contains a WIP copy of my current UnderRail setup, containing SFML2 for Linux x64, the matching .dll.config for the .NET bindings and an underrail.sh to launch the game (export MONO_IOMAP=all, make linker check in sfml2 for dependencies).

The game will seem "stuck" on a borderless black window while loading, even on Windows (at least on my machine). If it's a black window with a border, it crashed.

Right now the main menu shows up but I can't get in-game due to a serialization-related roadblock. A field internal to the .NET Framework / mono seems to be null after loading an asset when it shouldn't. MonoDevelop's debugger implies that the field name changed, which mismatches with both the .NET Framework reference code and Mono source code... thus not helping at all.

Good luck, maybe you'll have a better chance in getting it to run 😄

@0x0ade 0x0ade changed the title [Windows][x64] UnderRail [Windows, Linux][x64] UnderRail Oct 30, 2017
@HK47196
Copy link

HK47196 commented Oct 30, 2017

Ingame
untitled

Only issue is that it seems to have hardcoded paths and MONO_IOMAP doesn't help. I massively kludged around it just to get ingame by symlinking the needed files with windows backslashes to the locations they're actually at.

Any idea of the best way to work around this?

@0x0ade
Copy link
Owner Author

0x0ade commented Oct 30, 2017

I assume the game passes on the hardcoded paths to SFML2. If you know what method it calls, you can use --fix-path-arg MethodID to make XnaToFna fix any path arguments when the game uses it.

The simplest MethodID structure is FullTypeName::MethodName.

Specifically, --fix-path-arg SFML.Audio.Music::.ctor fixes the path given to SFML2 when loading music. .ctor is the constructor name. Just as an example, if the method would be called Load, you'd need to pass --fix-path-arg SFML.Audio.Music::Load instead.

@HK47196
Copy link

HK47196 commented Oct 30, 2017

Yeah, that fixed it. Still getting a blackscreen ingame, strace doesn't seem to report any other path issues. Hm.

@0x0ade
Copy link
Owner Author

0x0ade commented Oct 30, 2017

I'd begin trying to figure out if the textures render at all or if they just fail rendering, using apitrace. The textures could be loaded improperly, MojoShader could fail (very unlikely) or the rendering color is set to black because deserialization failed again (FNA 17.10 fixed this obscure bug). Unfortunately we can't (easily) debug the rendering code using MonoDevelop - the game is obfuscated.

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

No branches or pull requests

2 participants