Skip to main content
GameDev.net gamedev.net
🔒 Locked

[web] PSP flash

Started by zedz Feb 18, 2007 at 2:13 AM 7 replies 1.5k views
Original Post
zedz
zedz
greetings ive finished off my first flash app that a started a couple of days ago check it out here www.zedzeek.com now the one problem is ive designed it to be played on the psp yet the psp cant play it!, it bales out when u start it, during the board creation phase, with the message something like 'actionscript was taking to long thus have to disable it' this is due to when i create the board it uses a recursive function that takes quite a bit of cpu power what are my options of improving this? -one method would be having a set of fixed boards (but i dont like that so much) im wanting to make some other flash games for the psp eg chess (which obviously requires a bit of cpu power) will i be running into this problem constantly? ta zed
SimonForsman
SimonForsman
im not quite sure (havn't used flash on the psp) but 2 things you may want to try:

1) Use an iterative function instead of a recursive one (If the stack is limited on the psp)

2) split the calculation/generation over multiple frames.
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
zedz
zedz
yeah thanks ill try out method 2 first (i dont think ive blown the stack) it looks like if a script is taking ~10 secs then the psp flash decides to pull the plug cause it decides its prolly in a infinite loop or something (which is a good idea normally)
gonna be a PITA with chess :)
i wrote the thing first in c++ on my computer, it seems flash is at least 100-10000x slower (is this normal?, i was expectly it to be lots slower but not by such a large margin)
SimonForsman
SimonForsman
Quote:
Original post by zedz
yeah thanks ill try out method 2 first (i dont think ive blown the stack) it looks like if a script is taking ~10 secs then the psp flash decides to pull the plug cause it decides its prolly in a infinite loop or something (which is a good idea normally)
gonna be a PITA with chess :)
i wrote the thing first in c++ on my computer, it seems flash is at least 100-10000x slower (is this normal?, i was expectly it to be lots slower but not by such a large margin)


Well flash is basically interpreted and can thus be extremely slow. (i belive AS3.0 and Flash9 has a JIT compiler though).

the PSP is also ALOT slower than your computer.

[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
zedz
zedz
Quote:
Well flash is basically interpreted and can thus be extremely slow. (i belive AS3.0 and Flash9 has a JIT compiler though).

nice, though the question wether the psp gets it is very debatable

Quote:
the PSP is also ALOT slower than your computer.

true, then again its (psp) is certainly much quicker than my pc from 10 years ago,
im wondering if sony have purposely crippled flash on the psp (after all they dont want it to be *too* attractive)
still flash+psp is prolly a good enuf combination for the stuff im interested in writing (strategy/puzzle stuff)

btw ive now got the game up+running on the psp (by breaking up the construction into phases, i notice the pc also suffers from the same error, ie if youre debugging a flash app, it often comes up with the message 'this app is taking to long do u wanna disable it?)

SimonForsman
SimonForsman
Quote:
Original post by zedz
Quote:
Well flash is basically interpreted and can thus be extremely slow. (i belive AS3.0 and Flash9 has a JIT compiler though).

nice, though the question wether the psp gets it is very debatable

Quote:
the PSP is also ALOT slower than your computer.

true, then again its (psp) is certainly much quicker than my pc from 10 years ago,
im wondering if sony have purposely crippled flash on the psp (after all they dont want it to be *too* attractive)
still flash+psp is prolly a good enuf combination for the stuff im interested in writing (strategy/puzzle stuff)

btw ive now got the game up+running on the psp (by breaking up the construction into phases, i notice the pc also suffers from the same error, ie if youre debugging a flash app, it often comes up with the message 'this app is taking to long do u wanna disable it?)


well im happy that you got it working :)

i think i should give it a try on my psp then :)


Edit:
tried running it at 222Mhz and it bails out after filling roughly half the board. (first 3 columns + 4 squares in the 4th column)

with 133Mhz it fills the first 2 rows before complaining.

can't test 333Mhz as im running an old devhook version (the wifi connection doesn't work when i run at 333Mhz).

[Edited by - SimonForsman on February 18, 2007 10:35:57 PM]
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
zedz
zedz
whoops sorry mate i havent uploaded the fixed version to my website yet ( i still wanna optimize it first ), as its still to slow ( also i need to fix the radiobuttons, as trying to click on them with the psp joystick thing is nearly impossible, ill turn them into big buttons or something )

before i get to carried away theres a couple of performance things u or anyone could answer if u wish? thanks for your help, zed

whatever string i use for a identifier doesnt matter right, since the string is converted to a hash key anyways
ie both these execute at the same speed
this["TT"]._x = X;
this["a big long string blah blah"]._x = X;

is it bad, leaving in stuff that doesnt do anything eg with the following, in C the following piece of code would be ignored by the compiler (is this also true with flash)
for (var i = 0; i < SIZE; i++)
{
var X = 100*i;
}
SimonForsman
SimonForsman
Quote:
Original post by zedz
whoops sorry mate i havent uploaded the fixed version to my website yet ( i still wanna optimize it first ), as its still to slow ( also i need to fix the radiobuttons, as trying to click on them with the psp joystick thing is nearly impossible, ill turn them into big buttons or something )

before i get to carried away theres a couple of performance things u or anyone could answer if u wish? thanks for your help, zed

whatever string i use for a identifier doesnt matter right, since the string is converted to a hash key anyways
ie both these execute at the same speed
this["TT"]._x = X;
this["a big long string blah blah"]._x = X;

is it bad, leaving in stuff that doesnt do anything eg with the following, in C the following piece of code would be ignored by the compiler (is this also true with flash)
for (var i = 0; i < SIZE; i++)
{
var X = 100*i;
}


as for the identifier names i would assume that their length didn't matter. i wouldn't count on flash optimizing that loop though.

[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
zedz
zedz
i thought i better update this with the new info

this["TT"]._x = X;
this["a big long string blah blah"]._x = X;

the shorter string WILL perform better

also someone mentioned its ok to do
X = 10;
but ive found its actually better performance wise to do
var X = 10;

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.