Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Lightja

Pages: [1]
1
Support / Re: Atlas optimization question
« on: December 07, 2013, 04:36:19 pm »
so for the images that go inside the atlas, I should ignore trying to get them into powers of 2 and just try to fit as many textures into the atlas as I can so that there's as little waste as possible?

2
Support / Atlas optimization question
« on: December 07, 2013, 11:34:38 am »
So... I know textures are best loaded in/out of memory in dimensions that are powers of 2. Given that ALL atlases are powers of 2, do all of the textures inside the atlas need to be powers of 2? Or can they be whatever size they want, since the atlas is already a power of 2?

so I have 2 options
1. Create all my atlases (which are powers of 2, like 1024x1024 usually) and put all of my textures inside these atlases as powers of 2 themselves (sprites 32x64, 64x64, 128x64, etc. depending on the sprite) This leaves a significant amount of unused space in the atlas.

2. Create all my atlases (which are powers of 2, like 1024x1024 usually) and pack my textures as tightly together as possible so that I don't have any waste (or very little) in the space of the atlas. If we did this, our artists could actually build atlases with the intention of fitting as many on one atlas at a time, because loading too many atlases at once is currently one of our major issues (we'll be looking into asset streaming, but that's a separate issue)

**one of my very common problems is that we have a 65x128 sprite, but because we want it to be powers of 2, we use it as a 128x128 sprite, and it's almost twice as big as it needs to be, creating about 49% waste for that sprite, increasing the wasted space for the atlas. In the worst of the worst situations, an atlas that forces power of 2 textures could have half the sprites that an atlas with NPOT (non-power of two) textures, meaning I would have half the memory load.

So do the advantages of having textures as a power of two outweigh the wastes space of the atlas? Or is that the whole point of the atlases being forced into powers of 2 in the first place, meaning sprites can be whatever size necessary?

sorry if this seems like a simple/obvious question, but I haven't been able to find anything about it. The technical director on my project enforces POT textures very strictly, but due to the way atlases are set up, I'm wondering if I should challenge that for the sake of efficiency.

3
Hi, I'm making a 2d platformer game in Unity that we are porting to Android and apple devices.

the game's prototype was built by one designer, and now the project has been picked up by a 25+ person team. We changed all of the code to c# from JS and made everything time-dependent and just generally fixed up the project.

One major issue that remains is the RAM usage. When I deploy the game to my phone, in our basic scene, which includes 3 floor objects, a camera prefab that includes all of our GUI, and our player and his sprite which is animated with movement, etc. This scene is taking 244mb of RAM on my LG Optimus f3. This is too much for a phone game, correct?

When trying to isolate the RAM issue I tried deleting pieces of the scene and rebuilding it. I can post my trials, but they don't seem to make much sense to me. Generally speaking, when I delete the camera, 150mb of RAM is freed up, so it goes down to about 100mb of RAM being used, and when I delete the character, I free up about 50mb, leaving ~40mb in the completely empty scene.

I attached a txt file that entails the results of me deleting objects piece by piece. All of the objects that were deleted that resulted in a big drop (touchCircle, lifeOutline, and coleSprite) used either tk2dSprite Script or tk2dAnimatedSprite Script.

touchCircle and lifeOutline both use the same Atlas, and it is a 4096x4096 atlas. We plan on reducing it to multiple 2048 atlases for the sake of the maximum atlas size on apple devices, but that is just a matter of time. Could the size of the atlas be a memory issue?

the touchCircle, lifeOutline, and coleSprite when deleted in my trial that went piece by piece caused the biggest drops in RAM, but when I deleted those 3 only from the basicScene, there was only a drop of only about 50mb, which I suspect was just from deleting coleSprite, which is our character.

Any advice on where to continue from here in trying to reduce the memory consumption of our game before it continues to get worse? Our first real scene takes about 300mb to run, and it just keeps increasing.

Thanks,

-Justin

Pages: [1]