veger / TLBE

TLBE - Time Lapse Base Edition
MIT License
9 stars 6 forks source link

crash - missing camera transitionPeriod #58

Closed drdozer closed 7 months ago

drdozer commented 9 months ago

With pymods installed and others, on adding DeadlocksStackingForPyanadon, but loading a vanilla map, although that's likely incidental:

  61.642 Applying migration: Time Lapse Base Edition: tlbe-0.2.1.lua
  61.642 Applying migration: Time Lapse Base Edition: tlbe-1.0.0.lua
  61.642 Applying migration: Time Lapse Base Edition: tlbe.1.1.1.lua
  61.643 Applying migration: Time Lapse Base Edition: tlbe.1.2.0.lua
  61.643 Applying migration: Time Lapse Base Edition: tlbe.1.3.1.lua
  61.643 Applying migration: Time Lapse Base Edition: tlbe.1.4.2.lua
  61.643 Applying migration: Time Lapse Base Edition: tlbe.1.4.3.lua
  61.643 Applying migration: Time Lapse Base Edition: tlbe.1.4.4.lua
  61.643 Applying migration: Time Lapse Base Edition: tlbe.1.4.5.lua
  62.651 Error AppManagerStates.cpp:1662: Error while applying migration: Time Lapse Base Edition: tlbe.1.4.5.lua

__TLBE__/scripts/camera.lua:104: attempt to perform arithmetic on field 'transitionPeriod' (a nil value)
stack traceback:
    __TLBE__/scripts/camera.lua:104: in function 'updateConfig'
    __TLBE__/migrations/tlbe.1.4.5.lua:55: in main chunk

I haven't looked at the code yet -- I'm betting it is some inconsistency in the behaviour of the green box tracking to the white one.

veger commented 9 months ago

I think it is similar to https://github.com/veger/TLBE/issues/55#issuecomment-1753181233, somehow the Camera is in an incorrect state, and then the updateConfig function has nil values which Lua cannot do maths with...

The Camera property zoomPeriod got renamed to transitionPeriod (see https://github.com/veger/TLBE/blob/master/migrations/tlbe.1.4.5.lua#L52C15-L52C15). This rename seems to be missing in your save file.

drdozer commented 8 months ago

Weird. The same issue has not happened again, so I have no idea how to reproduce it. I guess we can leave this until someone else reports it or it happens in a controlled environment where we can fix it properly?

veger commented 8 months ago

As mentioned it looks similar to #55 (if my deduction is correct, it is due to people running directly from code and thereby missing out on the (changed) migrations in between releases). I cannot see another path that results in the missing properties for the Camera. Within this controlled environment it is reproducible, but it becomes quite unlikely if there are more reports as I doubt lots of people are running 'in between' versions...

We can leave this issue open for a while to see if there are more reports coming in

veger commented 7 months ago

Fixed in v1.5.1