1 sprite with 50 animations OR 50 sprites with 1 animation ?

Discussion and feedback on Construct 2

Post » Thu Aug 10, 2017 7:53 am

Hi ,
I'm developing tower defense game, and i have many different soldiers with different ability for each . I just want to know is there any difference between that ? about performance or anything else ...
B
18
S
8
G
2
Posts: 48
Reputation: 2,504

Post » Thu Aug 10, 2017 12:52 pm

I found I needed to do too much extra checking to drill down to get the type of object I wanted to work on plus a noticeable performance hit on collision detection. Encapsulating all my objects no matter how similar they were and using families to group them just worked better overall.
Image
B
30
S
9
G
3
Posts: 171
Reputation: 3,329

Post » Thu Aug 10, 2017 1:12 pm

If you will make 1 sprite with 50 animations you will get less download size, because construct will place all the assets in the same sprite sheets.
If you will make 50 sprites with one animation each - you will get 50 sprite sheets - longer download time.
But making 50 sprites may be better in a manner of structure-simplicity, much easier to put each soldier in his family according to his abilities, so you will code according to families and not per separate animation cases. You may even earn in terms of performance because you will pick more specifically in your conditions.
If I was you I'd use 50 sprites with one animation each and place them in families (soldiers (all), land, air, fast, giant, regenerating, spawning etc...)
And later it will be much easier to add new soldiers, you will have to just add the unit in the right families and set some family variables, without touching any code.

p.s. More over, what if you will want to add more animations to a unit. Right now you have one animation - walking, but you may want to add animations "die" and "attack"... So yeah, use 50 sprites.
B
62
S
32
G
6
Posts: 125
Reputation: 7,975

Post » Thu Aug 10, 2017 5:15 pm

[quote="Yura G"][/quote]
Thanks for the time you spent . You've told me very useful tips . :)
B
18
S
8
G
2
Posts: 48
Reputation: 2,504

Post » Fri Aug 11, 2017 11:30 am

Probably the most important reason to use 50 sprites is that Construct can only load entire sprites in to memory. One sprite with 50 animations forces Construct to load all 50 animations in to memory, even if you don't use them all. With 50 sprites, it can load only the ones you're using in to memory, which is a lot more efficient.

FWIW Construct 3 can spritesheet different sprites together, so the spritesheeting is the same as if you used one sprite.
Scirra Founder
B
400
S
236
G
89
Posts: 24,546
Reputation: 195,471

Post » Fri Aug 11, 2017 12:18 pm

Thanks, the above tips have helped me a lot ...
I had some doubts too.
Huemerson
B
25
S
18
G
22
Posts: 114
Reputation: 18,581


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 11 guests