Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Game Settings didn't save

Discussion in 'Scripting' started by meTonne, Oct 8, 2019.

  1. meTonne

    meTonne

    Joined:
    Apr 30, 2016
    Posts:
    70
    Hello !

    I come for help. I buy the asset "All Settings pro" to have settings menu.
    All work correctly in the editor.
    When I build the game it's works on my dev computer. But if I use the build on another computer, parameter were reset to minimal and a part like shadows, or quality don't work.

    It's a problem with the asset or with my build settings ?
    May be a file where parameter will be stock but I didn't found in folders.

    Thanks for you help

    link : https://assetstore.unity.com/packages/tools/gui/all-settings-pro-63825
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You will want to contact the asset owner. When you do, you'll want to elaborate how you are debugging on the device. A quick way is to use numerous Debug.Log statements which will then show in the adb logcat logs, you just need to connect the device via a USB cable and enable development https://forum.unity.com/threads/how-to-capturing-device-logs-on-android.528680/
     
  3. meTonne

    meTonne

    Joined:
    Apr 30, 2016
    Posts:
    70
    Thanks JeffDUnity3D for your answers.

    But it's for an Windows game and not an Android SDK. I found that it's Awake function that didn't initializes the "default" parameter and the asset owner didn't answers :/
    I will try to send another email.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please show the results of your debugging, we can see what we can do here. Show your code and your Debug.Log statements for debugging.
     
  5. meTonne

    meTonne

    Joined:
    Apr 30, 2016
    Posts:
    70
    Hello,

    The error :
    On the first computer test :
    at bl_AllOptionsPro.ApplyResolution () [0x00013] in E:\Workplace\Unity\Projet\HoMBB\Assets\All Settings Pro\Content\Scripts\Core\bl_AllOptionsPro.cs:523
    at bl_AllOptionsPro.LoadAndApply () [0x00236] in E:\Workplace\Unity\Projet\HoMBB\Assets\All Settings Pro\Content\Scripts\Core\bl_AllOptionsPro.cs:565
    at bl_AllOptionsPro.Start () [0x0000c] in E:\Workplace\Unity\Projet\HoMBB\Assets\All Settings Pro\Content\Scripts\Core\bl_AllOptionsPro.cs:133

    On the second computer test :
    bl_AllOptionsPro:LoadAndApply() (at E:\Workplace\Unity\Projet\HoMBB\Assets\All Settings Pro\Content\Scripts\Core\bl_AllOptionsPro.cs:532)
    bl_AllOptionsPro:Start() (at E:\Workplace\Unity\Projet\HoMBB\Assets\All Settings Pro\Content\Scripts\Core\bl_AllOptionsPro.cs:133)


    Code is very long, I selected part with error.
    Start :
    Code (CSharp):
    1.     void Start()
    2.     {
    3.         if (ApplyOnStart)
    4.         {
    5.    133     LoadAndApply();
    6.         }
    7.         ChangeWindow(StartWindow,false);
    8.         ChangeSelectionButton(PanelButtons[StartWindow]);
    9.         SettingsPanel.SetActive(false);
    10.     }
    LoadAndApply function :
    Code (CSharp):
    1. void LoadAndApply()
    2.     {
    3.     532    bl_Input.Instance.InitInput();
    4.         CurrentAA = PlayerPrefs.GetInt(AllOptionsKeyPro.AntiAliasing, DefaultAntiAliasing);
    5.         CurrentAS = PlayerPrefs.GetInt(AllOptionsKeyPro.AnisoTropic, DefaultAnisoTropic);
    6.         CurrentBW = PlayerPrefs.GetInt(AllOptionsKeyPro.BlendWeight, DefaultBlendWeight);
    7.         CurrentQuality = PlayerPrefs.GetInt(AllOptionsKeyPro.Quality, DefaultQuality);
    8.         CurrentRS = PlayerPrefs.GetInt(AllOptionsKeyPro.Resolution, DefaultResolution);
    9.         CurrentVSC = PlayerPrefs.GetInt(AllOptionsKeyPro.VsyncCount, DefaultVSync);
    10.         CurrentTL = PlayerPrefs.GetInt(AllOptionsKeyPro.TextureLimit, 0);
    11.         CurrentSC = PlayerPrefs.GetInt(AllOptionsKeyPro.ShadowCascade, 0);
    12.         _showFPS = (PlayerPrefs.GetInt(AllOptionsKeyPro.ShowFPS, 0) == 1) ? true : false;
    13.         _volumen = PlayerPrefs.GetFloat(AllOptionsKeyPro.Volumen, 1);
    14.         float sd = PlayerPrefs.GetFloat(AllOptionsKeyPro.ShadowDistance, DefaultShadowDistance);
    15.         shadowProjection = (PlayerPrefs.GetInt(AllOptionsKeyPro.ShadownProjection, 0) == 1) ? true : false;
    16.         PauseSound((PlayerPrefs.GetInt(AllOptionsKeyPro.PauseAudio,0) == 1 ? true : false));
    17.         useFullScreen = (PlayerPrefs.GetInt(AllOptionsKeyPro.ResolutionMode, 0) == 1) ? true : false;
    18.         _shadowEnable = AllOptionsKeyPro.IntToBool(PlayerPrefs.GetInt(AllOptionsKeyPro.ShadowEnable));
    19.         _brightness = PlayerPrefs.GetFloat(AllOptionsKeyPro.Brightness, DefaultBrightness);
    20.         _realtimeReflection = AllOptionsKeyPro.IntToBool(PlayerPrefs.GetInt(AllOptionsKeyPro.RealtimeReflection, 1));
    21.         _lodBias = PlayerPrefs.GetFloat(AllOptionsKeyPro.LodBias, DefaultLoadBias);
    22.         _hudScale = PlayerPrefs.GetFloat(AllOptionsKeyPro.HUDScale, _hudScale);
    23.  
    24.         Debug.Log("Test_01");
    25.  
    26.         SetBrightness(_brightness);
    27.         ShadowDistance(sd);
    28.         ShadowDistanceSlider.value = sd;
    29.         Volumen(_volumen);
    30.         VolumenSlider.value = _volumen;
    31.         ShadowProjectionType(shadowProjection);
    32.         SetShadowEnable(_shadowEnable);
    33.         SetRealTimeReflection(_realtimeReflection);
    34.         SetLodBias(_lodBias);
    35.         SetHUDScale(_hudScale);
    36.     565  ApplyResolution();
    37.  
    38.         Debug.Log("Test_02");
    39.  
    40.         QualitySettings.shadowCascades = ShadowCascadeOptions[CurrentSC];
    41.         ShadowCascadeText.text = ShadowCascadeNames[CurrentSC].ToUpper();
    42.         QualityText.text = QualitySettings.names[CurrentQuality].ToUpper();
    43.         QualitySettings.SetQualityLevel(CurrentQuality);
    44.         FullScreenOnText.text = (useFullScreen) ? "^MenuOption_on" : "^MenuOption_off";
    45.         ShowFPSText.text = (_showFPS) ? "^MenuOption_on" : "^MenuOption_off";
    46.         if (FPSObject != null) { foreach (GameObject g in FPSObject) { g.SetActive(_showFPS); } }
    47.         BrightnessSlider.value = _brightness;
    48.         LoadBiasSlider.value = _lodBias;
    49.         HUDScaleFactor.value = _hudScale;
    50.         switch (CurrentAS)
    51.         {
    52.             case 0:
    53.                 QualitySettings.anisotropicFiltering = AnisotropicFiltering.Disable;
    54.                 AnisotropicText.text = AnisotropicFiltering.Disable.ToString().ToUpper();
    55.                 break;
    56.             case 1:
    57.                 QualitySettings.anisotropicFiltering = AnisotropicFiltering.Enable;
    58.                 AnisotropicText.text = AnisotropicFiltering.Enable.ToString().ToUpper();
    59.                 break;
    60.             case 2:
    61.                 QualitySettings.anisotropicFiltering = AnisotropicFiltering.ForceEnable;
    62.                 AnisotropicText.text = AnisotropicFiltering.ForceEnable.ToString().ToUpper();
    63.                 break;
    64.         }
    ApplyResolution:
    Code (CSharp):
    1.     public void ApplyResolution()
    2.     {  
    3. #if UNITY_EDITOR
    4.         Debug.Log("Resolution Settings just work on build.");
    5.         return;
    6. #else
    7.          bool apply = (AutoApplyResolution) ? useFullScreen : false;
    8.    523     Screen.SetResolution(Screen.resolutions[CurrentRS].width, Screen.resolutions[CurrentRS].height, apply);
    9. #endif
    10.     }
    I added Test_01 and Test_02. I saw Test_01 on the first computer and I saw Test_01 and Test_02 on the second computer.
     
    Last edited: Oct 9, 2019
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    So it doesn't even compile? The app would not run if it has compiler errors. You first mention "quality don't work" which would be a run-time behavior. The error message shows the line number, please identify the specific line.
     
  7. meTonne

    meTonne

    Joined:
    Apr 30, 2016
    Posts:
    70
    App run but settings menu isn't initialize. It didn't take "default" values.
    All parameters are on minimal. No shadows, low quality, low Brightness, etc ... When I say "Quality didn't work" it's the parameter Quality (low, medium, good, ultra).

    I add number of lines on the script
     
  8. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    What you showed previously is a compiler error. The game wouldn't be expected to run, please elaborate. Please show a screenshot of your Quality issue.
     
  9. meTonne

    meTonne

    Joined:
    Apr 30, 2016
    Posts:
    70
    But the game run ...

    the output log :
    Mono path[0] = 'F:/BuildHoM/HoMBB_Data/Managed'
    Mono config path = 'F:/BuildHoM/MonoBleedingEdge/etc'
    PlayerConnection initialized from F:/BuildHoM/HoMBB_Data (debug = 0)
    PlayerConnection initialized network socket : 0.0.0.0 55489
    Multi-casting "[IP] 192.168.1.105 [Port] 55489 [Flags] 3 [Guid] 3004495573 [EditorId] 795614429 [Version] 1048832 [Id] WindowsPlayer(Manuella) [Debug] 1 [PackageName] WindowsPlayer" to [225.0.0.222:54997]...
    Waiting for connection from host on [0.0.0.0:55489]...
    Timed out. Continuing without host connection.
    Started listening to [0.0.0.0:55489]
    Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,server=y,suspend=n,address=0.0.0.0:56573
    PlayerConnection already initialized - listening to [0.0.0.0:55489]
    Initialize engine version: 2018.3.8f1 (fc0fe30d6d91)
    GfxDevice: creating device client; threaded=1
    Direct3D:
    Version: Direct3D 11.0 [level 10.0]
    Renderer: Mobile Intel(R) 4 Series Express Chipset Family (Microsoft Corporation - WDDM 1.1) (ID=0x2a42)
    Vendor:
    VRAM: 566 MB
    Driver: 8.15.10.2702
    Begin MonoManager ReloadAssembly
    - Completed reload, in 6.335 seconds
    <RI> Initializing input.

    XInput1_3.dll not found. Trying XInput9_1_0.dll instead...
    <RI> Input initialized.

    <RI> Initialized touch support.

    WARNING: Shader Unsupported: 'Hidden/PostProcessing/Debug/Waveform' - Pass '' has no vertex shader
    ERROR: Shader Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)WARNING: Shader Unsupported: 'Hidden/PostProcessing/Debug/Waveform' - Setting to default shader.
    WARNING: Shader Unsupported: 'Hidden/PostProcessing/Debug/Vectorscope' - Pass '' has no vertex shader
    ERROR: Shader Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)WARNING: Shader Unsupported: 'Hidden/PostProcessing/Debug/Vectorscope' - Setting to default shader.
    WARNING: Shader Unsupported: 'Hidden/PostProcessing/Uber' - Pass '' has no vertex shader
    WARNING: Shader Unsupported: 'Hidden/PostProcessing/Uber' - Pass '' has no vertex shader
    WARNING: Shader Unsupported: 'Hidden/PostProcessing/MultiScaleVO' - Pass '' has no vertex shader
    ERROR: Shader Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)WARNING: Shader Unsupported: 'Hidden/PostProcessing/MultiScaleVO' - Setting to default shader.
    WARNING: Shader Unsupported: 'Hidden/PostProcessing/Debug/Histogram' - Pass '' has no vertex shader
    ERROR: Shader Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)WARNING: Shader Unsupported: 'Hidden/PostProcessing/Debug/Histogram' - Setting to default shader.
    WARNING: Shader Unsupported: 'Hidden/PostProcessing/DepthOfField' - Pass 'CoC Temporal Filter' has no vertex shader
    WARNING: Shader Unsupported: 'Hidden/PostProcessing/FinalPass' - Pass '' has no vertex shader
    WARNING: Shader Unsupported: 'Hidden/PostProcessing/FinalPass' - Pass '' has no vertex shader
    WARNING: Shader Unsupported: 'Hidden/PostProcessing/FinalPass' - Pass '' has no vertex shader
    WARNING: Shader Unsupported: 'Hidden/PostProcessing/Debug/LightMeter' - Pass '' has no vertex shader
    ERROR: Shader Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)WARNING: Shader Unsupported: 'Hidden/PostProcessing/Debug/LightMeter' - Setting to default shader.
    WARNING: Shader Unsupported: 'Hidden/PostProcessing/ScreenSpaceReflections' - Pass '' has no vertex shader
    ERROR: Shader Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)WARNING: Shader Unsupported: 'Hidden/PostProcessing/ScreenSpaceReflections' - Setting to default shader.
    UnloadTime: 226.020028 ms
    Uploading Crash Report
    NullReferenceException: Object reference not set to an instance of an object
    at Honeti.I18N.setLanguage (Honeti.LanguageCode langCode) [0x00001] in E:\Workplace\Unity\Projet\HoMBB\Assets\Unity Tool\Honeti\I18N\Scripts\I18N.cs:211
    at Honeti.I18N.Awake () [0x00001] in E:\Workplace\Unity\Projet\HoMBB\Assets\Unity Tool\Honeti\I18N\Scripts\I18N.cs:298

    (Filename: E:/Workplace/Unity/Projet/HoMBB/Assets/Unity Tool/Honeti/I18N/Scripts/I18N.cs Line: 211)

    Get Input
    UnityEngine.DebugLogHandler:Internal_Log()
    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    UnityEngine.Logger:Log(LogType, Object)
    UnityEngine.Debug:Log(Object)
    bl_Input:get_Instance() (at E:\Workplace\Unity\Projet\HoMBB\Assets\All Settings Pro\Content\Scripts\Core\bl_Input.cs:16)
    bl_AllOptionsPro:LoadAndApply() (at E:\Workplace\Unity\Projet\HoMBB\Assets\All Settings Pro\Content\Scripts\Core\bl_AllOptionsPro.cs:532)
    bl_AllOptionsPro:Start() (at E:\Workplace\Unity\Projet\HoMBB\Assets\All Settings Pro\Content\Scripts\Core\bl_AllOptionsPro.cs:133)

    (Filename: E:/Workplace/Unity/Projet/HoMBB/Assets/All Settings Pro/Content/Scripts/Core/bl_Input.cs Line: 16)

    Test_01
    UnityEngine.DebugLogHandler:Internal_Log()
    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    UnityEngine.Logger:Log(LogType, Object)
    UnityEngine.Debug:Log(Object)
    bl_AllOptionsPro:LoadAndApply() (at E:\Workplace\Unity\Projet\HoMBB\Assets\All Settings Pro\Content\Scripts\Core\bl_AllOptionsPro.cs:553)
    bl_AllOptionsPro:Start() (at E:\Workplace\Unity\Projet\HoMBB\Assets\All Settings Pro\Content\Scripts\Core\bl_AllOptionsPro.cs:133)

    (Filename: E:/Workplace/Unity/Projet/HoMBB/Assets/All Settings Pro/Content/Scripts/Core/bl_AllOptionsPro.cs Line: 553)

    Uploading Crash Report
    IndexOutOfRangeException: Index was outside the bounds of the array.
    at bl_AllOptionsPro.ApplyResolution () [0x00013] in E:\Workplace\Unity\Projet\HoMBB\Assets\All Settings Pro\Content\Scripts\Core\bl_AllOptionsPro.cs:523
    at bl_AllOptionsPro.LoadAndApply () [0x00236] in E:\Workplace\Unity\Projet\HoMBB\Assets\All Settings Pro\Content\Scripts\Core\bl_AllOptionsPro.cs:565
    at bl_AllOptionsPro.Start () [0x0000c] in E:\Workplace\Unity\Projet\HoMBB\Assets\All Settings Pro\Content\Scripts\Core\bl_AllOptionsPro.cs:133

    (Filename: E:/Workplace/Unity/Projet/HoMBB/Assets/All Settings Pro/Content/Scripts/Core/bl_AllOptionsPro.cs Line: 523)

    Setting up 1 worker threads for Enlighten.
    Thread -> id: b94 -> priority: 1

    screen of settings menu on computer 1.


    screen of settings menu on computer 2.
     
  10. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Oh I see, it's an Editor asset, my mistake. Yeah you'll need to contact the Asset owner, it looks like a bug in their asset.
     
  11. meTonne

    meTonne

    Joined:
    Apr 30, 2016
    Posts:
    70
    Thanks for you time, owner didn't answers so ... :(