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

(Critical) Crash in scene transition with transition type = Noble.Transition.Type.COVER #69

Closed
stiv-iv opened this issue Feb 12, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@stiv-iv
Copy link
Contributor

stiv-iv commented Feb 12, 2024

Chance to get crash while transitioning between scenes, if scene transition type = Noble.Transition.Type.COVER.

Update error: libraries/noble/Noble.lua:269: attempt to index a nil value (upvalue 'currentScene')
stack traceback:
    libraries/noble/Noble.lua:269: in field 'transitionMidpointHandler'
    libraries/noble/modules/Noble.Transition.lua:115: in field 'fn'
    libraries/noble/libraries/Sequence.lua:359: in local 'callTimeRange'
    libraries/noble/libraries/Sequence.lua:368: in method 'updateCallbacks'
    libraries/noble/libraries/Sequence.lua:81: in field 'update'
    libraries/noble/Noble.lua:311: in function <libraries/noble/Noble.lua:308>

To increase chance of crash set duration of transition about 2 * frame duration. It can be 0.060 or 0.062 or 0.064 or 0.066 (if your FPS = 30).

Noble.transition(ExampleScene2, 0.062, Noble.Transition.DipToBlack)

The reason for the crash is that sometimes you can get two midpoint callbacks in one Sequence. I described that here: NicMagnier/PlaydateSequence#10

Pull request with the fix: #66

@stiv-iv stiv-iv added the bug Something isn't working label Feb 12, 2024
@santiaboy
Copy link
Contributor

I had this happen a couple of times, which leads to a game crash. Are there plans of merging the pull request?

@Mark-LaCroix
Copy link
Member

Mark-LaCroix commented Jun 2, 2024

I'm going to close this as it seems to be addressed with the updating and merging of #66.

I've also created checks for when either side of a transition duration is smaller than the duration of a single frame (and also not <= 0). It forces the transition to be at least one frame long, so that should clear up any other edge cases related to this as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

3 participants