-
Senior Member
Game Performance issues
Hi,
I made a game for a client, Flash 10, AS3 (1000x750 stage). The game has 5 different stages, which I all split into individual movies, which are loaded when needed. While I have no problems on my computer (old mac intel) and my client also not, several people have problems with slow performance. I made the functionality so that only what is needed is active and present and other stuff is removed including listeners. The game has however high resolution ai vector graphics, which move and there is a Flint explosion movie loaded whenever a shot is fired. The client wanted all the graphics.
What is your experience with performance issues? I also read that Player 10.0 has problems and it appeared to me that 10.1 showed better performance.
thanks for any input.
- The right of the People to create Flash movies shall not be infringed. -
-
Senior Member
I believe your game is simply too big for weaker computers. Having such a huge stage makes update slow even when no code is running.
-
Senior Member
Thanks tonypa. It turned out that the explosion was the problem, which is an external movie loaded with every shot. It was not unloaded when the shot was finished and the target killed. Then with the next shot it was unloaded. It is a one line change in script but reduced the browser performance by 50%.
- The right of the People to create Flash movies shall not be infringed. -
-
talk to the hand!
Sponsors usually tell you they want it no more than 650 wide since a lot of websites don't want it any larger.
You might also want to optimize it a bit, and pre-draw the bullets,
only use 1 enterFrame.
2 good optimizing resources
http://www.nbilyk.com/optimizing-actionscript-3
http://osflash.org/as3_speed_optimizations
some other things:
-Only calculate sine and cosine after desired object has rotated only
(also check my light sine and cosine)
-Multiplying is faster than dividing.
-Use cacheAsBitmap (under blending modes) if the object doesn't shrink or rotate, this makes flash render the object only once.
-Use :int and :uint like crazy but dont use them to multiply or divide a :Number better use a :Number
-Use if(a<0){a=-a} intead of abs()
-There's alot more in the resources make sure to check them out.
Once you dominate optimization you'll code in a lighter way from the start which I suggest very much.
Last edited by Never_land:(; 05-25-2010 at 11:32 AM.
-
Senior Member
Thanks,
I already had done what you suggested.
I never use ENTER_FRAME only Timer.
As I mentioned it was only because of the explosion movie. The game is now running between 20-50 % of the browser CPU.
The stage size was what the client wanted.
- The right of the People to create Flash movies shall not be infringed. -
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|