1
\$\begingroup\$

I'm new to Unity, and have been confused about this issue for a while. Some people say that for 2D games you don't need to worry about performance (I'm making the game for PC, not mobile) while others report bad performance with larger sized sprites

I have a long scene with some large background sprites, measuring about 14552x3308 (weird resolution I know, would that also cause issues?) All methods of scaling it down and resizing in Unity lead to jagged edges (these are basically hills so I need them to be significantly bigger than the player character) I always keep the image size in the inspector similar to the resolution of the actual file, and set the filter mode to Point, so the jagged edges are not due to that, but only because of me scaling up a smaller file size to fit the scene.

If I use the original sprites of 14552x3308, it's perfectly smooth (image size set to 8192 in inspector) but each file takes about 120mb in the profiler. All combined, my assets are showing a usage of 1.25 GB for this scene. How bad is this? Should I be trying to keep it under 1GB?

I don't really know what the best practices are in this situation, so I don't know what to aim for. I'd ideally like to keep the sprites at this large size so that I don't have to redraw anything.

\$\endgroup\$
  • \$\begingroup\$ 1–1.25 GB is a lot of memory, as most people have 4 GB on a standard PC. Is this just your terrain or is this the entire game? \$\endgroup\$ – ND523 Aug 28 '17 at 18:34
  • \$\begingroup\$ That's the combined total of all my terrain for that particular scene. I've attached a screenshot of the profiler. The orange terrain in the background is what I'm talking about. \$\endgroup\$ – Armaan Sandhu Aug 28 '17 at 18:38
  • \$\begingroup\$ @ND523 here's the screenshot: imgur.com/VagVscW \$\endgroup\$ – Armaan Sandhu Aug 28 '17 at 18:43
  • \$\begingroup\$ I would advise to split the background into smaller pieces and enable/disable appropriate sprites if it's possible for you. \$\endgroup\$ – Hellium Aug 28 '17 at 20:41
  • \$\begingroup\$ Somehow cropping the files closely to remove extra space has brought down the memory impact from 120 mb to 3 mb, which is insane considering that it was only the blank space causing all that memory usage. I have only done this for one sprite yet, and have seen no loss in quality. @Hellium I also tried splitting it into 4 parts, and it actually looks even better than my original huge files. But this takes a total of 12mb memory compared to the 3mb of the non-split file. The right solution is somewhere there between these new options. I'll be back here to report when I figure that out. \$\endgroup\$ – Armaan Sandhu Aug 29 '17 at 7:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.