X2CommunityCore / X2WOTCCommunityHighlander

https://steamcommunity.com/workshop/filedetails/?id=1134256495
MIT License
60 stars 68 forks source link

Cooked Highlander crashes to desktop when used on MacOS #40

Closed MalucoMarinero closed 7 years ago

MalucoMarinero commented 7 years ago

It is reported that the highlander does not work on MacOS. To test, we've cooked up a highlander that ONLY adds a version template and a version check of 9.9.9. If this lightest touch is not functional, it is likely an issue that requires a fix upstream from Firaxis/Feral to allow for cooking highlanders for all platforms, not just windows.

If you wish to help test this on MacOS, do the following:

  1. Download the Blank Highlander linked below.

X2WOTCCommunityHighlanderBlankTest.zip

  1. Unhide the Library folder in your home directory.
  2. Unsubscribe from the Community Highlander and delete the folder: ~/Library/Application Support/Steam/steamapps/workshop/content/268500/1134256495 to remove all traces of the highlander.
  3. Extract the Blank community highlander to ~/Library/Application Support/Steam/steamapps/common/XCOM 2/XCom2-WarOfTheChosen/XComGame/Mods

When you run XCOM 2 it should show the X2WOTCCommunityHighlander WITHOUT the steam icon next to it. Try to run with only the highlander, and report whether the game loads or not.

If it works properly, you should see a version number of 9.9.9 on the bottom right of the main menu screen.

notfood commented 7 years ago

I tried to load it under Linux. It crashes with no log.

talchas commented 7 years ago

Trying to figure out what was wrong, I noticed that all the linux upks are apparently uncompressed, while the windows ones (and the one you generated) are compressed with something the various upk-extractors can't parse (or at least the linux ones have a way worse compression algorithm, judging by the filesizes being basically xcom2-base filesizes). Running the linux client with the windows xcomgame.upk* also crashes.

I don't have a windows install with the spare disk space at the moment, but if you cook some upks with -nopackagecompression or possibly using the base game xcomgame.exe, I'll test if that works

robojumper commented 7 years ago

Hi talchas, thanks for your help. I just cooked together a test Highlander with that parameter, it seems to have an effect. Here's a test mod, zip compression reduced file size by 75% (so it's safe to say compression was skipped in the cooking process):

X2WOTCCommunityHighlander.zip

talchas commented 7 years ago

Well, this gets farther at least. It loads the main window, and either plays the first few seconds of the startup movie, or with -nostartupmovies shows the main window (as a black screen only) and plays the first half second of background sound, and then crashes with "Exiting due to Structured Exception with code 1" in stdout, and nothing interesting in Launch.log:

[0018.85] Log: Log file open, 10/10/17 09:13:18
[0018.85] Log: Checking DLC installation for ../../XComGame/DLC/dlc_1 ...
[0018.85] Log: IS INSTALLED : Anarchy's Children, YES
[0018.86] Log: Checking DLC installation for ../../XComGame/DLC/dlc_2 ...
[0018.86] Log: IS INSTALLED : Alien Hunters, YES
[0018.88] Log: Checking DLC installation for ../../XComGame/DLC/dlc_3 ...
[0018.88] Log: IS INSTALLED : Shen's Last Gift, YES
[0018.91] Log: Checking DLC installation for ../../XComGame/DLC/xcom_dlc_day0 ...
[0018.91] Log: Removing : xcom_dlc_day0
[0018.91] Log: IS INSTALLED : Resistance Warrior Pack, NO
[0018.91] Log: Checking DLC installation for C:\Feral\Users\Default\AppData\Roaming\mods_lowercase\mods_lowered\x2wotccommunityhighlander ...
[0018.91] Log: IS INSTALLED : , YES
[0034.80] Log: ###### OnlineEventMgr waited 0.00 seconds for saves to complete
[0045.99] Log: GIsGuarded is true

I'll go and mess with it some more this afternoon.

robojumper commented 7 years ago

Investigations revealed that in a Linux / MacOS WotC installation, Texture File Caches are different, while they are the same in vanilla. Below are file sizes for a few cooking-relevant files:

