Blanked out Assets

Hi,

Recently while working with Corona, I found that on random occasions, my sprites and stationary image assets would disappear and be replaced with a solid white or red rectangle the size of the content boundaries.

In the case of the sprites, the sprite sequence continues to be played but all I can see is a solid white or red rectangle changing its size every frame.

The problem went away for a while but now it’s coming back. Oh and in random situations the simulator crashes when I reload the script(Ctrl+R).

Anyone with any ideas why these problems are occurring?
[import]uid: 108204 topic_id: 25912 reply_id: 325912[/import]

Is this just on device or in the simulator as well? If device, iOS or Android?

What does the terminal print when Corona crashes? [import]uid: 52491 topic_id: 25912 reply_id: 104886[/import]

I had this Issue before? It turned out to be me calling my clean function after switching scenes in director. If your using director make sure you clean before you change scenes not right after.

Hope this helps [import]uid: 39088 topic_id: 25912 reply_id: 105002[/import]

I’ve seen it happen on my HTC Desire Z once or twice. Very rarely does it occur on the devices. But it happens in the simulator pretty much all the time.

In fact it just happened again. Here’s a screenshot: http://imgur.com/uQDCL

As for the crashes, there’s nothing in the terminal when it crashes. The simulator just whites out and terminates along with the terminal. Is there anywhere I could obtain crash logs? [import]uid: 108204 topic_id: 25912 reply_id: 105010[/import]

@Method Mobile
I use the new storyboard API so I’m not too sure of the equivalent feature. The thing about the blanked out assets is that, once it happens, it sticks through even when I reload the script.

It can only be resolved when I restart the simulator, so I doubt it’s something wrong with the code. [import]uid: 108204 topic_id: 25912 reply_id: 105012[/import]

Hmmm. I think mine went away when ever I reloaded my game. It didnt stick like you are saying. I remember someone talking about file permisions before. That might be something to check.

Are they images pngs? Maybe the size? IDK

In your app do you change scenes? If so, Does this happen when you load your game initially or after switching scenes.

when I say clean I mean when you clean up before changing scenes. If you change scenes you must have a function that cleans up. I’m not sure if storyboard does this on its own or not. If it does happen after you changing scenes and storyboard does clean by its self. Then I would suggest maybe trying director class and writing your own clean function.

I banged my head against this for a couple weeks and from personal experience it was my bad for trying to call my clean function one line after switching scenes.

Also when it was happening to me it was random like you were saying. It would only happen every once in a while. But always happend after I changed scenes.

This is just my personal experience. [import]uid: 39088 topic_id: 25912 reply_id: 105020[/import]

It may be worth asking about this in the Android sub forum - though from past experience I can say the only times this has happened to me on Android it has been the result of the image being far too large - though that was consistent.

OOI what is your texture memory usage at? [import]uid: 52491 topic_id: 25912 reply_id: 105023[/import]

The terminal outputs my texture memory usage at 120848388.

@Method
Yeah I use PNGs all around since for some reason the filesize is a lot smaller than JPEGs. [import]uid: 108204 topic_id: 25912 reply_id: 105056[/import]

Assuming that is the default (bytes) then in MB that’s over 100MB texture memory which is quite high.

Are you using adb logcat? I’m not an Android expert but I believe you may see some info there if it’s related to the texture memory being too high for the device.

Have you tested on iOS at all? (I see you’re a Pro developer and wonder if you’d get similar results on 3GS. Am also curious about your lag in general.) [import]uid: 52491 topic_id: 25912 reply_id: 105346[/import]

I haven’t had problems with the device for quite some time but I never figured I had a 120mb texture memory usage since I scale all my assets accordingly.

The program runs smoothly on the iPhone and kinda lags on an Android but that’s not the problem. It’s just the assets are being blanked out during simulation that makes me wonder if it’s my code that’s causing it. [import]uid: 108204 topic_id: 25912 reply_id: 105362[/import]

Is your texture memory usage going down at any point, or does it climb constantly? Wondering if you have memory leak. [import]uid: 52491 topic_id: 25912 reply_id: 105559[/import]