Separate objects for each piece of background art?

0 favourites
  • 5 posts
From the Asset Store
322 audio files (.wav and mp3) with everything you need for your MMA project.
  • 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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Neither, you cannot efficiently design games like this. Read Remember not to waste your memory

  • I think I might not have explained myself well enough. <img src="smileys/smiley17.gif" border="0" align="middle" />

    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.

  • 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...

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)