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
36
S
11
G
1
Posts: 523
Reputation: 3,929

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
34
G
29
Posts: 3,139
Reputation: 28,236

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
36
S
11
G
1
Posts: 523
Reputation: 3,929

Post » Sun Feb 17, 2013 2:05 am

It doesn't matter, instances and sprites are same.
B
96
S
34
G
29
Posts: 3,139
Reputation: 28,236

Post » Sun Feb 17, 2013 2:16 am

Perfect - thanks!
B
36
S
11
G
1
Posts: 523
Reputation: 3,929

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
34
G
29
Posts: 3,139
Reputation: 28,236

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
36
S
11
G
1
Posts: 523
Reputation: 3,929

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
92
S
31
G
24
Posts: 3,191
Reputation: 32,674


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 7 guests