Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

order for storyboard callbacks willEnterScene and didExitScene has changed?
Started by aisaksen Nov 14 2012 08:22 AM

38 replies to this topic
[TOPIC CONTROLS]
Page 1 of 2 1 2
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

aisaksen

[GLOBAL: userInfoPane.html]
aisaksen
  • Contributor

  • 141 posts
  • Enterprise

It seems like the order that willEnterScene and didExitScene gets called has recently changed. Has anyone else noticed this? This change happened in the last month or so.

it used to be like this for Scene A and B

A.willEnterScene
A.enterScene
A.exitScene
A.didExitScene
B.willEnterScene

B.enterScene
B.exitScene
B.didExitScene

but now it seems like its

A.willEnterScene
A.enterScene
A.exitScene
B.willEnterScene
A.didExitScene

B.enterScene
B.exitScene
B.didExitScene

This introduces a lot of bugs in my code which assumed the other way. Is this intentional new behavior?
uid: 122310 topic_id: 33002 reply_id: 333002


[TOPIC: post.html]
#2

aisaksen

[GLOBAL: userInfoPane.html]
aisaksen
  • Contributor

  • 141 posts
  • Enterprise

I'm using version 926 of Enterprise which has the old behavior, and i noticed the new behavior in the latest build 968. So somewhere between those builds, this switched around....and its causing chaos on my game which assumed the former behavior.
uid: 122310 topic_id: 33002 reply_id: 131001


[TOPIC: post.html]
#3

Danny

[GLOBAL: userInfoPane.html]
Danny
  • Corona Geek

  • 2,597 posts
  • Corona Staff

Hi asiaksen,

Thanks for reporting this. I will look into this for you asap.
uid: 84637 topic_id: 33002 reply_id: 131008


[TOPIC: post.html]
#4

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,666 posts
  • Corona SDK

@aisaksen,

Nice catch.
uid: 110228 topic_id: 33002 reply_id: 131271


[TOPIC: post.html]
#5

Danny

[GLOBAL: userInfoPane.html]
Danny
  • Corona Geek

  • 2,597 posts
  • Corona Staff

Hey aisaksen.

We are still trying to ascertain which daily build this occurred in. Needless to say we will have a fix out for this in one of the upcoming daily builds asap.

Thank you for reporting it and for your patience.
uid: 84637 topic_id: 33002 reply_id: 131277


[TOPIC: post.html]
#6

bpran

[GLOBAL: userInfoPane.html]
bpran
  • Contributor

  • 108 posts
  • Corona SDK

Is this bug fixed in the latest public release (2012.971)?
uid: 31508 topic_id: 33002 reply_id: 131729


[TOPIC: post.html]
#7

walter

[GLOBAL: userInfoPane.html]
walter
  • Moderator

  • 726 posts
  • Alumni

yes, it is unfortunately in the public release.
uid: 26 topic_id: 33002 reply_id: 131807


[TOPIC: post.html]
#8

Danny

[GLOBAL: userInfoPane.html]
Danny
  • Corona Geek

  • 2,597 posts
  • Corona Staff

Update:

This issue has been fixed (from my testing it has existed from way back to the last public release (v894) and maybe earlier)

The fix will be available once daily builds kick off again.

Thanks again for your patience and for reporting this issue
uid: 84637 topic_id: 33002 reply_id: 132174


[TOPIC: post.html]
#9

aisaksen

[GLOBAL: userInfoPane.html]
aisaksen
  • Contributor

  • 141 posts
  • Enterprise

Thanks for the update, Danny, and glad to hear its fixed now...definitely looking forward to updating to a more recent build before doing our Android release. (Its definitely not broken in Build 926 which is what I used to release my game.)
uid: 122310 topic_id: 33002 reply_id: 132176


[TOPIC: post.html]
#10

Danny

[GLOBAL: userInfoPane.html]
Danny
  • Corona Geek

  • 2,597 posts
  • Corona Staff

Hey aisaksen.

Unless the storyboard version in v926 in corona enterprise differed from the one used in the standard version of corona.

I tested on the normal version of corona on 926 (and 894) and got the same incorrect scene event order as you described.

If you didn't, would you mind emailing me a simple test case that shows otherwise? my email is danny [at] coronalabs.com

Thanks again.
uid: 84637 topic_id: 33002 reply_id: 132178


[TOPIC: post.html]
#11

aisaksen

[GLOBAL: userInfoPane.html]
aisaksen
  • Contributor

  • 141 posts
  • Enterprise

I will email you the test case now. Its basically just the default App that corona builds, with some prints added, and willEnterScene and didExitScene added to both views. It does the correct behavior in Corona Simulator on 926 (not just enterprise).
uid: 122310 topic_id: 33002 reply_id: 132238


[TOPIC: post.html]
#12

EHO

[GLOBAL: userInfoPane.html]
EHO
  • Contributor

  • 259 posts
  • Corona SDK

What is the intended sequencing of the scene events? This is something I've been wondering about for some time.

Is it meant to work as the following once the bug is fixed?:

A.willEnterScene
A.enterScene
A.exitScene
A.didExitScene
B.willEnterScene
B.enterScene
B.exitScene
B.didExitScene
uid: 105707 topic_id: 33002 reply_id: 132251


[TOPIC: post.html]
#13

aisaksen

[GLOBAL: userInfoPane.html]
aisaksen
  • Contributor

  • 141 posts
  • Enterprise

yes, this is how its supposed to work:

A.willEnterScene
A.enterScene
A.exitScene
A.didExitScene
B.willEnterScene
B.enterScene
B.exitScene
B.didExitScene

