1. WaveLightGames's Avatar
    Hi guys,

    I develop my games within Unity 3D and I was wondering if there are any tricks to get games to run on low memory devices? I use pretty heavy 3d graphics and I'd like to know exactly what the bottleneck is. Is it the size of textures for those devices? If so, there are settings within Unity that can be used to shrink textures significantly. Is there anything else? I'd really like to know what causes 3d games to crash on 512 MB devices.
    07-13-2014 10:50 PM
  2. Expression2's Avatar
    See if you could hook debuggers onto your game, and check for native runtime exceptions, since native DX is where things usually go wrong. You can choose to monitor native exceptions with CTRL ALT E in Visual Studio. Make sure you turn off Just My Code as well.
    07-17-2014 02:09 PM
  3. WaveLightGames's Avatar
    What does turning "Just My Code" off do exactly?
    07-17-2014 04:11 PM
  4. Expression2's Avatar
    Just my code means when debugging, the debugger only breaks if exceptions occur in your code, but not in external libraries, unless the exception thrown is lethal. Turning just my code off allows source stepping of external libraries (given that PDBs are available, and must be .Net assemblies). Unity runs on the .Net Framework so PDBs should be provided as part of the IDE/SDK.
    WaveLightGames likes this.
    07-23-2014 07:13 AM
  5. WaveLightGames's Avatar
    For those interested, I managed to get my very graphics intensive game working on 512 MB RAM devices. I did it by setting up large audio files (background music) to stream rather than load into Memory and I also reduced texture sizes for Windows Phone builds and finally I wrote code within Unity to force graphics settings to a lower level (which further compressed textures) if the system memory is less than 600 MB. All of this was done within Unity. If anyone wants more details, let me know.
    David Hegedus and Faraaz96 like this.
    07-23-2014 08:31 AM
  6. Vitor Salvatore Pierce's Avatar
    For those interested, I managed to get my very graphics intensive game working on 512 MB RAM devices. I did it by setting up large audio files (background music) to stream rather than load into Memory and I also reduced texture sizes for Windows Phone builds and finally I wrote code within Unity to force graphics settings to a lower level (which further compressed textures) if the system memory is less than 600 MB. All of this was done within Unity. If anyone wants more details, let me know.
    Amazing if all developers, even big; do the same like you.
    Congrats!
    WaveLightGames likes this.
    07-26-2014 05:01 AM
  7. WaveLightGames's Avatar
    Thanks .... I was thinking lately that there really is no excuse for not having games work on 512 MB devices. Here's some screenshots of some updated graphics I'm doing for my game that runs smoothly on a Lumia 520:

    new-colours-2.pngnew-colours-3.png

    These graphics will be in the next version ... currently, the lighting effects are different but still a full 3D game with gameplay, music, sound effects that runs smoothly on 512MB devices. It took me a while to figure it out (and that's why the initial release didn't support 512MB devices and I received a lot of bad reviews for it) ... but once I did, it works great.

    Think of it this way, I believe the original Xbox 360 only had 512 MB memory ... think of the games that it could run.
    Faraaz96 likes this.
    07-26-2014 07:18 AM
  8. Vitor Salvatore Pierce's Avatar
    Thanks .... I was thinking lately that there really is no excuse for not having games work on 512 MB devices. Here's some screenshots of some updated graphics I'm doing for my game that runs smoothly on a Lumia 520:

    Click image for larger version. 

Name:	New Colours 2.png 
Views:	6 
Size:	300.9 KB 
ID:	73343Click image for larger version. 

