JavidPack / TerraCustom

Custom world generation for Terraria.
https://forums.terraria.org/index.php?threads/terracustom-for-1-3.35346/
87 stars 15 forks source link

Mods that generate too many chests cause unhandled exception. #19

Open etmoonshade opened 5 years ago

etmoonshade commented 5 years ago

FakeEdit: The crash still happens, but I think it's a problem with handling overgeneration of chests rather than anything specific to Thorium. I imagine this would happen with any mod that added craptons of items and possibly generated chests in places where it might not be expected.


I'm getting a crash when I attempt to build a world. I have many mods installed, but the one which seems to be part of the problem is Thorium.

Below is the Windows crash I get:

Problem signature:
  Problem Event Name:   CLR20r3
  Problem Signature 01: TerraCustom v0.5.4.exe
  Problem Signature 02: 1.3.5.1
  Problem Signature 03: 5b6d15b4
  Problem Signature 04: Terraria
  Problem Signature 05: 1.3.5.1
  Problem Signature 06: 5b6d15b4
  Problem Signature 07: 6a1
  Problem Signature 08: 0
  Problem Signature 09: System.StackOverflowException
  OS Version:   6.1.7601.2.1.0.256.48
  Locale ID:    1033
  Additional Information 1: 199c
  Additional Information 2: 199cc907df8a4654c8ebf31545ec3b64
  Additional Information 3: ac93
  Additional Information 4: ac932fb721b478be6e53cf5b63cba0e7

I enabled the debug option for "save world after each step," and I have attached the last few steps (as far as I could tell) to the issue. Let me know if you need any of the other steps, or all of them.

Additional troubleshooting as I do it: Setting the world size to small allows it to generate the world (hmmmm) Setting the number of cabins in my large world back down to 100% also allows the world to generate (HMMMM)

So I think the ACTUAL issue here is that TerraCustom isn't picking up something about what Thorium (and presumably any other extensive mod) is doing with chests, and doesn't handle it gracefully when it generates more chests.

I seem to recall reading somewhere that there's a literal 1000-chest limit in Terraria, which would explain why it's crashing with a "StackOverflowException"

I imagine the expected behavior would be to gracefully stop worldgen, preferably with an error message that specifies that it's stopping because of too many chests being generated.

Worlds.zip

JavidPack commented 5 years ago

StackOverflowExceptions in WorldGen usually have to do with how the tiles are "framed". That crash isn't too useful to me.

You need to stay under the 1000 limit no matter what. I'm not sure how many chests other mods will add, so the estimate won't account for them.

I can test if you post your enabled.json and "My Games\Terraria\TerraCustom\Autosave-LastUsed.json" so I can try the same settings that you tried that crashed.

etmoonshade commented 5 years ago

Here you go. It didn't even click that mods downloaded were probably kept in some easy-to-transmit format.

The "Thorium Mod: Shrines and Loot" step is the one it hangs on, which is (eventually) why I started wondering if it had something to do with chest count in a step where it wasn't expecting chests. I'll shut up, stop speculating, and just hit send now though. ;p

enabled.zip

Custom Large World.zip