00:00
00:00
Newgrounds Background Image Theme

GrawlixMan just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Large objects and performance - AS3

411 Views | 7 Replies
New Topic Respond to this Topic

To connect with my previous question about a chain movement in a group of objects, I'd like to know if toggling visibility would improve performance.

I'm dealing with 14 move clips that take up about 200 pixels each, not including the rest of the smaller objects added to the game. They are going to be constantly moving, but many times the pieces will be off-screen. Working with that, I'm going to try to come up with a simple conditional for if they are off the screen in either four directions. Do you even think that would help?

I'm only experiencing a little bit of lag at times, but as soon as I start animating them and adding more functionality besides movement, I could see things start to drag more.

Any advice for a bunch of large, moving objects and improving performance?

Response to Large objects and performance - AS3 2014-09-25 02:32:00


At 9/25/14 12:31 AM, Barzona wrote: I'm only experiencing a little bit of lag at times

You should be able to display 14 DisplayObjects without experiencing any lag.

I doubt that toggling their visibility is the bottleneck of your performance.
Don't just optimise something. Use a profiler to see what's going on and what causes the lag.

Response to Large objects and performance - AS3 2014-09-25 04:21:33


At 9/25/14 02:32 AM, milchreis wrote:
At 9/25/14 12:31 AM, Barzona wrote:
You should be able to display 14 DisplayObjects without experiencing any lag.

Good to know. Does this also count for just art assets that don't have any code tied to them? Well...I guess technically they would be added to the stage with code...

Like say you had twice the amount of display objects on stage at once for the game but it was just art assets for visual appeal and the game was extremely simple with little code - it would still lag during gameplay?

If so, I guess that's why you would flatten all your assets into one single image in say Photoshop...

Response to Large objects and performance - AS3 2014-09-25 04:22:43


If so, I guess that's why you would flatten all your assets into one single image in say Photoshop...

By all assets I meant the type I was describing in my previous post (like background elements for example that are not tied to code).

Response to Large objects and performance - AS3 2014-09-25 10:50:40


At 9/25/14 04:21 AM, Hero101 wrote: Like say you had twice the amount of display objects on stage at once for the game but it was just art assets for visual appeal and the game was extremely simple with little code - it would still lag during gameplay?

If so, I guess that's why you would flatten all your assets into one single image in say Photoshop...

There isn't a general rule for the number or size of DOs lagging the game. If you have 1000 mcs, it will lag. If you have 1000 blit calls, it won't lag. If the game isn't lagging, don't worry about it. If you have lots of vector art with a ton of tesselations, it will lag. Or maybe not. Try it and see.

Response to Large objects and performance - AS3 2014-09-25 13:12:43


There's no real object lag threshold, obviously it depends on lots of things like size, graphic type, filters, user PC spec, et cetera. . .

He's just saying in general if you're making a game with that few objects and causing lag you're likely doing something very inefficiently. Check a profile like Adobe Scout.


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

Also never PM egg82.

BBS Signature

Response to Large objects and performance - AS3 2014-09-25 14:21:13


At 9/25/14 01:12 PM, MintPaw wrote: At 9/25/14 10:50 AM, MSGhero wrote: If you have 1000 mcs, it will lag. If you have 1000 blit calls, it won't lag.

Blitting.. Definitely need to learn more about that.

There's no real object lag threshold, obviously it depends on lots of things like size, graphic type, filters, user PC spec, et cetera. . .

He's just saying in general if you're making a game with that few objects and causing lag you're likely doing something very inefficiently. Check a profile like Adobe Scout.

Alright, good to know. I'm not experiencing a lot of, or any, lag most of the time. The question was more about the future when things get bigger. I read a tutorial a long time ago about building a platform game (not sure where to find that tut anymore) in which they were building a system that would make off-screen elements of the stage invisible. It was only a bunch of floors/walls in their example. Based on that, i thought it would benefit me.

If you guys say that a reasonable number of display objects won't affect much, I'll take your word.

Response to Large objects and performance - AS3 2014-09-25 16:07:15


Don't worry about prefect performance right now, every now and then pop into Scout and see if anything's taking way more time than it should. And if there is debug it, just try to look around and understand what takes time and what doesn't, you'll get it.


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

Also never PM egg82.

BBS Signature