Optimization tips regarding sprite sizes?

0 favourites
  • 4 posts
From the Asset Store
Minimal Sprite Font with Stroke for Pixel Art games.
  • Hi, is there any tips or limitations regarding background art? For example, in another game engine, there was a limitation where an "actor" or object who's size was over 2048x2048 pixels caused tremendous lag or errors.

    I have just stretched an tiled, background object to nearly 5,000 pixels(the tiled sprite is 383x287 itself, which, is getting treated like a 512x512 sprite if computations stuff is universal). I noticed when I play my game, some kind of "lag" will strike, and the touchscreen buttons become unresponsive if I hit two. I'm trying to pin down the cause of this "lag" or error, and I'm thinking it could be that object I mentioned, (or it could just be the large size of all the sprites causing slowdowns in computations, if so, I might have to cut down all the sprite sizes in half, but that will take at least an hour even with batch conversion, so I will strike down the quicker to observe possibility first.)

    Thanks in advance for any help.

  • Only the initial size matters, tiled background will just copy paste the object as you stretch it. But if you are using sprite and stretching it that can make some problem's.

    Making the initial size of the object smaller will always improve performance, also making the tiled background size on power of 2( 4,8,16,32,64,128,256 etc) size will make it even more efficient, so if you have some lag ussies try setting the size to 256 then 128 and compare the difference.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi Fradno , in addition to imhotep22 's comment:

    1) Try some experiments: reduce the image size of the object or simply remove the object, run in debug and see what impact that has on the performance. Save these experiments as different names so you don't mess up your original project. Use information on the debug Profile tab to identify which areas of code are hitting the CPU hardest.

    2) Export the project and have a look in the images folder - you can get an idea how the images are being laid out on the spritesheets and it might give you an idea which ones can be reduced in size slightly to optimise memory usage.

    3) Read through these if you haven't already:

    https://www.scirra.com/blog/112/remembe ... our-memory

    https://www.scirra.com/blog/83/optimisa ... -your-time

    https://www.scirra.com/manual/134/performance-tips

    https://www.scirra.com/blog/87/under-th ... onstruct-2

  • imhotep22 mekonbekon Thanks for your resposne, so it's the same standard across all game engines, since I learned some of this from another engine. Shrinking the object, despite it's tiled size, below 2048 did appear to solve some problems, although it could have been another change I made. Turning the touch screen buttons bigger did solve some of the pressing problems I mentioned. Yeah, I didn't know aboiut the debug mode since the last engine I used didn't have it, so thanks for that tip. Thank you for the links as well.

    I noticed during device testing, the HTML5 version will sometimes have some sprites as black boxes, as well as the android version, but a "web2app" version of the game ran fine on android, with no missing frames.

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