Sgt-Imalas / Sgt_Imalas-Oni-Mods

All the ONI mods made by Sgt_Imalas
MIT License
21 stars 8 forks source link

[BUG]: Game crash if an older preset from before v4.2.6 is loaded #124

Open ArlEamon opened 1 month ago

ArlEamon commented 1 month ago

Which Mod?

Cluster Generation Manager [Vanilla/DLC]

Description of the bug/crash

Getting "MISSING.STRINGS.UI.CGMEXPORT_SIDEMENUS.PRESETWINDOW.CGM....." when I select a preset. (error code continues but does not fit into the screen.)

When I press apply I get a crash. (Not all presets crash though)

Steps To Reproduce

Choose an older preset. You will get the error on preset selection screen. Not all presets give this error. When you get an error with the preset try to apply it. You will get a crash.

Player.log

Player-prev.log

ArlEamon commented 1 month ago

Also crash log is here

NullReferenceException: Object reference not set to an instance of an object

ClusterTraitGenerationManager.ClusterData.CGSMClusterManager+<>c.b40_0 (ClusterTraitGenerationManager.ClusterData.StarmapItem item) (at :0) System.Linq.EnumerableSorter2[TElement,TKey].ComputeKeys (TElement[] elements, System.Int32 count) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0) System.Linq.EnumerableSorter1[TElement].ComputeMap (TElement[] elements, System.Int32 count) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0) System.Linq.EnumerableSorter1[TElement].Sort (TElement[] elements, System.Int32 count) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0) System.Linq.OrderedEnumerable1[TElement].SortedMap (System.Linq.Buffer1[TElement] buffer) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0) System.Linq.OrderedEnumerable1[TElement].ToList () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0) System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0) ClusterTraitGenerationManager.ClusterData.CGSMClusterManager.GenerateClusterLayoutFromCustomData (System.Boolean log) (at :0) ClusterTraitGenerationManager.ClusterData.CGSMClusterManager.get_GeneratedLayout () (at :0) ClusterTraitGenerationManager.UI.SO_StarmapEditor.StarmapToolkit.RebuildGrid () (at :0) ClusterTraitGenerationManager.UI.Screens.CGM_MainScreen_UnityScreen.ResetSOStarmap (System.Boolean reset) (at :0) ClusterTraitGenerationManager.UI.Screens.CGM_MainScreen_UnityScreen.RebuildStarmap (System.Boolean reset) (at :0) ClusterTraitGenerationManager.UI.Screens.CGM_MainScreen_UnityScreen.b__177_22 () (at :0) ClusterTraitGenerationManager.UnityPresetScreen.b39_2 () (at :0) UtilLibs.UIcmp.FButton.OnPointerUp (UnityEngine.EventSystems.PointerEventData eventData) (at :0) UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerUpHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at :0) UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at :0) UnityEngine.EventSystems.EventSystem:Update()

Build: U52-623711-SCD

Sgt-Imalas commented 1 month ago

are there random planets in these presets that crash?

ArlEamon commented 1 month ago

I'm also sending presets that are causing the error.

1+12Water+1_Beeta_2E02C9.json 2+11Water+2Beeta+_4_Bitki_75A2F6.json zzzz_GoodStart-_1_68BB9D.json zzzz_GoodStart-_2_086D50.json zzzz_GoodStart-3-_Best_6DC838.json

ArlEamon commented 1 month ago

No. There aren't any random planets.

ArlEamon commented 1 month ago

I have deletes one of the presets.

There is a strange behaviour. After I get the error when selecting one of the broken ones, if I select a working one it gives an error too; but works.

ArlEamon commented 1 month ago

I should also point out that all of the broken presets have Ceres Minor as Outer Asteroid.

I have older presets without Ceres Minor and they are working.

Sgt-Imalas commented 1 month ago

the one in your log seems to be missing SmallOilySwampOuter, which is an outer variant of SmallWarpOilySwamp.

Sgt-Imalas commented 1 month ago

it is missing, because apparently Klei removed it from the Terra Cluster recently, leading to it no longer getting loaded into the game

ArlEamon commented 1 month ago

LOL. So they won't work no matter what you do.

Sgt-Imalas commented 1 month ago

the asteroid is still there, I can force the game to still load it (like with that one variant of moonlet)

Sgt-Imalas commented 1 month ago

this might or might not be something that broke with either last nights hotfix or the frosty planet release and it just did not trigger until now

ArlEamon commented 1 month ago

I checked and yes it is not there anymore as a selectable asteroid. Only the normal sized one is there.

ArlEamon commented 1 month ago

this might or might not be something that broke with either last nights hotfix or the frosty planet release and it just did not trigger until now

It was there until last nights update I think. Because I created these presets after Fosty Pack. They all have Ceres Minor.

I thought it was something to do with that asteroid, but it doesn't seem to be the case

ArlEamon commented 1 month ago

I don't think; I am sure. Because I recreated the same preset from the beginning while testing the previous bug.

ArlEamon commented 1 month ago

I think you don't have to work for it; if it is already removed.

