Hi there,
I have a issue in that my game crashes due to memory on the iPod, however, the same level runs on the iPad. So, I am wondering what techniques you would employ to eliviate the problem. I am thinking I will first detect the device type and load a level specific to that device. Then simply have smaller atlas? In theory, each atlas I have for the iPad build, can I half it for the iPod?
You will definitely want to become familiar with the Resources API, such as Resources.Load(). Welcome to mobile hell!
I don’t understand Resources.Load(). It loads an asset. An asset being?
audio clip, model, texture, text
As for the RAM: Ipod touch 3 has 256MB RAM, iPad1 has 256MB RAM, iTouch 4 has 256MB RAM, iPad2 has 512MB RAM, iPad3 has 1024MB RAM
The 256MB ones have 100-120MB of RAM + VRAM available, the 512MB devices normally around 300mb and the iPad3 does not need a comparision atm
Thank you,
So I just pasted in the example GUI code for monitoring what resources are in scene.
function OnGUI () {
GUILayout.Label("All " + Resources.FindObjectsOfTypeAll(typeof(UnityEngine.Object)).Length);
GUILayout.Label("Textures " + Resources.FindObjectsOfTypeAll(typeof(Texture)).Length);
GUILayout.Label("AudioClips " + Resources.FindObjectsOfTypeAll(typeof(AudioClip)).Length);
GUILayout.Label("Meshes " + Resources.FindObjectsOfTypeAll(typeof(Mesh)).Length);
GUILayout.Label("Materials " + Resources.FindObjectsOfTypeAll(typeof(Material)).Length);
GUILayout.Label("GameObjects " + Resources.FindObjectsOfTypeAll(typeof(GameObject)).Length);
GUILayout.Label("Components " + Resources.FindObjectsOfTypeAll(typeof(Component)).Length);
}
Now my numbers looked like this…
I am just wondering now, A. is this obscene anywhere? B. With Resources, I am under the impression I should create a Resources folder, place all I assets I use, into it then use that as a starting point to load and unload the correct assets?
Is the above data for everything that is in the project, even if it is not being used?
Sorry to heckle the boards,
But I want to optimize my game. I have pooled all instaniated and destroyed objects, now stored, I have compressed and set back a lot of art texture settings, I have disabled many elements that are not needed full time, activating them when needed. But still would like to do more. With that, do you have any suggestions for something I could do to enhance general performance.
What that is showing really is a very small and inaccurate window into the truth (though it has bearing if you compare it to other games you make, to give you a ballpark). But in my opinion, that printout is not useful in the end. For example, let’s say you have 10 enemies that all look the same and thus are using the same material with the same textures. You don’t really have 10 materials with 10 textures in memory, you only have 1 (unless they are instanced, in which case you just really don’t know by looking at that data without any context).
But if we pretend for a moment that the information in your printout truly represents assets that all are completely unique, the the only alarming number might be the Tetures count, but then it depends on how big they are. If they all are 128x128 and are ARGB32 uncompressed then 1000 of those would be 1000 * 128 * 128 * 4 = 64MB. But only you know the makeup of your data, so you could do better estimates.
Follow that by the number of meshes, but then again, depends on how many verices, triangles, UVs (1 and 2 channel), normals, and tangents they have, all of which would consume memory if they were all unique.
Hi there,
So I have pretty much completed the transition to iPod. However, I am wondering, a lot of the art is pixelated, to the tiniest degree, it can totally pass tho on the iPod. This may not be the case on the iPhone with Retina. Is there a rule of thumb for what devices are grouped together? At the moment, I am thinking any iPhone of the 4th gen, and any iPad can use the same levels in the universal build. While any iPod and iPhone less than 4th Gen can be grouped together. Is this accurate?
Edit. My iPod 4th Gen does have retina. Hmmm. What are your thoughts on resolutions of devices and building for them? IPod and iPhone are harmonious while iPad is its own?
Hi I am wondering, what would be the correct way to load a Splash? Meaning, I am going to send the user to specific levels dependant on their device generation and type. But what about the initial, splash screen. How would you load the correct material?
Check what they are on and load the relevant image etc from Resources to visualize it