Announcement

Collapse
No announcement yet.

Whats the proper way to name a device profile?

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

    Whats the proper way to name a device profile?

    I'm working on a top down shooter for the android platform that is set up using a orthographic camera and its played in portrait. Ive been using a S4 and Nexus10 for testing. But I can't get my Nexus 10 to play my game in full resolution. I have a main game BP that most of the game logic is handled in, which gets the screen size from the controller at start. I have print screens to tell me the initial size and natively the nexus 10 gets a Screen size X = 664 no matter what i try.

    Nexus 10 log when initializing:

    08-31 22:01:25.950: D/UE4(3901): [2014.09.01-02.01.25:957][ 0]LogAndroid: Default profile:Android GPUFamily:Mali-T604
    08-31 22:01:25.950: D/UE4(3901): [2014.09.01-02.01.25:958][ 0]LogAndroid: Default profile:Android GPUFamily:Mali-T604
    08-31 22:01:25.950: D/UE4(3901): [2014.09.01-02.01.25:958][ 0]LogAndroid: Selected Device Profile: [Android]
    08-31 22:01:25.950: D/UE4(3901): [2014.09.01-02.01.25:958][ 0]LogAndroid: Selected Device Profile: [Android]
    08-31 22:01:25.950: D/UE4(3901): [2014.09.01-02.01.25:958][ 0]LogInit: Applying CVar settings loaded from the selected device profile: [Android]
    08-31 22:01:25.950: D/UE4(3901): [2014.09.01-02.01.25:958][ 0]LogInit: Applying CVar settings loaded from the selected device profile: [Android]
    08-31 22:01:25.950: D/UE4(3901): [2014.09.01-02.01.25:958][ 0]LogInit: Setting Device Profile CVar: [[r.MobileContentScaleFactor:1]]
    08-31 22:01:25.950: D/UE4(3901): [2014.09.01-02.01.25:958][ 0]LogInit: Setting Device Profile CVar: [[r.MobileContentScaleFactor:1]]

    The only setting that changes the log is changing the Default base [Android] Device profile and even at that when I change MobileContentScaleFactor to 2, it will show up as 2 in the log but not actually effect the screen size. I have tried adding numerous other profiles through the editor and through project/config/DefaultDeviceProfile.ini but none of them get associated with the Nexus 10. I have been using the GPU name as the profile in different combinations for example:

    [Android_Mali604]
    DeviceType=Android
    BaseProfileName=Android_High

    I have looked at Tappy Chicken inside and out for hours and nothing stands out as being done differently. Also my S4 works perfectly and gets the native Screen Size X = 1080, but the log shows a correct device profile selection as [Android_Adreno320]. So if I want to add a new device profile what would be the proper naming convention or a better solution? Any help would be much appreciated as I have trying to fix this for a few days.


    EDIT: Still haven't figured out how to name a profile, but turning MobileHDR off allows me to get the max resolution out of the nexus 10 by setting the base [Android] profile to MobileContentScaleFactor=2.0. Still interested in learning how to set a device profile up based on its GPU like the Adreno are.
    Last edited by Crystalis; 09-02-2014, 06:21 PM.

    #2
    Currently Android screen resolution works as follows (see FAndroidWindow::GetScreenRect in Engine\Source\Runtime\Core\Private\Android\AndroidWindow.cpp):

    1. get screen resolution as initial maximum allowed resolution and calculate aspect ratio
    2. if MobileHDR, set limit on height (portrait) or width (landscape) to 1024 and set other axis limit to maintain aspect ratio.
    3. if portrait, height is 1280 * r.MobileContentScaleFactor, for landscape height is 720 * r.MobileContentScaleFactor
    4. width is calculated to maintain aspect ratio
    5. clamp width and height to limits (either original screen resolution, or modified by MobileHDR condition)

    This means you will get the actual resolution in only a few cases:

    1. device resolution is less than the calculated limits
    2. scalefactor is large enough to hit the clamped limit and wasn't limited by MobileHDR

    The idea is to pick a resolution to limit the rendering work scaled by expected device performance. Device profiles are used to adjust the scale factor and are defined in your project's config/DefaultDeviceProfiles.ini.

    For custom device profiles, you need to modify the code in a plugin. It is in:

    Engine\Plugins\Runtime\AndroidDeviceProfileSelector\Source\AndroidDeviceProfileSelector\Private\AndroidDeviceProfileSelectorModule.cpp

    This is where the profile names are selected by querying GPU family and GL version. The returned section is then used in the ini file.

    The current code returns Android_Adreno320, Android_Adreno330, and Android_Adreno330_ver53. You can add your own checks and returns here and add new sections to the ini file.

    Comment


      #3
      Just the information I was looking for. Thanks!

      Comment


        #4
        Originally posted by Chris Babcock View Post

        For custom device profiles, you need to modify the code in a plugin. It is in:

        Engine\Plugins\Runtime\AndroidDeviceProfileSelector\Source\AndroidDeviceProfileSelector\Private\AndroidDeviceProfileSelectorModule.cpp

        This is where the profile names are selected by querying GPU family and GL version. The returned section is then used in the ini file.

        The current code returns Android_Adreno320, Android_Adreno330, and Android_Adreno330_ver53. You can add your own checks and returns here and add new sections to the ini file.
        Heyy Chris,
        I had a quick look at the profile selector code. Did you mean that by changing the code we can alter the profile selection criteria we use ? like in default case GL_ver and GPU Family is used. There is no need to edit code if we want profiles for Adreno302 or other GPU Families right ? IF I'm correct Basedeviceprofiles.ini are to be edited to add new GPU families ... i'm a newbie to device profiling I jus need to enable AA for mid range phones(in my specific case, anything equal or above Adreno 4xx) Please help me i'm confused which files to be create/edited or code to be added. I'm currently using BP only but if required I'll switch to GitHub version of engine if required

        Comment


          #5
          Since my original replace we've added a way to use rules to define new profiles so it isn't necessary to modify C++ code. You can see the default rules in BaseDeviceProfiles.ini under [/Script/AndroidDeviceProfileSelector.AndroidDeviceProfileMatchingRules]. You can extend this with your own rules.

          Comment


            #6
            Is it possible to extend the matching rules by modifying some project specific ini file and not having to modify the BaseDeviceProfiles.ini that is a part of the engine? We would like to avoid touching engine source as much as possible. Is it possible to add it to DeviceProfiles.ini that gets created in your project when you save it through the device profile editor?
            Portfolio: www.rishipatkar.com

            Comment


              #7
              For those of you wondering how to do this without modifying BaseDeviceProfiles.ini all you have to do is remove the entries in DefaultDeviceProfiles.ini as in the code block below. Then you can just add re-add the ones you want after and override their matching behavior

              Code:
              -MatchProfile=(Profile="Android_PowerVR54x",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="PowerVR SGX 54[0-9]")))
              -MatchProfile=(Profile="Android_PowerVRMid",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="PowerVR"),(SourceType=SRC_GlVersion,CompareType=CMP_Regex,MatchString="^OpenGL ES 3\\.")))
              -MatchProfile=(Profile="Android_PowerVRLow",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="PowerVR")))
              -MatchProfile=(Profile="Android_Adreno2xx",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="Adreno \\(TM\\) 2[0-9][0-9]")))
              -MatchProfile=(Profile="Android_Adreno320",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Equal,MatchString="Adreno (TM) 320")))
              -MatchProfile=(Profile="Android_Adreno330_Ver53",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Equal,MatchString="Adreno (TM) 330"),(SourceType=SRC_GlVersion,CompareType=CMP_Regex,MatchString="ES 3\\.0 V@([0-9]+)"),(SourceType=SRC_PreviousRegexMatch,CompareType=CMP_GreaterEqual,MatchString="53")))
              -MatchProfile=(Profile="Android_Adreno330",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Equal,MatchString="Adreno (TM) 330")))
              -MatchProfile=(Profile="Android_Adreno4xx_Nexus6",Match=((SourceType=SRC_DeviceModel,CompareType=CMP_Equal,MatchString="Nexus 6")))
              -MatchProfile=(Profile="Android_Adreno4xx",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="Adreno \\(TM\\) 4[0-9][0-9]")))
              -MatchProfile=(Profile="Android_Adreno51x",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="Adreno \\(TM\\) 51[0-9]")))
              -MatchProfile=(Profile="Android_Adreno5xx_Vulkan_Nougat",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="Adreno \\(TM\\) 5[0-9][0-9]"),,(SourceType=SRC_VulkanAvailable,CompareType=CMP_Equal,MatchString="true"),(SourceType=SRC_AndroidVersion,CompareType=CMP_Regex,MatchString="7\\.")))
              -MatchProfile=(Profile="Android_Adreno5xx",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="Adreno \\(TM\\) 5[0-9][0-9]")))
              -MatchProfile=(Profile="Android_Adreno6xx",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="Adreno \\(TM\\) 6[0-9][0-9]")))
              -MatchProfile=(Profile="Android_TegraK1",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Equal,MatchString="NVIDIA Tegra"),(SourceType=SRC_GlVersion,CompareType=CMP_Regex,MatchString="^OpenGL ES 3\\.")))
              -MatchProfile=(Profile="Android_Tegra4",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Equal,MatchString="NVIDIA Tegra"),(SourceType=SRC_GlVersion,CompareType=CMP_Regex,MatchString="^OpenGL ES 2\\.")))
              -MatchProfile=(Profile="Android_IntelHD_ES3",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Equal,MatchString="Intel(R) HD Graphics"),(SourceType=SRC_GlVersion,CompareType=CMP_Regex,MatchString="^OpenGL ES 3\\.")))
              -MatchProfile=(Profile="Android_IntelHD",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Equal,MatchString="Intel(R) HD Graphics"),(SourceType=SRC_GlVersion,CompareType=CMP_Regex,MatchString="^OpenGL ES 2\\.")))
              -MatchProfile=(Profile="Android_Mali_4xx_LenovoS939",Match=((SourceType=SRC_DeviceModel,CompareType=CMP_Equal,MatchString="Lenovo S939")))
              -MatchProfile=(Profile="Android_Mali_4xx_LenovoA7600",Match=((SourceType=SRC_DeviceModel,CompareType=CMP_Regex,MatchString="^Lenovo A7600")))
              -MatchProfile=(Profile="Android_Mali_4xx_WikoHighwaySigns",Match=((SourceType=SRC_DeviceMake,CompareType=CMP_Equal,MatchString="Wiko"),(SourceType=SRC_DeviceModel,CompareType=CMP_Equal,MatchString="Highway Signs")))
              -MatchProfile=(Profile="Android_Mali_4xx_AlcatelPixi3",Match=((SourceType=SRC_DeviceMake,CompareType=CMP_Equal,MatchString="Alcatel"),(SourceType=SRC_DeviceModel,CompareType=CMP_Equal,MatchString="Pixi 3 (4) 3G")))
              -MatchProfile=(Profile="Android_Mali_4xx_KindleFire7",Match=((SourceType=SRC_DeviceModel,CompareType=CMP_Equal,MatchString="KFFOWI")))
              -MatchProfile=(Profile="Android_Mali_4xx",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="^Mali\\-4")))
              -MatchProfile=(Profile="Android_Mali_T6xx",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="^Mali\\-T6")))
              -MatchProfile=(Profile="Android_Mali_T7xx",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="^Mali\\-T7")))
              -MatchProfile=(Profile="Android_Mali_T8xx_No_Vulkan",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="^Mali\\-T8"),(SourceType=SRC_VulkanVersion,CompareType=CMP_Regex,MatchString="^1\\.0\\.([0-9]+)"),(SourceType=SRC_PreviousRegexMatch,CompareType=CMP_Less,MatchString="11")))
              -MatchProfile=(Profile="Android_Mali_T8xx",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="^Mali\\-T8")))
              -MatchProfile=(Profile="Android_Mali_G71",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="^Mali\\-G71")))
              -MatchProfile=(Profile="Android_Mali_G72",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="^Mali\\-G72")))
              -MatchProfile=(Profile="Android_Mid",Match=((SourceType=SRC_GlVersion,CompareType=CMP_Regex,MatchString="^OpenGL ES 3\\.")))
              -MatchProfile=(Profile="Android_Low",Match=((SourceType=SRC_GlVersion,CompareType=CMP_Regex,MatchString="^OpenGL ES 2\\.")))
              Portfolio: www.rishipatkar.com

              Comment


                #8
                Alternative you can just add !MatchProfile= to remove the existing match rules
                Portfolio: www.rishipatkar.com

                Comment

                Working...
                X