Object Amount vs. Object Copies

Discussion and feedback on Construct 2

Post » Sun Feb 17, 2013 1:34 am

If you have a sprite, and copy the same instance 10 times on a map, would it take as much processing power if you had 10 DIFFERENT sprites on a map, or would it just reflect the download size?
B
22
S
3
Posts: 451
Reputation: 2,135

Post » Sun Feb 17, 2013 1:44 am

Many objects in one layout, it would take processing power

Copied sprites don't affect download size because only has one image file

Cloned sprites affect download size because they have multiple image files
B
96
S
25
G
20
Posts: 3,053
Reputation: 22,640

Post » Sun Feb 17, 2013 1:53 am

So for pure game speed, it's best to use 10 instances of 1 sprite instead of 10 sprites?ome6a17172013-02-17 01:55:46
B
22
S
3
Posts: 451
Reputation: 2,135

Post » Sun Feb 17, 2013 2:05 am

It doesn't matter, instances and sprites are same.
B
96
S
25
G
20
Posts: 3,053
Reputation: 22,640

Post » Sun Feb 17, 2013 2:16 am

Perfect - thanks!
B
22
S
3
Posts: 451
Reputation: 2,135

Post » Sun Feb 17, 2013 2:27 am

Your welcome, however if you have a decent computer, you could use 50 instances
B
96
S
25
G
20
Posts: 3,053
Reputation: 22,640

Post » Sun Feb 17, 2013 2:55 am

Well the reasoning for my question was based on scripting - it would be a lot easier to just create new sprites for each enemy and give them their own unique code instead of trying to control them all differently on the screen.
B
22
S
3
Posts: 451
Reputation: 2,135

Post » Sun Feb 17, 2013 5:21 pm

In my opinion, good practice is to give everything with significantly different behavior a different object. However, if you are only changing something like, say, patrol distance, it is probably best to use instances of the same object. Both use the same performance but it's generally more manageable to do it this way.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400


Return to Construct 2 General

Who is online

Users browsing this forum: Baidu [Spider], MilkGames and 13 guests