Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Animated sprite speed question

Author
Message
mr Handy
17
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 28th Aug 2014 00:37 Edited at: 28th Aug 2014 00:48
Hello, fellows!

What is faster (better) - to have 100 sprites from 5x5 animated sprite or have 1 sprite and change it's frame 100 times?

Note: I am using paste sprite anyway, 100 or 1, to not to bother with depth.

Edit: I am using animated sprite as atlas image.

mr Handy
17
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 5th Sep 2014 16:49
Eh, anyone?

SamKM
15
Years of Service
User Offline
Joined: 25th May 2009
Location:
Posted: 6th Sep 2014 00:03 Edited at: 6th Sep 2014 00:04
I'd definitely say it'd be faster to have just one sprite and change it's image
In my experience, changing one sprite's image takes almost no time at all, but having 100 sprites on the screen is probably going to mean some kind of performance hit, even if you hide them

The code never bothered me anyway...
mr Handy
17
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 6th Sep 2014 20:32
I am not changing the image itself, but the frame only. Also I remember that lots of sprites are faster than same amount of "paste", but managing their depth would be painful so I am using paste. The issue is I don't know what is better to paste one sprite with changing its frame 1000 times per cycle or make 1000 animated sprites.

Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 6th Sep 2014 20:55
Hello,

While it may seem obvious, if you have access to both methods, why not just try both methods separately and measure the performance of each? That would give you an answer in the context of your own program.

Enjoy your day.
mr Handy
17
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 6th Sep 2014 22:43
Yeah, I thought tere could be something hidden that I could not know.

Login to post a reply

Server time is: 2025-05-14 18:48:57
Your offset time is: 2025-05-14 18:48:57