Name:	New Colours 3.png 
Views:	4 
Size:	252.6 KB 
ID:	73344

    These graphics will be in the next version ... currently, the lighting effects are different but still a full 3D game with gameplay, music, sound effects that runs smoothly on 512MB devices. It took me a while to figure it out (and that's why the initial release didn't support 512MB devices and I received a lot of bad reviews for it) ... but once I did, it works great.

    Think of it this way, I believe the original Xbox 360 only had 512 MB memory ... think of the games that it could run.

    When you updated, don't forget to tell. Mine is 720, so is 512 :p
    WaveLightGames likes this.
    07-26-2014 07:21 AM
  9. WaveLightGames's Avatar
    Sure ... you can download the game right now. Link

    It should work fine on a 720 since it works on a 520. However, I did notice a recent review from a 720 owner saying the game wouldn't install ... which makes no sense since the installation part is handled by Microsoft. It's not something I could screw up even if I wanted to.

    However, the graphics at the moment have inefficient lighting settings which (1) look garish and way too bright for a dungeon and (2) make the games download bigger than it should be. Next week, I'll post up an update that will have all the lighting upgraded to look way better and should also be a smaller download. You might want to wait but you could also pick it up now and let me know what you think. Here are current graphics ... not bad, but I think the new ones are way better and have a much darker / cooler atmosphere.

    promo-big.png
    07-26-2014 09:03 AM
  10. WaveLightGames's Avatar
    The major issue I have with games like Modern Combat 5 not running on a 512 MB device is that I think it's just laziness on the part of the developer. The major factors that eat up RAM in a game are:

    1 - Audio Files loaded directly into memory
    2 - Textures Files that are used to wrap around 3D objects

    Most other stuff is tiny. Now any decent game engine (such as Unity 3D) allows you to stream the audio from disk rather than load to memory (which takes care of item 1) and compress the size of texture files (which takes care of item 2). Now, on a small phone screen ... having large textures is completely pointless. I found I could compress my textures by 4 to 8 times and still have no noticeable difference in game graphics. Compressing textures makes the 3D objects look blurry (at very high compression) but on such a small screen, it's barely noticeable. There is absolutely no reason any current Windows Phone game couldn't run on a 512MB device. It might not look as good as on a 2GB device but it should still be able to run smoothly and for the most part, the differences in graphics shouldn't be that noticeable ... if at all.
    MikeFrancis likes this.
    07-26-2014 09:08 AM
  11. MikeFrancis's Avatar
    Very cool - can you give details on what you did to force graphics settings to a lower level? Which Unity APIs do this?
    09-16-2014 07:24 PM
  12. WaveLightGames's Avatar
    Sure, no problem.

    Since this post, I've done some more work on optimizing and come up with a few other things. So in total, my optimization strategy is the following:

    1 - Set all large music files (background music usually) to "Stream from Disc" and "Compressed" and uncheck the "3D Sound option". This is all just done in the Unity 3d Inspector screen when you select the music file.

    2 - Select all meshes / skinned mesh renderers of objects used in your game and set the shader in the related material to Mobile / Diffused. I don't bother with normal maps and specular maps for a mobile game. Setting to a mobile ready diffuse shader cuts down the number of textures for that shader to just one. This is again done in the inspector screen in Unity when you select the material.

    3 - For all textures being used in your game, make sure they are compressed as much as possible. Set the compression to "Compressed" or DXT5 if you're using Advanced settings. Now click the "Override for WP8" button in the inspector and select a low max texture size. Something like 32x32 for a small texture and 128x128 for a larger one. You can have the object using the texture on your scene view and then as you adjust the texture size, you'll see how it looks so you can experiment until you finding something acceptable. This is all done in the inspector screen again.

    4 - If you are using Light Mapping (and I highly recommend it over dynamic shadows for performance reasons), you should also select the light map textures and reduce them to something small in the same way as you do for other textures.

    5 - Animations can eat up a lot of memory if you are using the Legacy animation mode as I am. Therefore, for each object with animations, go into the animation compression setting in the inspector and make sure that animation compression is being sued. The default values of 0.5 / 0.5 / 0.5 can also be increased to something like 5 / 5 / 5 to reduce size of animation data and still get good results on mobile.

    Now the above will apply to all Windows Phones so I would choose settings that look decent and not go too aggressive. Now you can use Unity's built in Quality Settings option to further compress textures and such. There is a built in one that further reduces textures by half. I would suggest, writing code that looks at the phone's memory and automatically changes the quality setting to that lower option if the memory is less than 512MB.

    Is used the following script at my initial scene of my game. This is just attached to a game object in an empty scene.

    **********

    using UnityEngine;
    using System.Collections;

    public class QualityManager : MonoBehaviour {

    // Use this for initialization
    void Start () {

    if (SystemInfo.systemMemorySize < 600)
    {
    QualitySettings.SetQualityLevel(0);
    }

    }


    }

    ************

    That all being said, I am running into difficulty getting my current game to run on a 512MB device. It's because it's a very ambitious 3D tactical RPG and gives the player a choice of 18 characters to choose from and can have lots of different enemies on the screen at one time ... all rendered in 3D graphics. So I suppose there are limits of what you can do but I really think this should be a very rare case.
    09-17-2014 09:24 AM

Similar Threads

  1. Recommended -Car Dashboard Mount for 930
    By scgf in forum Nokia Lumia 930
    Replies: 30
    Last Post: 03-27-2015, 10:33 AM
  2. No images for some Bing live tiles
    By Votshtoy in forum Ask a Question
    Replies: 2
    Last Post: 08-18-2014, 03:22 PM
  3. Replies: 5
    Last Post: 07-15-2014, 01:42 PM
  4. SD card upgrade for 1520
    By rickc1961 in forum Ask a Question
    Replies: 1
    Last Post: 07-13-2014, 08:55 PM
  5. Cortana's got it right again for the FIFA final!!
    By Wameed Iqbal in forum Ask a Question
    Replies: 1
    Last Post: 07-13-2014, 05:36 PM
LINK TO POST COPIED TO CLIPBOARD