Nils277 / KerbalPlanetaryBaseSystems

A mod for Kerbal Space Program
Other
58 stars 61 forks source link

KSP fails to load on MacOS Catalina #113

Closed trosine closed 3 years ago

trosine commented 3 years ago

I just upgraded to a new laptop on Catalina, and with planetary base systems installed, KSP doesn't even make it past the loading screen. I've narrowed the issue down to the combination of Catalina and KPBS. To simplify things, I uninstalled all of my mods and only installed KPBS. Here's the Player.log with only the following installed:

https://www.dropbox.com/s/4fw4588md8tq867/KPBS-load-Player.log?dl=0

- BreakingGround-DLC 1.5.1
+ CommunityCategoryKit 5.1.0.0
+ CommunityResourcePack 1.3.0.0
- KerbalPlanetaryBaseSystems v1.6.12
+ ModuleManager 4.1.4

I've also tried other combinations to confirm that planetary base systems is the cause of the failure:

PS: thanks for such an awesome mod

Nils277 commented 3 years ago

Hi, i cannot see any error logged in the file you uploaded. However the file still lists some other mods as installed:

Maybe the file is not the most up do date one? I think the "KSP.log" file from KSP's main directory will be better for me to see where the crash happens. Can you restart KSP with the the mods listed above being installed and the send me the "KSP.log" file?

trosine commented 3 years ago

Here's the KSP.log. https://www.dropbox.com/s/oouu686ks5gu7yj/KPBS-load-KSP.log?dl=0

It looks like ckan only removes files from the original .zip file when removing mods. Those directories only contain .cfg MiniAVC.dll.pruned, and other cache files.

Nils277 commented 3 years ago

Just looked at the log, You are right, The other mods seem to be removed. However neither of the logs shows anything that goes wrong. It just ends while loading. One time while loading a graphic from "CommunityCategoryKit" before it even reached the files from KPBS the other time loading a texture from KPBS. It seems that the program just ends without even recognizing that. I just searched for "Catalina" in the KSP forums. It looks like there are multiple users having trouble to start KSP on "Catalina". On suggested to re-install KSP as "pkg" file, which solved the problem, https://forum.kerbalspaceprogram.com/index.php?/topic/192852-ksp-191-does-not-start-on-mac-os-x-catalina/#comment-3764869 Can you try to install another mod with a lot of parts and see if KSP crashes there too? Maybe it the number of files that are added that is causing problems or something in that direction.

trosine commented 3 years ago

I doubt it's related to part count:

Based on that thread, the user had issues running KSP without any mods installed. In my case, I can run KSP (but only without kOS and KPBS). I'm also using steam, where It looks like that person bought it directly from https://www.kerbalspaceprogram.com/store/, so I don't have the "install from pkg" option.

I think KSP.log is using buffered output, because the Player.log from the same session as that KSP.log ended at "Load(Texture): PlanetaryBaseInc/BaseSystem/Agencies/KermanAndKerman_scaled". That Player.log is the same (except for some timings) as the one I provided initially.

Since Catalina only supports 64-bit applications, perhaps there's something with the way the dll is compiled. I'm a python developer and technical troubleshooter on linux myself, but not with C# or Visual Studio, so I might simply be jumping to conclusions that have no basis in reality.

On Thu, Sep 10, 2020 at 3:46 PM Nils277 notifications@github.com wrote:

Just looked at the log, You are right, The other mods seem to be removed. However neither of the logs shows anything that goes wrong. It just ends while loading. One time while loading a graphic from "CommunityCategoryKit" before it even reached the files from KPBS the other time loading a texture from KPBS. It seems that the program just ends without even recognizing that. I just searched for "Catalina" in the KSP forums. It looks like there are multiple users having trouble to start KSP on "Catalina". On suggested to re-install KSP as "pkg" file, which solved the problem, https://forum.kerbalspaceprogram.com/index.php?/topic/192852-ksp-191-does-not-start-on-mac-os-x-catalina/#comment-3764869 Can you try to install another mod with a lot of parts and see if KSP crashes there too? Maybe it the number of files that are added that is causing problems or something in that direction.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Nils277/KerbalPlanetaryBaseSystems/issues/113#issuecomment-690717316, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZNVCVI7MQXL6UVUUSZCULSFE3J3ANCNFSM4REB3K2A .

trosine commented 3 years ago

I've narrowed the issue to these 3 files. If any one of those files are present, the game crashes during loading as before. If all 3 are removed (and the rest of the mod is intact), I get to the main menu. I didn't try playing the game because I'm not sure what kind of havoc it would cause with them missing.

BaseSystem/Agencies/KermanAndKerman.dds BaseSystem/Flags/PSS.dds BaseSystem/Flags/KPBS.png

I tried to re-save the png file via the Preview app (with and without Alpha), and both of those versions failed as well. Both versions had a different size/shasum than the one provided in the mod, so I know it didn't just copy the file. Unfortunately, I don't have any skill in image/model editing, so I think the only help I can provide is trying new versions of the files.

trosine commented 3 years ago

I decided to try loading these files in GIMP to see what would happen. GIMP was able to successfully load all of the images, so I tried to re-export them. The two files that were already DDS files, worked when I exported back to a DDS. The files are a bit smaller than the original, so I don't know what might have been lost. Something I did think was odd was that the image appears to be vertically flipped in GIMP.

With KPBS.png, if I exported as a PNG, KSP crashed before the main menu as before, but when I exported that as a DDS, it worked, although it was vertically flipped, so I flipped it in GIMP, so it looked "wrong", and rexported. I went to start a new game with a custom flag, and I can see all 3 of these images in there and they were all oriented properly.

My PNG export options: image

My DDS export options: image

Here are my exported, functional versions of the files. https://www.dropbox.com/sh/5x4x4ijp9gb41f5/AABUru20xeg7mRUbQxC2Ann-a?dl=0

trosine commented 3 years ago

I tried the following over the weekend:

Not really understanding image editing, I'm not sure what is different about your flags, my simple one, and Squad's, that allow my DDS's or Squad's to work, but not yours. It's even more confusing to me that Squad's PNG files work, but none of my attempts to export as PNG work.

Nils277 commented 3 years ago

Hi, wow, you really did a lot of work finding the reason to fix the loading bug and investigate what is causing the issue. I will replace the problematic files with yours in the next release, so it will work out of the box.

I think that some time ago it was mentioned that the Unity Engine had some issues loading png files on some MacOS versions. Unity uses the native methods from the OS to load image files (if possible) to improve loading times. If i remember correctly the native Method from MacOS had a bug that caused crashes when loading images that were compressed in a certain way. It seems like this problem came back with MacOS Catalina. My guess is that a png file that was created with an image editing program native to MacOS will work correctly but i'm not sure ;)

Nils277 commented 3 years ago

Should be fixed with c54946f