Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Official Game Settings System

Discussion in 'Open Projects' started by vwildcat783, Sep 30, 2020.

  1. vwildcat783

    vwildcat783

    Joined:
    Aug 3, 2020
    Posts:
    20
    https://open.codecks.io/unity-open-project-1/decks/15/card/15e-settings-system
    Hi was wondering if I could make the settings scene i am pretty good at making menus and this is something I would really love to do. if I could how would I submit the UI
    And what would you like me to add
    Some ideas are:

    Music volume:

    Sound FX
    Main menu music
    In game music

    Colorblind settings
    Captions
    I could also show the controls
    Brightness
    Language

    Could you see if people can make UI design for the Slider, Text Font, Button, and Drop Down? If not I can make something but I would rather have someone else do it that is helping with design so it can fit better.
    thanks for your time
     
    Last edited: Sep 30, 2020
  2. Desoxi

    Desoxi

    Joined:
    Apr 12, 2015
    Posts:
    154
    Hey, great project and idea to make this a community effort!

    I would like to work on the Settings System. Are there any special plans on how it should work? Persistency over several sessions etc.
    I can build a prototype UI to test the code. As for the persistency we could stick to PlayerPrefs for now or if you want we could use JSON serialization of a ScriptableObbject maybe.
     
    luisquid likes this.
  3. luisquid

    luisquid

    Joined:
    Mar 21, 2015
    Posts:
    37
    I can help you out! I really want to work on the settings as well.
     
  4. vwildcat783

    vwildcat783

    Joined:
    Aug 3, 2020
    Posts:
    20
    Does anyone have ideas for settings options or does anyone know how to make UI if u do just put it in the comments:):D;):p
     
  5. vwildcat783

    vwildcat783

    Joined:
    Aug 3, 2020
    Posts:
    20
    I have a script ready would u like me to me to share it @cirocontinisio
     
    Last edited: Oct 1, 2020
  6. luisquid

    luisquid

    Joined:
    Mar 21, 2015
    Posts:
    37
    There is already a thread about it! Please, make sure to use the existing threads!
     
  7. luisquid

    luisquid

    Joined:
    Mar 21, 2015
    Posts:
    37
  8. vwildcat783

    vwildcat783

    Joined:
    Aug 3, 2020
    Posts:
    20
    I created this first and waiting for approval because you can’t submit it until it is approved
     
    Last edited: Oct 1, 2020
  9. vwildcat783

    vwildcat783

    Joined:
    Aug 3, 2020
    Posts:
    20
    I want to contribute can u just focus on one thing at a time instead of doing everything give other people stuff to do
     
  10. nrvllrgrs

    nrvllrgrs

    Joined:
    Jan 12, 2010
    Posts:
    40
    My two cents is that this should actually be a separate GitHub project that is included via the Package Manager. That way anyone in the Unity community can easily use it.
     
  11. nrvllrgrs

    nrvllrgrs

    Joined:
    Jan 12, 2010
    Posts:
    40
    Additionally, it would be smart to coordinate with the Saving / Loading system, especially if we were to use an external serialization solution such as Odin Serialization.
     
  12. StivenUnity

    StivenUnity

    Joined:
    Jun 18, 2015
    Posts:
    7
    I want to see your architecture can you send me the forked repository to view the progress?
     
  13. Desoxi

    Desoxi

    Joined:
    Apr 12, 2015
    Posts:
    154
    I think if the saving/loading system is using a generic JSON serializer that can serialize all <T> classes we don't need to think about saving/loading data in this settings system, you are right. It just would be to call the save/load methods from within the settings system.

    As for the package manager idea, I think we should not make this too complex. If every feature would be a package it would be too hard to synch all systems together in my opinion.

    Also, this settings system is nothing too complicated. It's just a class that enables you to change the settings like resolution etc. (mentioned in the settings system card).

    If this is going to be assigned to me, I'll talk to the Saving/Loading system guy to make the save system a bit generic or I could tackle both in one go.
     
  14. Desoxi

    Desoxi

    Joined:
    Apr 12, 2015
    Posts:
    154
    I didn't start development yet as nothing is assigned, but my forked project is this: https://github.com/Acimaz/open-project-1.git
     
  15. Megatank58

    Megatank58

    Joined:
    Jul 20, 2020
    Posts:
    44
    Hi there I'm interested is this too i have worked with some of these settings in the past.
     
  16. cirocontinisio

    cirocontinisio

    Unity Technologies

    Joined:
    Jun 20, 2016
    Posts:
    742
    This is the official thread to discuss the Game Settings System (roadmap card).

    Please start with simple implementations that generally stick to what the card on the roadmap is saying. There will be time to expand the functionality.
     
    luisquid and Desoxi like this.
  17. HoomanJCode

    HoomanJCode

    Joined:
    Oct 1, 2020
    Posts:
    2
    Hello, I want to join you and I have an idea to implement the architecture that "stivenUnity" referred to.
    for example, a parent class that helps you to implement any settings later. I can commit diagrams if you start the Settings project.
     
  18. luisquid

    luisquid

    Joined:
    Mar 21, 2015
    Posts:
    37
    Alright, folks. Here's a list of what needs to be done taking what the roadmap card says:

    1. Resolution (Drop down menu with a list of 16:9 aspect ratio resolutions)
    2. Fullscreen toggle.
    3. Shadow Quality
    4. Anti-aliasing
    5. Graphic settings preset (Drop down menu with Low, Mid, High)
    6. Audio Volume (SFX and Music)
    7. Language (We can have the placeholder and work on this later since it's not priority right now.
    8. Control Remapping Scheme (This is a whole new section that is related to this other roadmap card)
    9. Save and Load Settings
    In my opinion we could use player prefs to save the settings using JSON serialization to save the monobehaviour class. The control remapping scheme can be managed separately in its corresponding thread.

    Are any of you working on doing something already? I think it would be better if we choose something small and start building from it, rather than try to do it all to prevent working double.
     
  19. Desoxi

    Desoxi

    Joined:
    Apr 12, 2015
    Posts:
    154
    I've worked on this already and have implemented a working UI which can change the following:

    • General - Language
    • Graphics - Graphics Presets, Resolution (all supported resolutions on users device), fullscreen mode,
    • Advanced Graphics - Anisotropic filtering, Anti-Aliasing, Shadow Distance, Shadow Quality
    • Audio - Music Volume, Sfx Volume
    The only thing which blocks me from making a pull request atm is that unitys "SetQualityLevel" actually sets the quality level selected from the presets, but completely ignores all advanced graphics. This is nonsense as it has all presets configured inside the "Quality" project setting already.

    Also calling QualitySettings.SetQualityLevel(index, true) with the second parameter set to true, which is used to apply expensive changes like anti-aliasing values, does not change said settings. It defaults them to 0, which seems to be a unity bug at this point.

    I think I still will make a pull request and work on this later on to fix it. Maybe someone has an idea why it does not work as intended.
     
    luisquid likes this.
  20. luisquid

    luisquid

    Joined:
    Mar 21, 2015
    Posts:
    37
    Care to share your PR? Maybe I can take a look at it and we can work on it together! But great progress! :D
     
    Desoxi likes this.
  21. Desoxi

    Desoxi

    Joined:
    Apr 12, 2015
    Posts:
    154
  22. Megatank58

    Megatank58

    Joined:
    Jul 20, 2020
    Posts:
    44
    So i think we are just going to commit to this PR if im not wrong?
     
  23. Desoxi

    Desoxi

    Joined:
    Apr 12, 2015
    Posts:
    154
    Blocked for now as I am waiting for the TMPro PR to be merged into the repo. After that, I'll do a rebase of the Settings System PR.
     
  24. Megatank58

    Megatank58

    Joined:
    Jul 20, 2020
    Posts:
    44
    Sounds cool,Can i help you?
     
    Last edited: Oct 3, 2020
  25. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    249
    This is an interface I use in my games for settings system.
    I'm not saying it is required to use interfaces, just suggesting features to implement. Hope it helps
    Code (CSharp):
    1. public interface ISetting
    2.     {
    3.         // used for PlayerPrefs.SetString(setting.Id, setting.Save())
    4.         string Id { get; }
    5.        
    6.         event Action Changed;
    7.        
    8.         void Initialize();
    9.  
    10.         void SetDefault();
    11.  
    12.         void Load(string saveData);
    13.  
    14.         string Save();
    15.     }
     
  26. Neonage

    Neonage

    Joined:
    May 22, 2020
    Posts:
    203
    PlayerPrefs is really not a place for configs, as they need to be easily accessible json files
     
  27. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    249
    I just simplified my example. Ideally, there is some sort of ISettingStorage.

    By the way, settings and configs are completely different things. ScriptableObjects are a great place for game configs.
    But settings(or preferences), that player chooses, more naturally to store in PlayerPrefs.
     
  28. Neonage

    Neonage

    Joined:
    May 22, 2020
    Posts:
    203
    And more ideally it would be ScriptableObject ;)
     
  29. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    249
  30. matrunk

    matrunk

    Joined:
    Oct 13, 2020
    Posts:
    6
    Hey everyone i'm colorblind if you want i can try to work on the colorblind's settings
     
  31. Megatank58

    Megatank58

    Joined:
    Jul 20, 2020
    Posts:
    44
    I think what we can do is like have a checkbox for ColorBlind Mode and then when its true we can run the script to set it for colorblind support.
     
  32. CaseyHofland

    CaseyHofland

    Joined:
    Mar 18, 2016
    Posts:
    105
    Funny enough, I am actually working on that! I came to the Open Projects repo to see if this were a place where I could use it, but it seems that the community has got this one pretty much sorted out, and since I'm trying to generalize I'm taking my sweet time. But since you're interested, I'll share it here: https://github.com/Casey-Hofland/UISettings

    Note that this is pretty much in alpha. I have the core concept ready (which is why I came here), but check in... probably next week and I'll have updated the documentation.

    EDIT:
    I've looked at Staras Repo and what I'm trying to do, and it will be some time later when this is done because I'm generalizing the package more. First it was a UISettings system... now it will be a Settings system, with Components for UI build on top (this way, you can use settings in custom scripts as well and have more control over their management).
     
    Last edited: Nov 11, 2020
  33. CaseyHofland

    CaseyHofland

    Joined:
    Mar 18, 2016
    Posts:
    105
    Alright, 0.1.0 of Game Settings is here!!!

    There is no documentation yet so if you want to check it out for yourself here is what the general workflow would look like:
    1. Go to Create Asset > Game Settings > Pick a setting (try Anti Aliasing).
    2. Create a Dropdown.
    3. Add a SettingsDropdown to it.
    4. Pick a setting (Anti Aliasing if you've been following) and press Reset UI in the Inspector (or enable force UI).
    5. Go to Edit > Project Settings > Quality and watch Anti Aliasing update together with your setting!

    Next will be a lot more settings, next next will be URP and Input System support, and Documentation will probably happen somewhere in between.
     
    Last edited: Nov 17, 2020
    Erethan likes this.
  34. mihaititiriga07

    mihaititiriga07

    Joined:
    Oct 9, 2020
    Posts:
    1
    I would like to help with this but unfortunately i’m not around my computer and neither will be for the next 3 days
     
  35. socialtrens

    socialtrens

    Joined:
    Oct 23, 2017
    Posts:
    10
    Can we add dynamic resolution to the list? Most people prefer dynamic rather than fixed resolution.
     
    Last edited: Nov 25, 2020
  36. kirbygc00

    kirbygc00

    Joined:
    Apr 4, 2016
    Posts:
    46
    Hi All,

    I would not mind implementing (maybe sometime this weekend) if people have not already signed up to do so... Seems like it is maybe partially already implemented but I see an open card for the task on codecs? o_O will take a look at the codebase later and see
     
unityunity