Unity SetQualityLevel persistence

Started by
2 comments, last by lawnjelly 5 years, 9 months ago

I've managed to get an Android build of my Tower Defence game and it's now running swimmingly. My only snag is I wanted to put in an options slider to change the quality levels in the options, so you can scale the performance manually.

I have used QualitySettings.SetQualityLevel.

It is working great but there is a slight snag .. on my android device the two higher quality settings cause the display to become completely garbled (I suspect it is due to the anti aliasing switching on). This in itself isn't a showstopper, as you would think you would just quit the game and restart. However the problem is is that unity is automatically saving the quality settings on exit, so when you restart the game it again comes out garbled and you can't get to change it back. Much like setting a mobile phone to arabic.

I figured out you can clear out these settings in Android in the settings->app->clear app data, but obviously I don't want users to do this.

I can think of a few solutions:

  1. Always set the game to lowest quality on startup.
  2. Record the unity decided best settings on first run, and reset this before quitting each time.
  3. Somehow prevent unity saving the quality settings
  4. Set the actual options themselves (e.g. shadow distance etc) rather than use the in built quality settings (this may not get persisted)
  5. Use a system like windows, have the user confirm the new mode by clicking 'yes' within 15 seconds or reverting to previous mode

Has anyone come across this problem, any solutions?

Advertisement

Option 5 sounds best to me, if my vote counts :)

Indie Game Dev

8 minutes ago, trojanfoe said:

Option 5 sounds best to me, if my vote counts :)

I went with option 2 as it was quickest to put in, but I agree option 5 is probably the best available. Really this is something that should be sorted out by OpenGL / Unity (i.e. detect invalid modes and not allow their selection), rather than have end users working around these bugs.

It relates to one of the two dodgiest parts of OpenGL in my opinion, the lack of standardized 'feature sets' (and the other being the difficulty of debugging the state machine).

This topic is closed to new replies.

Advertisement