But if you like to do so; I won't say no don't do it. :)

Sgt-Imalas commented 1 month ago

it is not removed (from the files at least)

but the game only loads asteroids that are present in at least one cluster (for that reason there is also one moonlet variant from the moonlet starts that is in the files, but not loaded)

Sgt-Imalas commented 1 month ago

So I'll have to force the game to load the asteroid again (and add better "missing asteroids" handling)

ArlEamon commented 1 month ago

Yes it would of course be better to have that included in the mod.

Sgt-Imalas commented 1 month ago

MiniMetallicSwampyWarp is the one not loaded by default

ArlEamon commented 1 month ago

It might be a game bug

ArlEamon commented 1 month ago

Do you have any connection with klei

Sgt-Imalas commented 1 month ago

it is by design (not good design, but still design)

since there is no moonlet cluster where metallic swampy is a teleporter asteroid

Sgt-Imalas commented 1 month ago

Do you have any connection with klei

sadly not

ArlEamon commented 1 month ago

Ok then it's up to you if you work for it.

It is of course better to have a failsafe code in the mod. But also it is what it is. So you don't have to fix this. Because in the future there might be more dramatic changes to asteroids, which you would have to include every possible change in your code.

ArlEamon commented 1 month ago

In patch notes it doesn't mention any of the asteroids removal. I still think this might be a bug.

Sgt-Imalas commented 1 month ago

the file has a note at the top: "# Unused - Was used for VanillaSandstoneCluster"

Sgt-Imalas commented 1 month ago

oh. and SmallRadioactiveLandingSite has met the same fate

ArlEamon commented 1 month ago

So this was left in the game until sometime.

Then you shouldn't be working on a fix for this. This might get removed completely in the future; which would brake the mod again. (if you use those files of course)

Sgt-Imalas commented 1 month ago

I can readd those files over the mod in the future

ArlEamon commented 1 month ago

What will happen when they get removed completely?

ArlEamon commented 1 month ago

Oh I miss read. You are talking about putting those asteroid files into the mod.

Sgt-Imalas commented 1 month ago

in theory I can readd them as modded asteroids in CGM

Sgt-Imalas commented 1 month ago

but it might be better to instead add redirects for old presets

ArlEamon commented 1 month ago

Redirects might be a better choice for now.

ArlEamon commented 1 month ago

Or you might add a warning about removed asteroids instead of an error, and do not allow loading that preset. This way people would get notified about the missing asteroids and create new presets with existing asteroids.

This will save you from putting redirects every time an asteroid is removed.

ArlEamon commented 1 month ago

Klei seems to be going after biome scrambling. This would also reduce the count of asteroids needed. You can get every type of biome on whichever asteroid you want with scrambling.

Sgt-Imalas commented 1 month ago

thats my assumption as well - remove the "duplicate" smaller asteroid variant that was unfit for biome mixing

ArlEamon commented 1 month ago

Yep. So what will yo do? Will you give a warning to change the preset; or try to redirect older asteroids?

Sgt-Imalas commented 1 month ago

both for now redirect if possible + warning counter

ArlEamon commented 1 month ago

Ok. Good luck then.

I will always be pleased to help you if I'm available. Don't bother to ask for help any time.

ArlEamon commented 1 month ago

Still not working.

If I don't change anything from an older not working preset, I get this error.

Cluster Generation Manager - Bug in asteroid creation

I'm familiar with this error; it is caused by small asteroids; where the game cannot generate POI's because of lack of space.

After I got this error I changed that asteroids size to a standard and this time I got a crash. The crash occures after asteroid generation is complete when it says "Success! Space adventure awaits." on the generation screen.

Player-prev.log

crashlog.txt

zzzzz_Test_16D2E9.json

Sgt-Imalas commented 1 month ago

ah rip I forgot to add that override to starmap locations too

ArlEamon commented 1 month ago

LOL. You need a full time tester. :)

Sgt-Imalas commented 1 month ago

and work with more sleep

ArlEamon commented 1 month ago

Yep I need that too :)

Sgt-Imalas commented 1 month ago

here, that should fix it: ClusterTraitGenerationManager_dev.zip

ArlEamon commented 1 month ago

I can confirm that it is working with older presets.

Generation is consistent with geysers, POI's and plants (growth rate is different though)

ArlEamon commented 1 month ago

Last nights modifications changed another thing.

Before last night when I changed a Space POI location in starmap; I was getting a different geyser generation. Tiles, POI's and plants were the same but geysers were changing. They were still consistent with preset load. So with same starmap, same seed, same planetoids; I was getting the exact same generation.

Now; if I change a space POI location in starmap; I always get the same geysers. Other things are also the same. Nothing changes at all.

Changing a space POI location was a quick geyser reroll technique for me with a desired (and of course the same) tile, POI and plant generation.

Sgt-Imalas commented 1 month ago

that sounds like something weird with that afformentioned random on your system doing weird things, because they should not influence each other

ArlEamon commented 1 month ago

So I should understand this as it wasn't supposed to be like that. Am I right?