Announcement

Collapse
No announcement yet.

Some info and making some progress on Android (with a Galaxy S1 :)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Some info and making some progress on Android (with a Galaxy S1 :)

    Intro:
    Hi, I'm going to try to document my progress in getting UE4 (Unreal Engine/Editor 4) setup and running on my Android phone. It maybe helpful for others trying to do the same and it'll hopefully help me as well … I will also document any gotchas I find along the way.

    There doesn't appear to be much detailed UE4 Android documentation so far (that I can find?), but there are some (with links below) but I have also found this UE3 documentation some help (while we wait for more UE4 docs
    http://udn.epicgames.com/Three/MobileHome.html

    A lot has changed since UE3, so it would be great if/when these UE3 docs or something like them above can be updated to UE4 versions.

    There's also this link, which has some useful info:
    https://docs.unrealengine.com/latest...ile/index.html


    What I'm trying to do:
    I'm trying to get UE4 setup and running on my Android Samsung Galaxy S1 with updated firmware to 2.3.6.

    I'm hoping to get my game to support the Galaxy S1, as there were millions of these phones sold and they were good (90M pixels/sec) for their time, so they are still a better GPU spec than a lot of Android phones sold today.

    Also fortunately Samsung's Kies software allows the firmware to be upgraded to 2.3.6 ... so that's API 10 ... and Unreal Engine 4, out of the box, is setup to support API 9 ... (more on this setting in a minute).

    Disclaimer: I don't have all the answers yet, but I have found and got past a few gotchas along the way so far, that may help you and they do need documenting.


    (1) Setting up the development environment:
    Here's a very good starting point, but its got a few problems...
    https://docs.unrealengine.com/latest...ted/index.html

    I strongly recommend installing NVidia "TADP (Tegra Android Development Pack)".
    I already had Android development (SDK + NDK) setup on my machine, but it was old, so I choose to do a clean install. NVidia TADP is the way to do it.
    (I tried without TADP, but Unreal wasn't detecting it). By the way, the TADP installer is installed along with the Unreal Engine 4 ... its found here:
    C:\UnrealEngine4\4.0\Engine\Extras\Android\tadp-2.0r8-windows.exe

    However TADP does have a few problems of its own.
    (A) On my first attempt, I chose the COMPLETE option. Bit of a mistake this, because after 3 hours of it downloading and installing, it froze and died.
    (B) I then tried to fix it via that C:\NVPACK\android-sdk-windows\SDK Manager.exe and following the GettingStarted page link above, but that also failed.
    (C) I then restarted NVidia TADP and this time I selected the EXPRESS install option. After some time it installed ok.
    However, during the install, please note it comes up with errors about failing to write (in my case to 2 files), but selecting Ignore gets past them. (Looks like its just a conflict copying the same file twice, so once is enough.

    Ok that got to the point where my S1 phone was detected by Unreal. ... (more on this in a minute).

    Also, one other useful point about setup, at the end of NVidia TADP installing, it asks if you want to keep the downloaded files. I would suggest yes, as it puts a load of useful ZIP files for future reference here:
    C:\NVPACK\tadp_download


    (2) Creating a quick test project.
    I just wanted a very simple level to test, so I just created a New Project, using the "Blueprint Third Person" option with include stater content tick box enabled.
    That just gives a simple character running around a box room with a few slopes and boxes to climb on, all in 3rd person. (I decided to keep it simple at first, so I held off from going for the C++ version to start with... that's in my plans very soon, once it works with a Blueprint only project). I just called it Simpletest and its found here:
    C:\UnrealEngine4\_Dev\Simpletest

    "_Dev" is my main development directory (the "_" makes it ASCII search to the top of its parent folder, in a file explorer, so I can find it fast
    You can setup your main folder name, by going to the New Project page of the Unreal Project Browser. At the point you are entering a project name, there is an icon to the far right hand side of the Name text extry box. Select that and it drops down a directory tree and it also has a [Choose Folder] button.


    (3) The AndroidManifest.xml and telling Unreal Editor you want to develop an Android game.
    Once a new Unreal Editor project is created, it doesn't by default have an AndroidManifest.xml file created. That's because its not yet setup for Android. So once you are in the editor, select the top menu bar "Edit" menu and at the bottom of the Edit menu select "Project Settings".

    On the left hand side of the Project Settings page, you should see Platforms, and Android should be visible below it. ... (If not, goto (1) above and try again :\

    Select the Android option in the Platforms section of the Project Settings page.

    The first thing you need to do is configure the project for Android, which is easy to do.
    Its highlighted in dark red, saying "Project is not configured for the Android Platform" followed by a [Configure Now] button. Press that button. It then changes to green text and says "Platform files are writeable"

    That button has now created the following directory tree:
    C:\UnrealEngine4\_Dev\Simpletest\Build\Android (well it creates the Build\Android part of it).

    But most importantly, it also created the AndroidManifest.xml file for you. You get to this file fast by pressing the [Open Manifest Folder] button in the UE4 editor.

    Open the AndroidManifest.xml in a text editor and its by default set to
    android:minSdkVersion="9"
    (I tried 8, but UE3 didn't like that and came back with error 3) ... more on this in a minute. Anyway 9 didn't give an error when building. ... Anyway, that saves you some time, not having to try 8 now.


    (4) Building/Cooking and downloading to the target machine (e.g. your phone).
    When you select a project to launch on a target machine, UE4 first has to build/cook it, before launching it. The first time you cook a project, it can take a very long time, so be prepared for a very long wait. For example, on my setup (a lowly Samsung RV515 with Dual Core AMD E450) it took an extremely long time. (2 hours 45 minutes to be exact!

    But anyway, be prepared for a bit of a wait as it'll most likely take a while on a lot of machines (especially effectively out of work indie developers like me with no money to buy new machines until I create something to sell! ... Oh the joys of going indie, rather than the cushy life of AAA development with expensive dev machines.

    One request here: It would really help all of us save a lot of time if there was a way to downgrade what is being cooked into something quicker to make, a kind of preview build version, which doesn't have things like baked lighting etc.. Not sure if that's something we can do with settings, or maybe a different version of the project? or maybe some kind of downgrade button that’s something for Epic to add to the editor? … (A preview build of some kind seems likely it'll be a more detailed control over the Quick Settings/Engine Scalability Settings?, but one that makes sure it also effects the speed of cooking?).

    Anyway, you enter the cooking process using the "Launch menu" where you select which target machine "Device" as UE4 calls it. That's the target you want to download to, at the moment you select it from the menu.

    At this point, I should just say, that the GettingStarted page above mentions using this "Launch menu" but it didn't explain what it is ... Well, for us newbies to the Unreal Editor ... that is found on the far right of the big icon bar, above the centre main 3D editor window and if you have a small monitor (which I do) that is hidden under a ">>" symbol.

    Hovering over the Launch Options submenu of the Launch menu gives you a list of different Android (and Windows) launch Devices (target machines). At least it should ... make sure your phone is in development USB debugging mode, and once you reconnect the USB lead to your phone, the windows (7 in my case) USB driver takes about 30 seconds to detect the phone. Once that has finished, it should be visible on the Launch Options in UE4.

    Also worth noting, is that there's a useful looking Device Manager at the bottom of the Launch menu (its worth looking at this).

    Another thing to note is that the Launch Options has more than one Android device. The different versions are different texture compression options. I'm not sure how this helps us all during the sale of our Games/Apps?. I assume a lot of people now using UE4 are indies and few indies can target specific devices (that's the big AAA's job with their high profile PR moves . We indies by comparison usually need to target all the markets the AAA's are not in!, which also happen to be the far bigger/wider, but not so high end markets. Anyway I've just found this page which helps a lot in understanding what all these Android versions are:
    https://docs.unrealengine.com/latest...ing/index.html


    (5) Where I'm up to now:
    Ok I can cook an App (and see it on my phone! ... yay!) using my "Blueprint Third Person" project option (which has no other changes to the project, other than simply enabling Android development. I altered nothing else, not even name text, so its more repeatable). (Ahh just remembered, I also set Quick Settings/Engine Scalability Settings to Low and I've just set material Quality to low, I've just spotted menu option, so my current cooked version doesn't have material quality low).

    The problem I'm up to now is that while I've built it and it runs (without crashing), it currently does nothing. It starts up and it exits and it shows a blank black screen currently.

    I'm now going to dig through its log messages and I'll let you know what I find.

    (That's about 30 hours of work in the past 2 days so far, what with installing, trying options and digging for info etc... Anyway hopefully it'll be of help?). It should help save you all some time?

    If you have any ideas, suggestions or more info on how to proceed? (or just want to wish me luck!), then please let me know.

    Alan

    #2
    Thanks for sharing your work!

    You could consider this: https://docs.unrealengine.com/latest...ing/index.html -> Android Texture Formats
    So you should cook with "Android" or "Android (ETC1). Hopefully than it will work.
    You could also find out what GPU your android-device has built-in and compare it with https://docs.unrealengine.com/latest...ity/index.html

    Good luck!

    Comment


      #3
      Thanks for your info. Your link to "Andrid Device Compatibility" really seems to be a good help, because its given me another angle to explore.

      I will keep documenting what I find for anyone else going through this process.

      That page you linked to talks about "reference feature tiers", so at first I was wondering if there was a slider option for feature tier? i.e. these tiers:
      LDR
      Basic Lighting
      Full HDR
      Full HDR w/ Sun
      ... but the more I look for them, the more I think they are fragmented up across a number of different editor areas and settings options?.

      I've found so far two main areas of the editor which effect what I think are tier like options?

      In UE4, the more obvious (in hindsight) page I found on the Project Settings Rendering page, i.e. (EditMenu/ProjectSettings/Engine/Rendering).
      For my new cooked version, I'm going to try these settings:
      Mobile HDR (Off)
      Occlusion Culling (Off)
      Texture streaming (Off)
      Allow Static Lighting (Off)
      Tessellation can't be turned off (but I assume theres no attempt to do software only Tessellation on the GLES version).
      Separate Translucency (off)

      I also found a useful Editor option on this rendering page to change Editor MSAA. Turning it off helped on my lowly laptop. … (In my editor, I now have up to 8 FPS!)

      The 2nd less obvious area I found on a submenu to the big Build icon button above the main 3D window. There's a lighting quality setting submenu, and that's set to Preview. Hopefully with that on Preview and Static Lighting off, UE4 won't attempt to bake any lighting and so help to speed up
      the cooking process?. I'm going to cook a clean version of the project, to force a full rebuild, to see how long it takes?

      I think I'm going to give ETC1 a try like you say. I was put off from trying cooking just for ETC1 before by the long cooking time, until I was certain what to do for the next version, but it makes sense to use some compression if possible. (By the way, for anyone interested, I found ETC1 support was added to Android version 2.2 (Froyo). Also the Galaxy S1 uses a PowerVR SGX 540 and I see from the Android logs coming out of the Unreal App that I've created, Unreal does detect it correctly, which is some good news.

      I'm now cooking another version with these settings above. (While it cooks again, it'll giving me time to write up where I'm up to!)

      I'll let you all know how it goes?...

      Comment


        #4
        I think you are right regarding the settings options for the feature tiers (LDR, Basic Lighting, ...).
        This cloud be improved. Maybe it's possible to set a tier-setting after creating the project. The UE4-Editor could than use this information and disable settings which aren't supported. That would be helpful and would increase usability.
        But that would be also a disadvantage, because if you want to build the same project with basic lighting you need to create a new one...

        Comment


          #5
          It would be very helpful if there was some kind of master mobile UE4 setting, to set some kind of capabilities limit. That way it would build a version that was suitable for the devices the developer wanted to target. As it is, its very hit of miss, as there could well be settings we could all missing in other parts of the editor.

          Anyway the status so far is that unfortunately for my version 2 build, UE4 finally failed to create a launchable app. After about the first 3 hours, UE4 stopped writing to the hard disk and mostly stopped writing to the log file as well. After that the only changes to the log file were autosaves. I think UE4 doesn't like these settings?. Maybe its a bug in UE4?, I don't know.

          This is the last line of the log file, i.e.
          [2014.04.10-16.05.42:643][151]LogTemp: StatMessage Packet has more than 200,000 me

          On screen it said more, but in the log file, I think it failed to flush the end of the data, as it is cut off, but there was more on screen. On screen I think it said 200,000 messages, plus there was some auto saves after that. This 200,000 messages warning appeared twice, which doesn't sound good.

          But still even after the first 3 hours, I left it to run for another 4 hours just cooking!, so 7 hours total just trying to launch a simple app on a phone! So something isn't right here, that's obvious, but the question is what to do about it now?

          Even then I only gave up after 7 hours because that is when my computer finally ran out of memory and it went into continuous swapfile usage. It appears it was slowly increasing its amount of memory the whole time. I've got 4GB and it cooked an app the first time, so I don't know what difference brought down UE4? Its really only a very small demo, so what is UE4 trying to do that is making it so hard for it to create a simple App?

          I really could do with advice from Epic about how best to optimise and improve the cooking process.

          Anyway for try 3, I'm going to leave it cooking overnight to see if it works and I won't use ETC1 this time, as it did build without it, but it could be one of the other settings that brought it down?. Its hard to tell, the changes I made to the settings should have made it easier to build!.

          I'll let you all know how version 3 goes!...
          Last edited by Alan3DAGames; 04-10-2014, 06:39 PM.

          Comment


            #6
            Hello,sorry for resurrecting a 5 days thread,
            I firstly tried Reflections Subway on my Nexus 5.Cooking process took ~30 minutes.Considering your post,your pc have to have really low hardware considering it took hours and hours to cook content? My spec is Lenovo y580 with GTX 660M and i7 3630QM 8gb ram which is very very old and I bought this laptop like 2,5 years ago.I think 3 hours is a lot for cooking basic template project there must be others thing wrong maybe ?

            Comment


              #7
              Well it took ages to cook anything for Android on my machine too, until I limited the build to just include the texture compression that my device supported. Now I need to discover why flappy chicken works, but most eveything else just gives me a blank screen...

              Comment


                #8
                Originally posted by JuanManuel View Post
                Well it took ages to cook anything for Android on my machine too, until I limited the build to just include the texture compression that my device supported. Now I need to discover why flappy chicken works, but most eveything else just gives me a blank screen...
                Should be about lighting.What's your mobile device ?

                Comment


                  #9
                  An original galaxy tab 10.1 and a Sony Experia N

                  Comment


                    #10
                    Thanks for your posts. (Sorry for the delay).

                    @JuanManuel:
                    That's very encouraging about improving build speed by changing the compression. I couldn't get that to work on my setup currently, but its interesting it speeds the building process up noticeably. (Not sure why it would be so noticeable though?).


                    @arkenthera:
                    Yeah I do have a low end machine, but still, even on your machine, ~30 minutes is a very, very long time to wait to test on an actual device.

                    As fast build times are very important throughout development and fast builds becomes critically important in the final stags of development, where we have to do a lot of fine tuning and polishing, then we really do need a way to make test builds on actual devices much faster than they are currently.

                    There has to be a way?. I can't believe it should take so very long to build a very simple App for a phone. I can for example, live without baked lighting for most of testing etc.., but surely its possible to build a lot faster?

                    For example, if I edit (on my laptop) a large C++ file on my current nearly finished Android game, I can re-compile and download to the phone (and the phone also wastes a bit of time virus checking the resulting 1.5Mb App, all before it finally starts the App) ... all within 32 seconds!. (Even a full rebuild is just a few minutes). Now I'm not expecting Unreal to allow that kind of speed of building, so we can see and test our changes, and I know I have a very slow laptop, but it really should be less than about 10 minutes, just to build a very simple demo?!

                    So there has to be some kind of settings I'm missing somewhere?

                    Its got to be possible to improve these speeds somehow, rather than just hoping to throw ever larger PC's at the building task.

                    Maybe its possible to prevent total rebuilds? But then I would expect it to already do this? I don't know what is going on???

                    I was hoping to move to UE4 for my next game, but currently that doesn't seem likely, unless I can find a way to get this working. Hopefully Unreal 4.1 will solve some of this?
                    Last edited by Alan3DAGames; 04-22-2014, 08:29 PM.

                    Comment


                      #11
                      For example, if I edit (on my laptop) a large C++ file on my current nearly finished Android game
                      I'm sure that large file isnt nearly large enough to compare with UE4..Of course there will be hopefully some optimizations to improve build times etc,since its been only 1 month of release of UE4 ,things will get better over time.

                      Comment


                        #12
                        Yeah I agree things will improve in the future.

                        As for the the example of compile times, I just used them to illustrate the turn around times for rebuilding a new version of the app, which is very important for us to test new versions of an App on actual devices. The importance of that rebuild speed is required regardless of which language or engine the app is created in. So in the case of UE4, what is it doing that is taking so long?, as it really shouldn't take as long as it does. Which implies its doing way too much, which hopefully means there's a way to tell it to do less, so it builds much faster?
                        Last edited by Alan3DAGames; 04-24-2014, 12:59 PM.

                        Comment


                          #13
                          Great topic, got my game working great on my Android S3... Build times are rough though and I do think there needs to be options for faster builds, BUT, I see the reason why you probably wouldn't want things reduced for bug testing of your game. So this might not even be possible with the exception of the compiler to work faster....

                          Comment


                            #14
                            I got Tappy Chicken to work too. My device is the Nexus 7 (2013, 32GB). The output was ETC1. It's not in the compatibility list but it's part of the Adreno 320 family, the same as the Galaxy S4.

                            Unfortunately, all the small 3D programs (Card, Mobile Temple) and a Basic Blueprint platformer template crashed - not blanked. I also tried the checklist from Alan3AGames in the Rendering Menu without better results.

                            I'm pretty much a newbie in android development. I tried a few adb shell calls but I don't know how to get a minimal crash report to pinpoint the problem at least.

                            Lost cause ? Wait for the next update ?

                            ---
                            My review of Tappy Chicken:
                            I suck at it equally on PC than on Mobile: 11/10.

                            Comment


                              #15
                              Click image for larger version

Name:	Screenshot_2014-04-28-23-22-33.png
Views:	1
Size:	518.0 KB
ID:	1050294
                              Yay finally the Temple Mobile is running in my phone! (Sony Xperia M). It struggles, but it renders.
                              I am sharing the render settings for those that have a similar phone.
                              Here are the settings that worked for me (UE4.1)

                              Mobile HDR NO
                              Culling NO
                              Texture Streaming NO
                              Use DXT5 Normal Maps NO
                              Allow Static Lighting YES
                              Separate Traslucency NO
                              Movables in early Z-pass NO

                              Now that it has worked, I will be enabling the other options one by one to pinpoint what gives me the black screen.

                              Comment

                              Working...
                              X