Be a Supporter!

Too many symbols on stage

  • 423 Views
  • 7 Replies
New Topic Respond to this Topic
Momo-the-Monkey
Momo-the-Monkey
  • Member since: Oct. 15, 2005
  • Offline.
Forum Stats
Member
Level 45
Musician
Too many symbols on stage 2013-02-14 23:24:00 Reply

Being more of a coder, I'm not too keen on all the fancy art tricks. I've got a tree symbol on the stage, and I've duplicated it to make a forest of trees. The forest isn't too large, maybe 75-100 trees, but it's making flash a little laggy, both in interactivity and when saving.

Is there a trick to prevent this? Since this is only one forest (and I am a long way from the last forest I create), I fear flash will become unusable in the future. I could break down the symbols, but I want the ability to edit them. Maybe this is just too much to ask? Thanks in advance.


Hello, from the past!
[ PHP: Main ]

BBS Signature
MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to Too many symbols on stage 2013-02-14 23:37:11 Reply

At 2/14/13 11:24 PM, Momo-the-Monkey wrote: Being more of a coder, I'm not too keen on all the fancy art tricks. I've got a tree symbol on the stage, and I've duplicated it to make a forest of trees. The forest isn't too large, maybe 75-100 trees, but it's making flash a little laggy, both in interactivity and when saving.

Is there a trick to prevent this? Since this is only one forest (and I am a long way from the last forest I create), I fear flash will become unusable in the future. I could break down the symbols, but I want the ability to edit them. Maybe this is just too much to ask? Thanks in advance.

Movieclips are pretty slow as is; using a bunch slows a game down a lot. You could look into blitting, which is basically copying and pasting an image and runs very quickly. Instead of movieclips, you use image data, called bitmapdata, and it's function "copyPixels()." Or you could just make a forest instead of each tree, but then you'd lose the ability to edit each tree without having to remake it.

MintPaw
MintPaw
  • Member since: Jun. 11, 2006
  • Offline.
Forum Stats
Member
Level 10
Programmer
Response to Too many symbols on stage 2013-02-15 11:12:44 Reply

If you want to make a large scale static background like that I suggest taking your tree model and importing it into Photoshop or something similar and creating your forest there, then just export it as on png and use that.

Vector art is the bane of Flash's existence, 75 vector objects on the stage can drop the framerate to like 5fps, you probably lucky have pretty simple trees.


If ya have something to say, PM me. I have a lot of time to spare.
Also never PM egg82.

BBS Signature
Momo-the-Monkey
Momo-the-Monkey
  • Member since: Oct. 15, 2005
  • Offline.
Forum Stats
Member
Level 45
Musician
Response to Too many symbols on stage 2013-02-15 16:30:36 Reply

Thanks for the info. To photoshop I go!


Hello, from the past!
[ PHP: Main ]

BBS Signature
Rustygames
Rustygames
  • Member since: May. 7, 2005
  • Offline.
Forum Stats
Member
Level 19
Programmer
Response to Too many symbols on stage 2013-02-16 09:31:31 Reply

At 2/15/13 04:30 PM, Momo-the-Monkey wrote: Thanks for the info. To photoshop I go!

Creating a bitmap in photoshop is the best way really. However it does depend on what you're trying to achieve. To be honest if you're just moving the forest and not scaling it then ticking the "cache as bitmap" box in the IDE will solve the lag (basically that saves all the vectors as a bitmap during runtime and then doesnt bother redrawing the heavy vectors each time, just draw the bitmap it "remembered"


- Matt, Rustyarcade.com

Momo-the-Monkey
Momo-the-Monkey
  • Member since: Oct. 15, 2005
  • Offline.
Forum Stats
Member
Level 45
Musician
Response to Too many symbols on stage 2013-02-16 10:04:53 Reply

At 2/16/13 09:31 AM, Rustygames wrote: Creating a bitmap in photoshop is the best way really. However it does depend on what you're trying to achieve. To be honest if you're just moving the forest and not scaling it then ticking the "cache as bitmap" box in the IDE will solve the lag

Hmm. Unfortunately it's not just runtime that's laggy, but the IDE itself just when I'm editing and moving things around.


Hello, from the past!
[ PHP: Main ]

BBS Signature
MintPaw
MintPaw
  • Member since: Jun. 11, 2006
  • Offline.
Forum Stats
Member
Level 10
Programmer
Response to Too many symbols on stage 2013-02-16 11:13:09 Reply

At 2/16/13 09:31 AM, Rustygames wrote:
At 2/15/13 04:30 PM, Momo-the-Monkey wrote: Thanks for the info. To photoshop I go!
Creating a bitmap in photoshop is the best way really. However it does depend on what you're trying to achieve. To be honest if you're just moving the forest and not scaling it then ticking the "cache as bitmap" box in the IDE will solve the lag (basically that saves all the vectors as a bitmap during runtime and then doesnt bother redrawing the heavy vectors each time, just draw the bitmap it "remembered"

Yeah, but the feature is largely broken, scaling and even possibly changing the position would cause them to be redrawn.
Although if you're using Flash CS6 there's an option to convert to bitmap which would help.


If ya have something to say, PM me. I have a lot of time to spare.
Also never PM egg82.

BBS Signature
Rustygames
Rustygames
  • Member since: May. 7, 2005
  • Offline.
Forum Stats
Member
Level 19
Programmer
Response to Too many symbols on stage 2013-02-16 18:17:12 Reply

At 2/16/13 11:13 AM, MintPaw wrote:
At 2/16/13 09:31 AM, Rustygames wrote:
At 2/15/13 04:30 PM, Momo-the-Monkey wrote: Thanks for the info. To photoshop I go!
Creating a bitmap in photoshop is the best way really. However it does depend on what you're trying to achieve. To be honest if you're just moving the forest and not scaling it then ticking the "cache as bitmap" box in the IDE will solve the lag (basically that saves all the vectors as a bitmap during runtime and then doesnt bother redrawing the heavy vectors each time, just draw the bitmap it "remembered"
Yeah, but the feature is largely broken, scaling and even possibly changing the position would cause them to be redrawn.
Although if you're using Flash CS6 there's an option to convert to bitmap which would help.

The feature isn't "broken". It will cache the vectors as a bitmap and won't redraw if the clip remains static or is translated (moved). If it is rotated or scaled then of course the vectors will need to be re-rendered and re-cached.

However if you're having problems in the IDE as well I would follow MintPaw's advice which was the best suggestion in the first place :)


- Matt, Rustyarcade.com