Hi Corona
I’m noticing some really strange behaviour which I wondered if you could help with? They seem to be dependent on the size of the code - which is the best way I can explain it and it is making debugging a nightmare.
if I forget a closing } instead of a compile or runtime error the simulator just hangs with no error at all. Something like. transition.to(object, {time=500) - obviously missing the } but compiles and crashes at that line with no error.
Also, if something is nil (spelling mistake, not initialised yet, out of scope, etc.) the same thing happens.
a = 3; if aa ~= 1 then print(“a not 1”) end - should through a “attempted to compare nil with number” error but just crashes. It doesn’t warn (anymore) on invalid upscale values or missing forward references either. The only syntax check it seems to get right is checking for eof (with respect to end) and the compiler won’t run if its missing one or has an extra one.
Sometimes I’ll get a runtime error, sometimes a console message about “storyboard could not load screen” but 99% of the time just a crash. If the error is in a class file (I use metatables a lot), it will never raise an error period.
I also get strange behaviour with some transitions randomly stopping and worse still, not firing their onComplete handlers. At it’s most basic level, I have a display group with a single display object transitioning like transition.to(object, {time=500, xScale=1.5, yScale=1.5, alpha=0, iterations=0}). If I also transition the alpha on the display group (to hide it and then show it 5 seconds later) the display object transition will have “frozen” and I will have a random alpha and scale each time I run. I’m having to drop and recreate the display object on each hide/show of the display group to ensure it always functions correctly.
Or transactions will not completely finish but fire an onComplete handler. Something like this transition.to(object, {time=250, alpha=1, onComplete=function() print(“alpha=”…object.alpha) end }) - will print numbers like 0.91453543 or 0.978665.
I have tried public builds from 2100 to the latest. 2100 used to give strange SDK level errors (invalid pcalls I think) and hang but the latest build doesn’t. So I am wondering if these errors are now just being suppressed and that is what is causing my strange transition errors (sometimes stopping, sometimes not completing, sometimes not firing their handlers)?
I can’t really file a bug report without sending 40Mb worth of code and assets. If I have a small project then none of this happens. It is almost like the compiler will handle error checking up to10,000 lines of code but can’t do any more. This makes continuing to work on my game painful and frustratingly slow.
Any suggestions would be greatly received.
Also, it would be great if we could create threads - even if it was just one extra thread! Having single-threaded code is really not the way forward with multi-core devices. Especially for things like background loading from the internet, lazy loading, screen updates with long running logic blocks, displaying proper progress indicators, etc. Most other languages allow this, JS, Java, etc. Is this something in the pipeline?
Last point, with regard to Facebook (and on device). Is there anyway to make this smoother? When the game first loads you can see Corona pushed to the background and see Facebook log on pages momentarily appear and then disappear (app is already allowed) and then control returns to Corona. This takes a second or so and looks terrible flicking between the two apps. If the game is suspended and rerun, either directly or via a notification, then this doesn’t happen. Is there anyway of stopping this screen flicking between apps? Other games with Facebook login (Clash of Clans for example) never show Facebook unless asking for permissions. This makes Corona built games look a “bit cheap” in comparison. Is there anyway to supress this or handle it better? I can’t seem to force a splash screen over the top as Corona goes into the background.
Sorry for the long post, but this is really causing me issues.
Thanks
Adrian