Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Romans_I_XVI
Roku Guru

Re: Roku locking up / freezing

"dev42" wrote:

Besides, any true game coder allocates memory just once...at the beginning... even on the Roku. 8-)


I guess this isn't me :oops:

Should I be doing this? Currently I am creating the bitmaps when I call the function for either my score screen or my gameplay screen. When the while loop within those functions is broken, the bitmaps automatically remove themselves from memory. Should I change this so that my bitmaps are all created as global variables when the game starts? If I did this I would literally have everything loaded into memory at the same time. Which to me seems unnecessary and could even put me close to the limit (especially considering the amount of content I'm adding in with the next update)

Any tips appreciated. I really am still a novice with this.
0 Kudos
TheEndless
Channel Surfer

Re: Roku locking up / freezing

"Romans_I_XVI" wrote:
"dev42" wrote:

Besides, any true game coder allocates memory just once...at the beginning... even on the Roku. 8-)
Should I be doing this?

Do not do this...
I'm fairly certain that dev42 was joking...
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
Romans_I_XVI
Roku Guru

Re: Roku locking up / freezing

"TheEndless" wrote:
"Romans_I_XVI" wrote:
"dev42" wrote:

Besides, any true game coder allocates memory just once...at the beginning... even on the Roku. 8-)
Should I be doing this?

Do not do this...
I'm fairly certain that dev42 was joking...


Oh lol. Thanks TheEndless. I was somewhat confused. I know there are a few things I need to fix as far as memory allocation, which I have already outlined in my post. But this was pointing me in a completely opposite direction lol. I was thinking how to have less items in memory at any given moment, and he says to put them all in...

Thanks for clarifying this.
0 Kudos
belltown
Roku Guru

Re: Roku locking up / freezing

"Romans_I_XVI" wrote:
One quick question. Do we have any reports of this happening among non-developers, that is, on Rokus that don't have developer mode enabled? I have no idea why that would even matter, but you never know. We all seem to be having this happen amongst some timeframe near to when we side loaded a channel.

I took my Roku 2XS out of developer mode and re-booted then went straight into playing Retaliate again. After a few games, the Roku hung again. As before, the audio continued playing for a few more seconds then stopped. After a while longer the (blank) screensaver kicked in. I pressed the home key, which removed the screensaver, showing the game screen on display. I tried over the next 10-15 minutes to get back to the Roku home page, but the Home key had no further effect, nor did any other key. The game hung in roughly the same spot as it has often (but not always) hung on previous occasions. My only recourse at this point was to re-boot the Roku.

It may be that there's something funky going on with your code. However, the Roku still shouldn't hang like that no matter what is going on with your code. The Home key is always supposed to get you back to the home screen.

Here's where the Roku hung:

0 Kudos
Romans_I_XVI
Roku Guru

Re: Roku locking up / freezing

Thanks belltown for all the testing and feedback. I want to get you involved with testing the latest unpublished version before I submit it to Roku. I will send you a PM with the access code.

I notice that the screenshot shows the game frozen while one of the "scripted events" as I refer to them is occurring. Now this may be far fetched but I believe in the current published version I accidentally left a print statement uncommented which fires right before one of those "scripted events" occurs.

We have discussed here some of the strange adverse affects leaving print statements in can have. viewtopic.php?p=483939

Anybody think this is a potential cause?

Again belltown I will PM you the code and you can see if it's reproducable in the latest build.

Thanks!
0 Kudos
Komag
Roku Guru

Re: Roku locking up / freezing

Well, reviewing that, it sounds like trying to print something invalid will cause a crash - Is there any chance a value trying to be printed could be invalid there?
0 Kudos
Romans_I_XVI
Roku Guru

Re: Roku locking up / freezing

No. If the variable it's printing would somehow be invalid it would crash the game anyway. The variable just says which event got selected to run.

Plus it shouldn't matter regardless. Should just crash the app, not freeze the entire Roku. I guess I was referring more to the strange dependency on the network.

I could be way off though. It's really tough to figure out. Maybe it's as simple as my game running the Roku CPU too hard and it just gives up lol. I know for sure on the slower devices it can have a hard time keeping up with everything that needs to be drawn to the screen.
0 Kudos
Romans_I_XVI
Roku Guru

Re: Roku locking up / freezing

Also there is still the fact that holding down any button creates a huge performance hit, I have no idea why but just play my game on a Roku 1 and you will know exactly what I mean. Since holding down buttons is like %90 of my game, this could also be an issue.
0 Kudos
EnTerr
Roku Guru

Re: Roku locking up / freezing

"Romans_I_XVI" wrote:
Also there is still the fact that holding down any button creates a huge performance hit, I have no idea why but just play my game on a Roku 1 and you will know exactly what I mean. Since holding down buttons is like %90 of my game, this could also be an issue.

If i remember, holding down a button on the IR remote continuously fires the "button down" IR code (you can check with the front camera of your phone). I don't remember if that's received repeatedly as B/S event (and if so, streamline the code) but someone is handling that in the player.
0 Kudos
Romans_I_XVI
Roku Guru

Re: Roku locking up / freezing

My code is not set to even pay attention to say, the fast forward button or the * button. But these will all have the same ill effects. It doesn't matter what button it is or whether brightscript is doing something with it or not.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.