Memory use

Get help using Construct 2

Post » Wed Jul 24, 2013 2:00 am

What uses less memory?

Use 1 object sprite for each image like this:



Or images in frames of 1 object, and use the frames:

marquet2013-07-24 02:01:29
B
21
S
5
G
2
Posts: 82
Reputation: 3,032

Post » Wed Jul 24, 2013 2:24 am

I doubt it makes much of a difference so it's probably best to prioritize what makes your events cleaner, more readable and easier to work with.

Personally I think too many objects is awkward with the C2 interface, turning all those objects into animations/frames inside one object and treating that as a 'group' is often easier.

Although if you really want to find out, you could test it yourself.
I guess just create 1000 of each with a loop on startup and check the memory usage with task manager

B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Wed Jul 24, 2013 3:05 am

I try

1 object repeat 96 times FPS 30 CPU 0.146

29 diferent objects      FPS 31 CPU 0.139

So is realy better use 1 object and use each frame for each image in my Pc core i3 4gb ram its 3X faster
B
21
S
5
G
2
Posts: 82
Reputation: 3,032

Post » Wed Jul 24, 2013 4:03 am

Those results don't look statistically different. I would go with however is cleaner, per @keepee
B
22
S
4
G
1
Posts: 100
Reputation: 2,150

Post » Wed Jul 24, 2013 6:26 am

Look: if i put 96 diferent sprites in same object like this

https://dl.dropboxusercontent.com/u/72359481/PA%C3%87OCArule2/images/chao-sheet0.png

Runs in 30 FPS

if i use 29 objects they will use the same o PC.
what is better to have 96 or 29 objects for the same price?
B
21
S
5
G
2
Posts: 82
Reputation: 3,032

Post » Wed Jul 24, 2013 12:12 pm

The difference is probably negligible.
Scirra Founder
B
383
S
225
G
86
Posts: 24,134
Reputation: 190,601


Return to How do I....?

Who is online

Users browsing this forum: RadiantRogue and 2 guests