Separate objects for each piece of background art?

Discussion and feedback on Construct 2

Post » Thu Feb 13, 2014 9:37 pm

I've been working on a game for awhile and currently have a lot of the background artwork completed. Up until now, I've been placing each piece of art in a separate frame of a single object (which now has around 300 frames). This was a pretty bad idea on my part, because placing the art object into a scene causes the game to eat up TONS of RAM, since all of the art assets are loaded into memory.

I'm considering two options:

- Split the assets into about 12 individual "art" objects, as opposed to 1. My game has around 12 different varieties of backgrounds, so each object would contain the relevant assets.

- Create an individual object for each piece of art. So, 300 objects with 1 frame, instead of 1 object with 300 frames.

I think the latter approach would be better from a memory usage standpoint. I'm curious if there would be any major disadvantage to using this method, in terms of performance?Madguy2014-02-13 21:38:52
(M.A.D. are my initials. I'm not the least bit angry, really!)
@madguy90
B
11
S
4
Posts: 41
Reputation: 1,671

Post » Thu Feb 13, 2014 11:47 pm

Neither, you cannot efficiently design games like this. Read Remember not to waste your memory
Scirra Founder
B
387
S
230
G
88
Posts: 24,249
Reputation: 192,450

Post » Fri Feb 14, 2014 12:30 am

I think I might not have explained myself well enough.

I actually read that article prior to starting work on this game. I'm doing my art in a similar fashion to Rayman Origins-- using lots of smaller pieces of art that comprise a layout, and reusing this art whenever possible. When I referred to my "300 pieces of art" that I was using, that's what I was referring to-- smaller pieces of art, not an entire background.

I'm just trying to figure out the most memory-efficient way to get this art onto the screen.Madguy2014-02-14 00:33:40
(M.A.D. are my initials. I'm not the least bit angry, really!)
@madguy90
B
11
S
4
Posts: 41
Reputation: 1,671

Post » Fri Feb 14, 2014 5:06 pm

I don't think it's your method that's in question, probably the amount...

300 pieces before you start creating the level is a lot of objects...

In my experience, usually there's a drop in performance above 500 objects, that can start to chug as you approach 1000 objects, but it will depend on what these are doing exactly obviously.

I'd aim for 25-50 background "parts" per level...Pixel perfick2014-02-14 17:11:34
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,260

Post » Fri Feb 14, 2014 6:12 pm

I've actually constructed a bunch of levels, minus a lot of the detail I plan to add later. I just didn't notice performance issues because my computer is pretty speedy. Then I looked at the Task Manager and realized that the game was using like 1.5 gigs of RAM. It looks like I'm going to have to basically go through and replace every object in every layout that was a part of my giant "mega-art-object"... manually. Trust me, I am kicking myself right now for not recognizing this sooner! :D

Bear in mind I'm not putting anywhere close to 500 objects in any individual layout, as the game is broken up into compact, Metroid-ish size rooms. The issue I was having was purely due to me storing wayyy too much art in a single object.
(M.A.D. are my initials. I'm not the least bit angry, really!)
@madguy90
B
11
S
4
Posts: 41
Reputation: 1,671


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 9 guests