File Windows Linux MacOS
Vanilla GPCD 26.223.679 B 26.223.679 B 26.223.697 B
WotC GPCD 37.503.043 B 37.503.043 B 37.503.043 B
Vanilla CharTextures 1.446.442.983 B 1.446.442.983 B 1.446.442.983 B
WotC CharTextures 1.631.481.907 B 2.004.061.566 B 2.004.061.566 B
Vanilla GuidCache 239.288 B 239.288 B ???
WotC GuidCache 331.336 B 331.336 B 331.336 B

For the WotC GPCD, MacOS and Linux have the same hash too, only windows is different.

Linux/MacOs: md5 1ead1042df2cc9af3c2c1a59ad0443a0; sha1 504fc07fbe79bb503d1019e55cb64d9c449bb917 Windows: md5 78eff037a4dbef67122d1fb98cdd55a9; sha1 5f0b7f3c32c933d1411228c1d2b1fdf541c3755e

It sounds like only some embedded offsets and filenames in the GPCD are different (filenames are all lowercase in the UNIX installs), and the data layout of the GPCD is functionally the exact same as for Windows. This means that in the best case, we "just" need to cook it with the Linux / MacOS files.

I will download all of that stuff over the next few days, and also calculate checksums from everything. My current suspicion is that we'll just have to cook a Windows version and a "Feral" version. Getting the Linux / MacOS files is possible with SteamCMD, but it's a lot of hassle and hard drive space.

Thoughts?

talchas commented 7 years ago

Sounds reasonable. Unsurprisingly, just copying the windows tfc files into linux was no help, and judging by the traces, just crashed faster, probably because it can't parse them at all. Depending on how things worked the case issues might have been fixable with symlinks, but not the tfcs it seems.

robojumper commented 7 years ago

I cooked a few things together with the Linux cooked files. Although the distributed Linux / MacOS XComGame.upk is compressed, I cooked two versions (un-/compressed) because apparently we got further with uncompressed versions.
I'd appreciate if someone with a Linux or MacOS installation could try these:

X2WOTCCommunityHighlander_Compressed.zip
X2WOTCCommunityHighlander_Uncompressed.zip

notfood commented 7 years ago

Good job!

The uncompressed mod finally runs, it loads and changes the text screenshot_20171011_101025

The compressed mod crashes during splash screen, almost right as it starts.

This is all under Linux.

talchas commented 7 years ago

Yup, looks good here too.

MalucoMarinero commented 7 years ago

Just to update, I'm dual booting linux so I can try this all out with a real build soon, with this information we can hopefully deploy a Mac/Linux supporting release soon, even if it is a separate workshop entry.

MalucoMarinero commented 7 years ago

Hey folks, if you want to help me out with testing, this is a release that I've tested to work with Linux of the most up to date version (1.2.1).

You should actually be able to use it with workshop mods hopefully, if this passes the test then I'll cut a workshop release of the Linux/OSX Compatibility version

X2WOTCCommunityHighlanderLinux.zip

So I have this working if I unzip the file inside to SteamLibrary/steamapps/common/XCOM 2/share/data/xcomgame/mods

talchas commented 7 years ago

Yup, works great (at least with the one workshop mod I tested, Show Will Loss)

notfood commented 7 years ago

Confirming working, I tried with the Long War Weapons, the animations did have the guns. Previously no guns appeared.

ginoledesma commented 7 years ago

👍 on macOS 10.13

knzai commented 7 years ago

Dropped the highlander in all the various possible mod locations, added it to the defaulmodoptions. Nothing shows up (OS X 10.12.6). Any chance of a workshop release (since it crashes now, even an imperfect build would be worth it :) ).

Thanks for the hard work!

MalucoMarinero commented 7 years ago

Possibly just in the wrong place as we have people with a working Mac build. I thought the Mac/Linux patch would be a bit faster (I was going to do the Mac/Linux workshop release when it released), but as it stands it probably won't hurt to make the release soon. Can't do it now, but will release on Workshop in about 12 hours (my evening)

knzai commented 7 years ago

Yay! Thank you. I've been wanting to play with some of the highlander dependent mods for a while now. :)

MalucoMarinero commented 7 years ago

@knzconnor workshop release out now, here: http://steamcommunity.com/sharedfiles/filedetails/?id=1184500704

It's a lot bigger in download size because the fundamental difference between them is we can't use package compression like the Windows release, because that's the way things were cooked for MacOS/Linux.

Anyway closing this out now. Reporting any new issues as new issues. Cheers!