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 - Vell

Pages: [1]
1
Support / Re: Atlas settings for 2x platform won't work
« on: April 25, 2013, 12:45:37 pm »
There is the final option to do something like what the platform sprite collection stuff does, basically enabling that code path all the time, but I wouldnt' recommend that if you ran into problems with the resources folder in the first place.

Could you better explain it? What you mean by "enabling that code path all the time"?

2
Support / Re: Atlas settings for 2x platform won't work
« on: April 25, 2013, 11:00:44 am »
Is there any possibilities to no load immediately all textures?

btw, right now I'm adding sprites to scene as you said. right know I see no crashes, but I'll continue. Right now i have 17 atlases on scene from different collections and scene startup pretty high (2393ms) on Mac. I'm also noticed that some atlases loaded at 600 ms, and other at 0. Can explain this please? For this http://rghost.ru/45539210/image.png atlas Texture.AwakeFromLoad took 750ms and for this http://rghost.ru/45539254/image.png 0ms.

3
Support / Re: Atlas settings for 2x platform won't work
« on: April 25, 2013, 09:07:08 am »
1. 3-5 atlases for enemies (depends on level loaded). Each unit has it's own atlas which dimension 1024x1024 and with RGBA 4bit PVRTC compression atlas size is 0.5mb. Some level contain bosses which atlases dimension is 2048x2048 and size is 2mb. One more atlas for level background image, 1024x1024 and 0.5mb of size, + may by 2-3 atlases for effects with 1024x1024 dimension. And here goes little story about towers atlases:
Before recent changes, we had game object which stores all towers prefabs (for all grades and type, 6 types x 5 grade = 30 prefabs), but since we faced texture loading problem (where Texture.AwakeFromLoad gets called on each atlas, even if atlas just stored in prefab and can't be visible), we changed this to following:
In our game, before you can build tower with higher grade, you must unlock it in upgrade menu, out of game scene. So we decided to not store all of possible towers prefab, because at first levels user simply can't build them. So on game scene Awake(), we get all possible prefabs(I mean path to them is resource folder) and then load all avaible to user prefabs via Resource.Load(). About towers atlases sizes: 1 and 2 grade can fit 1024x1024 and size 0.5mb, 3,4,5 grades fits only in 2048x2048 atlas with 2 mb size.
2. I've tried to run scene with minimal content (6 atases for towers, 1 for units, 1 back) and no result. Awake of game object from game scene gets called, but screen is freezed in prev. scene (unity connected profiler also gets freezed). Also, xCode print "System memory in use before: 5.2mb" after all my Debug.Log() in Awake(). May be it's not connected to my problem, but i haven't any ideas where to find problem or even start finding.

Most weird thing for me right now is why when we had 2 platforms our game worked perfect (if exclude problems when we can't build project with all content included, but on Mac game scene loading time was pretty low), but right now, with only 1 platform, but with all content included, game scene loading time jumped to 5k-8k ms (on Mac). I have little assumption about my problem. It's looks like right now all my used textures in scene loads at start up, but before they are get loaded when first time visible. Also, as you can see on my screenshot, atlas AwakeFromLoad() execution time is 600ms which is pretty high, I guess I would notice that if it has ever happened before.

Thank you for help.

4
Support / Re: Atlas settings for 2x platform won't work
« on: April 24, 2013, 04:28:21 pm »
BTW my project won't work on device. It's work on Mac with target platform iOS, but on device, when main game scene loaded, it's just get freezed (not switching to scene at all). update and start function on game scene don't get called, but Awake does,  I guess it's also connected with my situation.

5
Support / Re: Atlas settings for 2x platform won't work
« on: April 24, 2013, 03:54:52 pm »
Thank you for replies!
But for i've faced another problem. Our source animation sequences for both platforms contains 15k files. I'll explain better:
1. Towers and units in game can rotate, we splitted rotation in 32 angles(32 AnimationClips), units only have one state for each angle - walk, so when units walk we just play animation for specified angle and switch it to another AnimationClip when unit rotates. Towers have two states - idle and attack, idle have 1 frame of animation, and attack (mostly) have 2 frames, and, of course, towers have 32 possible angles too. We have 6 different types of towers in game, and 5 grades for each type. So, as you can see, we have a lots of content (folder with all sequences, backs for levels and others, takes 814mb on HD). When we start creating SpriteCollections it's was pretty hard to use Asset Server and Unity starts beign very laggy, so we decided to remove all source texture(animation sequences, etc.) after creating SpriteCollection. It's all was created for 1x and 2x platform.
2. When all work about content creation was done. We tried to compile project to see it on iPad 3. We faced problem where Unity just crashes when trying to build project. My first thoughts was about tk2d atlases, as I wrote in first post, some of atlases for 2x platform was greater then 2048x2048. BTW I've submitted bug to Unity and recieved following answer:
"You have a lot of resources folders in your project.
We will look into making unity not run out of memory in that case, but it seems like you are not taking advantage of those folders, so please rename them to a different folder name."
In my project I have two resource folders - my levels prefab and tk2d resource folder. We decided temporarily remove 2x support from project. Because we don't had any source images of our content, we decided rebuild all content of project, without adding 2x platform in "Platforms" settings.
3. When we finished rebuilding I've mentioned one weired moment in tk2d resource folder. All assets in this folder disappeared, but as i remember, they was needed only for multiplatform support, so i've desired that's ok if you have only 1x playform ticked.
It's was preface to my problem. Hope you could understand my ridiculous english.
So, right know, we have huge spike on game scene start. It's looks like most of time goes on Texture.AwakeOnLoad execution. As I understand, Texture.AwakeOnLoad is a process where texture data passes to driver (I also asked this on unity 3d forums http://forum.unity3d.com/threads/179587-When-texture-get-loaded-to-GPU-and-what-is-Texture-AwakeFromLoad). I don't recieve answer yet when Texture.AwakeOnLoad really called, but I could say when it called in my project. When we had two platforms, Texture.AwakeOnLoad get called on object instantiating in tk2dSprite.Awake(), but when we rebuilded content, as i mentioned earlier, it's looks like Texture.AwakeOnLoad gets called on scene start for all used texture in scene. Also, execution time of Texture.AwakeFromLoad increased greatly. And, as you can see on screenshot, time of execution very different for atlases with same compression and size (RGBA PVRTC compressed 4bit). I absolutely, totally, misunderstanding what happend to project. I hope you could explain why tk2d Resources fodler is empty, why Texture.AwakeFromLoad execution so slow, and why all my tk2d atlases loaded at scene start and not on instantiating as before.

p.s. I greatly apologize for my english, and if you can't understand some of my phrases please tell me, I'll try to explain better. Thank you!

6
Support / Re: Atlas settings for 2x platform won't work
« on: April 18, 2013, 03:05:56 pm »
The build code scales the max texture sizes for each platform, so if max size is 2048 at 1x, it will be 4096 at 2x.
Do you have plans do change this? It could save lots of space and also reduce draw calls. BTW thank you for explanation.

7
Support / Atlas settings for 2x platform won't work
« on: April 18, 2013, 12:45:50 pm »
In our game for iOS we have long sequences of animation. Some of them created for 2x platform. Since iOS platform only allow textures below 2048x2048, on creating animation atlases I set "Max Size" for atlases 2048 and also set checkbox "Force Square". It's works great for 1x platform, but looks like 2x atlases igone those settings. I've tried "Force Atlas Size" but this produce no result. I'm also tried to set "Multiple Atlases", but looks like it's only affects 1x atlases. Is I'm doing anything wrong or it's probably bug?

Pages: [1]