- Home /
Low performance on multiple runtime generated sprites
I'm basically making a terraria clone with chunks of 32 x 32 (may vary since random generation provides mountains / cave / such) To do this, i'm instantiating sprites as Gameobjects, everyone represent a single block of the world generated chunk.
Doing this I'm ending up wasting a fair amount of resources very quickly (even though blocks prefab doesn't keep any script over them, they're just plain gameobject with just the sprite as for now)
Is this normal ? Is there any advantage on instantiating them as transform and not gameobjects ? What other ways would you take to optimize a project of this kind ?
PS: generating chunk code is very small and compact, that's not the cause of the lag as for now
This is a very confusing question. What exactly is the problem? Are you using too much memory? processing time? What exactly is using the resources?
From my experience textures are the usual problem. They take up the most memory and cost the most time to decompress. Have you tried using spritepacker?
Answer by stevethorne · Sep 26, 2014 at 01:24 PM
The problem is probably the number of draw calls. You should look into dynamic batching