0x0ade / XnaToFna-Tracker

Game status tracking repository for XnaToFna.
https://github.com/0x0ade/XnaToFna
5 stars 0 forks source link

[Windows, Linux][x64] UnderRail #3

Open 0x0ade opened 7 years ago

0x0ade commented 7 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 😄

HK47196 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

0x0ade commented 6 years ago

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.