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

Kopernicus failing to load Kerbin and Mun with Sigma Dimensions #145

Closed
infoman opened this issue Nov 8, 2016 · 17 comments
Closed

Kopernicus failing to load Kerbin and Mun with Sigma Dimensions #145

infoman opened this issue Nov 8, 2016 · 17 comments

Comments

@infoman
Copy link

infoman commented Nov 8, 2016

When trying to load KSP with Kopernicus, Sigma Dimensions and KScale64 resized system, Kopernicus seems to be unable to create .bin cache files for Kerbin and Mun.

I use 64bit version of KSP on Ubuntu 16.04.

First related exception seens to be:

[EXC 17:57:17.835] IndexOutOfRangeException: Array index is out of range.
        Kopernicus.Configuration.AtmosphereLoader.get_lightColor ()
        System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
        Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
        System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
        System.Reflection.MonoProperty.GetValue (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] index, System.Globalization.CultureInfo culture)
        System.Reflection.MonoProperty.GetValue (System.Object obj, System.Object[] index)
        Kopernicus.Configuration.Parser.LoadObjectMemberFromConfigurationNode (System.Reflection.MemberInfo member, System.Object o, .ConfigNode node, Boolean getChilds)
        UnityEngine.Debug:LogException(Exception)
        Kopernicus.Configuration.Parser:LoadObjectMemberFromConfigurationNode(MemberInfo, Object, ConfigNode, Boolean)
        Kopernicus.Configuration.Parser:LoadObjectFromConfigurationNode(Object, ConfigNode, Boolean)
        Kopernicus.Configuration.Parser:CreateObjectFromConfigNode(Type, ConfigNode, Boolean)
        Kopernicus.Configuration.Parser:LoadObjectMemberFromConfigurationNode(MemberInfo, Object, ConfigNode, Boolean)
        Kopernicus.Configuration.Parser:LoadObjectFromConfigurationNode(Object, ConfigNode, Boolean)
        Kopernicus.Configuration.Loader:Kopernicus.Configuration.IParserEventSubscriber.PostApply(ConfigNode)
        Kopernicus.Configuration.Parser:LoadObjectFromConfigurationNode(Object, ConfigNode, Boolean)
        Kopernicus.Configuration.Parser:CreateObjectFromConfigNode(ConfigNode, Boolean)
        Kopernicus.Injector:Awake()
        UnityEngine.GameObject:AddComponent(Type)
        AddonLoader:StartAddon(LoadedAssembly, Type, KSPAddon, Startup)
        AddonLoader:StartAddons(Startup)
        AddonLoader:OnLevelLoaded(Int32)
        AddonLoader:OnSceneLoaded(Scene, LoadSceneMode)
        UnityEngine.SceneManagement.SceneManager:Internal_SceneLoaded(Scene, LoadSceneMode)

And then:

[EXC 17:57:53.883] Exception: "Kerbin" not found.
        Kopernicus.Configuration.Loader.Kopernicus.Configuration.IParserEventSubscriber.PostApply (.ConfigNode node)
        Kopernicus.Configuration.Parser.LoadObjectFromConfigurationNode (System.Object o, .ConfigNode node, Boolean getChilds)
        Kopernicus.Configuration.Parser.CreateObjectFromConfigNode[Loader] (.ConfigNode node, Boolean getChilds)
        Kopernicus.Injector.Awake ()
        UnityEngine.GameObject:AddComponent(Type)
        AddonLoader:StartAddon(LoadedAssembly, Type, KSPAddon, Startup)
        AddonLoader:StartAddons(Startup)
        AddonLoader:OnLevelLoaded(Int32)
        AddonLoader:OnSceneLoaded(Scene, LoadSceneMode)
        UnityEngine.SceneManagement.SceneManager:Internal_SceneLoaded(Scene, LoadSceneMode)

Then KSP main menu is loaded, but when trying to open any save, it's just a black screen instead of KSC view.

KSP logs:
Unity player log
KSP log

Kopernicus logs:
Kerbin.Body.log
Mun.Body.log

For reference: EVE and Duna (compiled successfully):
Eve.Body.log
Duna.Body.log

@StollD
Copy link
Member

StollD commented Nov 8, 2016

Are you sure that the cache folder is writeable?

@infoman
Copy link
Author

infoman commented Nov 8, 2016

It is writable and all other cache files appear to be created successfully:

$ tree -p GameData/Sigma/Dimensions/Cache
GameData/Sigma/Dimensions/Cache
└── [drwxrwxr-x]  [6.4x]Resize
    └── [drwxrwxr-x]  [.50x]landscape
        └── [drwxrwxr-x]  Kopernicus
            └── [drwxrwxr-x]  Cache
                ├── [-rw-rw-r--]  Bop.bin
                ├── [-rw-rw-r--]  Dres.bin
                ├── [-rw-rw-r--]  Duna.bin
                ├── [-rw-rw-r--]  Eeloo.bin
                ├── [-rw-rw-r--]  Eve.bin
                ├── [-rw-rw-r--]  Gilly.bin
                ├── [-rw-rw-r--]  Ike.bin
                ├── [-rw-rw-r--]  Jool.bin
                ├── [-rw-rw-r--]  Laythe.bin
                ├── [-rw-rw-r--]  Minmus.bin
                ├── [-rw-rw-r--]  Moho.bin
                ├── [-rw-rw-r--]  Pol.bin
                ├── [-rw-rw-r--]  Sun.bin
                ├── [-rw-rw-r--]  Tylo.bin
                └── [-rw-rw-r--]  Vall.bin

