tModLoader

tModLoader

Fancy Lighting
EternalCode Jun 24, 2022 @ 7:03am
[FIXED] Crash on World Load v0.2.2 when zoom is below 100%
After the update to v0.2.2 I'm unable to load my character & world with Smooth Lighting on. The game immediately throws the below exception and crashes. Disabling Smooth Lighting seems to resolve the issue for now

[08:50:17] [Main Thread/FATAL] [Terraria]: Main engine crash System.AggregateException: One or more errors occurred. (Index was outside the bounds of the array.) (Index was outside the bounds of the array.) ---> System.IndexOutOfRangeException: Index was outside the bounds of the array. at FancyLighting.SmoothLighting.<>c__DisplayClass14_0.<CalculateSmoothLighting>b__0(Int32 x1) in FancyLighting\SmoothLighting.cs:line 159 at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) --- End of stack trace from previous location --- at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) at System.Threading.Tasks.TaskReplicator.Replica.Execute() --- End of inner exception stack trace --- at System.Threading.Tasks.TaskReplicator.Run[TState](ReplicatableUserAction`1 action, ParallelOptions options, Boolean stopOnFirstFailure) at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally) --- End of stack trace from previous location --- at System.Threading.Tasks.Parallel.ThrowSingleCancellationExceptionOrOtherException(ICollection exceptions, CancellationToken cancelToken, Exception otherException) at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally) at System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body) at FancyLighting.SmoothLighting.CalculateSmoothLighting(Boolean background) in FancyLighting\SmoothLighting.cs:line 146 at FancyLighting.FancyLightingMod.<AddHooks>b__40_6(orig_RenderWalls orig, Main self) in FancyLightingMod.cs:line 265 at DMD<Terraria.Main::DoDraw>(Main this, GameTime gameTime) at GravityDontFlipScreen.GravityFlipSystem.Main_DoDraw(orig_DoDraw orig, Main self, GameTime gameTime) in GravityDontFlipScreen\GravityFlipSystem.cs:line 113 at Terraria.Main.Draw(GameTime gameTime) in tModLoader\Terraria\Main.cs:line 48505 at Microsoft.Xna.Framework.Game.Tick() in D:\a\tModLoader\tModLoader\FNA\src\Game.cs:line 559 at Microsoft.Xna.Framework.Game.RunLoop() in D:\a\tModLoader\tModLoader\FNA\src\Game.cs:line 886 at Microsoft.Xna.Framework.Game.Run() in D:\a\tModLoader\tModLoader\FNA\src\Game.cs:line 415 at Terraria.Program.LaunchGame_(Boolean isServer) in tModLoader\Terraria\Program.cs:line 229 ---> (Inner Exception #1) System.IndexOutOfRangeException: Index was outside the bounds of the array. at FancyLighting.SmoothLighting.<>c__DisplayClass14_0.<CalculateSmoothLighting>b__0(Int32 x1) in FancyLighting\SmoothLighting.cs:line 159 at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) --- End of stack trace from previous location --- at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) at System.Threading.Tasks.TaskReplicator.Replica.Execute()<---
Last edited by EternalCode; Jun 24, 2022 @ 10:36pm
< >
Showing 1-5 of 5 comments
drkanbs Jun 24, 2022 @ 7:19am 
So it has something to do with the smooth lighting eh? That is quite a more thorough crash log than what I found. It might help the author.
Rex  [developer] Jun 24, 2022 @ 3:17pm 
Is your spawn point near the edge of the world, and what world size did you use? It seems like the error is caused by the mod trying to check a tile with coordinates that do not exist. I'll try putting more checks so that this hopefully doesn't happen.
EternalCode Jun 24, 2022 @ 5:29pm 
The spawn point is the original world spawn so it's still at the center and it's a large world. I found that it's also probably due to using Fancy Lighting and another mod I had installed called "Better Zoom & Camera Control" together.

I created a short video showing some of my troubleshooting with them since writing it all down would've taken much longer. Long story short though it seems to be due to being zoomed out farther than Fancy Lighting (and probably Terraria itself) can handle.
Rex  [developer] Jun 24, 2022 @ 6:54pm 
I've attempted to fix the crash in the latest update, but I cannot guarantee compatibility with any mods that allow zooming out beyond 100%.
EternalCode Jun 24, 2022 @ 10:35pm 
Yup, I can confirm v0.2.3 fixed the crash. Understandable that you can't guarantee compatibility for Better Zoom and others like it. Still, thanks for the quick response and resolution, really enjoying the mod so far!
< >
Showing 1-5 of 5 comments
Per page: 1530 50