This is pretty important because otherwise you end up with a situation where the peak memory Mem(A) + Mem(B) since there is a time where both modes are active. It also makes things much simpler for libraries that should be only active for one mode at a time.
uid: 122310 topic_id: 33002 reply_id: 132425


[TOPIC: post.html]
#14

EHO

[GLOBAL: userInfoPane.html]
EHO
  • Contributor

  • 259 posts
  • Corona SDK

@aisaksen, I appreciate you confirming that sequence.

I've been plagued by an intractable problem that crashes the system and I suspect it relates to external modules getting referenced in funky sequencing by the storyboard API.

@Danny, any word as to when daily builds will kick off again? I would love to make sure that I'm using the API as intended.
uid: 105707 topic_id: 33002 reply_id: 132542


[TOPIC: post.html]
#15

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,666 posts
  • Corona SDK

For the visual thinkers. I tested this with 971 and drew it up:

uid: 110228 topic_id: 33002 reply_id: 132647


[TOPIC: post.html]
#16

bjsorrentino

[GLOBAL: userInfoPane.html]
bjsorrentino
  • Veteran

  • 8,506 posts
  • Corona SDK

Hi guys,
This issue has been investigated and fixed, and it will be available in one of the next few daily builds.

Thanks,
Brent
uid: 200026 topic_id: 33002 reply_id: 135024


[TOPIC: post.html]
#17

Danny

[GLOBAL: userInfoPane.html]
Danny
  • Corona Geek

  • 2,597 posts
  • Corona Staff

@theokieza:

See the gotchas section here:

http://docs.coronalabs.com/api/library/storyboard/reloadScene.html

"If you intend for a "createScene" event to be dispatched when storyboard.reloadScene() is called, you must explicitly "purge" the scene (using storyboard.purgeScene() or [storyboard.purgeAll()][api.library.storyboard.purgeAll()]) within a "willExitScene" or "exitScene" event listener."
We plan to make this easier in future revisions of storyboard

uid: 84637 topic_id: 33002 reply_id: 135339


[TOPIC: post.html]
#18

theokieza

[GLOBAL: userInfoPane.html]
theokieza
  • Observer

  • 7 posts
  • Corona SDK

So now how do I get createScene to fire again?

storyboard.purgeScene does not seem to do it's job anymore...
uid: 134920 topic_id: 33002 reply_id: 135338


[TOPIC: post.html]
#19

theokieza

[GLOBAL: userInfoPane.html]
theokieza
  • Observer

  • 7 posts
  • Corona SDK

storyboard.purgeScene() was working before, but not after the changes to storyboard.
uid: 134920 topic_id: 33002 reply_id: 135340


[TOPIC: post.html]
#20

theokieza

[GLOBAL: userInfoPane.html]
theokieza
  • Observer

  • 7 posts
  • Corona SDK

I am using storyboard.purgeScene( storyboard.getCurrentSceneName() ) in scene:exitScene.
I will roll back to an earlier version of Corona for the time being.
Thanks for the help so far.

Regards

T
uid: 134920 topic_id: 33002 reply_id: 135342


[TOPIC: post.html]
#21

Danny

[GLOBAL: userInfoPane.html]
Danny
  • Corona Geek

  • 2,597 posts
  • Corona Staff

@theokieza:

Here is a workaround you can use in the meantime (with the latest version of storyboard)

It's not officially supported so let me know how it works out for you, and again the aim is to fix storyboard so things like this don't need workarounds.

storyboard.scenes[storyboard.getCurrentSceneName()]:dispatchEvent( { name = "createScene" } )
uid: 84637 topic_id: 33002 reply_id: 135468


[TOPIC: post.html]
#22

canupa.com

[GLOBAL: userInfoPane.html]
canupa.com
  • Contributor

  • 450 posts
  • Corona SDK

well. with the latest build our game is destroyed and doesn't work at all!
And older builds force me to use doubtful workarounds.
We want to be able to reload the scene like it was loaded the first time (i.e. purge + reload)

What do you recommend?
What corona build is working like documented?
When exactly will the soryboard API bugs be fixed?

We intend to submit an update of our game as soon as possible so please be quick!
uid: 70635 topic_id: 33002 reply_id: 135593


[TOPIC: post.html]
#23

Danny

[GLOBAL: userInfoPane.html]
Danny
  • Corona Geek

  • 2,597 posts
  • Corona Staff

@Canupa. Can you provide more specific information please?

We know there are a lot of outstanding issues with storyboard, and we will be re-writing the storyboard library from scratch in the new year (Starting work on it in January) with the goal of a more powerful, easier to use and stable library.
uid: 84637 topic_id: 33002 reply_id: 135595


[TOPIC: post.html]
#24

canupa.com

[GLOBAL: userInfoPane.html]
canupa.com
  • Contributor

  • 450 posts
  • Corona SDK

exactly, I'm talking about "lot of outstanding issues".

in this particular case I'm trying to purge the scene and then reloading/recreating it as if it was loaded for the first time (after the app has started).

When using build .976 I need to delay the storyboard.gotoScene-call after I purged the scene, otherwise the game crashes.

When using build .986 the purging doesn't work at all and createScene is never invoked.

so the question is: is there a foolproof way to re-create a scene?
uid: 70635 topic_id: 33002 reply_id: 135599


[TOPIC: post.html]
#25

aisaksen

[GLOBAL: userInfoPane.html]
aisaksen
  • Contributor

  • 141 posts
  • Enterprise

I just verified that the ordering now works correctly in .987
uid: 122310 topic_id: 33002 reply_id: 135609



[topic_controls]
Page 1 of 2 1 2
 
[/topic_controls]