But in 1.1.3 I had the following inside the cache dir:
$ ls ../../1.1.3/game/GameData/Sigma/Dimensions/Cache/[6.4x]Resize/[.50x]landscape/Kopernicus/Cache/
Bop.bin Dres.bin Duna.bin Eeloo.bin Eve.bin Gilly.bin Ike.bin Jool.bin Kerbin.bin Laythe.bin Minmus.bin Moho.bin Mun.bin Pol.bin Sun.bin Tylo.bin Vall.bin

And 1.2.1 only has those:
$ ls GameData/Sigma/Dimensions/Cache/[6.4x]Resize/[.50x]landscape/Kopernicus/Cache/
Bop.bin Dres.bin Duna.bin Eeloo.bin Eve.bin Gilly.bin Ike.bin Jool.bin Laythe.bin Minmus.bin Moho.bin Pol.bin Sun.bin Tylo.bin Vall.bin

@Sigma88
Copy link
Contributor

Sigma88 commented Nov 8, 2016

For what is worth, SD/kopernicus work fine on windows
So it might be one of those silly case sensitivity bugs

@infoman you could try this:
1- Load ksp with SD in order to get the bug
2- backup the resulting mm cache file
3- remove everything except kopernicus and dependancies
4- open the mm cachefile and copy the body node for kerbin
5- paste the body node into a cfg
6- write an mm patch that replaces stock kerbin with the stuff you copied from the mm cache
7- run the game multiple times, every time remove a small bit from the cfg with the new kerbin

You should be able to pinpoint which of the nodes in the config breaks kopernicus. At least we can narrow the search :)

@infoman
Copy link
Author

infoman commented Nov 8, 2016

@Kopernicus:FOR[testkop]
{
    @Body[Kerbin]
    {
        @Properties
        {
            radius = 3840000
        }
    }
}

That's all. Leave every other node inside and just remove the radius change — and everything loads successfully, except the KSC appears to be underground.

@infoman
Copy link
Author

infoman commented Nov 8, 2016

Also, the first "Array index is out of range" exception doesn't appear with just this patch, so it's probably not related to Kerbin and comes from something different.

@infoman infoman changed the title Kopernicus failing to create .bin files for Kerbin and Mun with Sigma Dimensions Kopernicus failing to load Kerbin and Mun with Sigma Dimensions Nov 8, 2016
@Sigma88
Copy link
Contributor

Sigma88 commented Nov 8, 2016

could you try this one please?

@Kopernicus:FOR[testkop]
{
    @Body[Kerbin]
    {
        Debug
        {
             update = true
        }
    }
}

@infoman
Copy link
Author

infoman commented Nov 9, 2016

Yes, this triggers the error too

Kerbin.Body.log
Kopernicus.log
KSP.log
Player.log

@Sigma88
Copy link
Contributor

Sigma88 commented Nov 9, 2016

hmmm
try this then:

@Kopernicus:FOR[testkop]
{
    @Body[Kerbin]
    {
        Debug
        {
             update = true
             exportMesh = false
        }
    }
}

this should let us understand if the problem is updating the model or just exporting it to a file

@infoman
Copy link
Author

infoman commented Nov 10, 2016

Same result.

@Sigma88
Copy link
Contributor

Sigma88 commented Nov 10, 2016

ok, so the problem is updating rather than exporting.

here's where my usefulness comes to an end. you'll need to wait for thomas to take a look at it when he has some time

@lordcirth
Copy link

I believe I have the same bug, although rather than a black menu I get the above log entries, then nullref log spam, and the game works but simply isn't rescaled. Using SigmaDimensions.

@Sigma88
Copy link
Contributor

Sigma88 commented Nov 11, 2016

@lordcirth this will happen in any rescaled system on kopernicus (for linux), regardless if you are using SD to rescale or just manually editing configs

@StollD StollD closed this as completed in 136cc36 Nov 11, 2016
@StollD StollD reopened this Nov 11, 2016
@StollD
Copy link
Member

StollD commented Nov 11, 2016

Please try it again with this build: https://tmsp.ga/files/Kopernicus-release-1.2.1-1-1-g1f87abe-2016-11-11.zip

@infoman
Copy link
Author

infoman commented Nov 11, 2016

This seems to work, but still has the first IndexOutOfRangeException and lots of nullref spam in the map view. Using Sigma Dimensions 0.6.1.

Player.log
KSP.log

@StollD
Copy link
Member

StollD commented Nov 11, 2016

Atmosphere { lightColor = <> } is goofed. @Sigma88 could use Atmosphere { AtmosphereFromGround { waveLength = <> } }

Or I just redo it

@Sigma88
Copy link
Contributor

Sigma88 commented Nov 11, 2016

no problem, I can use the wavelength

@Sigma88
Copy link
Contributor

Sigma88 commented Nov 11, 2016

actually, I don't think SD uses that at all

after all I have no need to touch the colors, just shapes

@StollD StollD closed this as completed Nov 13, 2016
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

4 participants