Skip to content

Conversation

@eheimburg
Copy link
Contributor

@eheimburg eheimburg commented Mar 22, 2021

Adds a little slider for volume to the bottom-left of each UI screen. Stores this volume setting in PlayerPrefs.

Since we don't have an icon for volume handy in the release branch, it's just labeled with the word "Volume", but it's set up in a prefab that should let us change that to a speaker icon without having to alter the scenes again.

Because different UI screens have different scaling, it's hard to get the volume slider into the EXACT same spot on each screen without manually repositioning child elements -- and I wanted to avoid overriding any child-element positions, because we want to replace the label with an icon later. So I changed the in-scene scale of the prefab a little bit to make it "approximately" the same size and position on each screen. When final art is in, we can tweak the nested-element positions on each screen to get them to line up more precisely if they look weird.

Edit: also tweaked the relative volumes of music and sound effects so that you can actually hear the sound-effects. See comments below.

Adds a little slider for volume to the bottom-left of each UI screen. Stores this volume setting in PlayerPrefs.

Since we don't have an icon for volume handy in the release branch, it's just labeled with the word "Volume", but it's set up in a prefab that should let us change that to a speaker icon without having to alter the scenes again.

Because different UI screens have different scaling, it's hard to get the volume slider into the EXACT same spot on each screen without manually repositioning child elements -- and I wanted to avoid overriding any child-element positions, because because we want to replace the label with an icon later. So I changed the in-scene scale of the slider a little bit to make it approximately the same size and position on each screen. When final art is in, we can tweak position on each screen to get them to line up more precisely.
@eheimburg
Copy link
Contributor Author

eheimburg commented Mar 22, 2021

I just noticed there is already another PlayerPrefs call in the project (in ClientGameNetPortal). I've moved that into the ClientPrefs wrapper I made.

(I know that's a bit presumptive of me, but in my experience having all the PlayerPrefs calls in the same location is a MASSIVE win for maintainability, and a personal best practice.)

@eheimburg
Copy link
Contributor Author

The music's relative volume was so loud that most sound-effects were entirely obscured. So I reduced the music-volume from 100% to 80% and changed the 3D drop-off range for the character prefabs so that sound-effects are louder.

This gives us an adequate "mix" of music and game sounds -- at least enough to tell that sound-effects are playing! We may eventually want a simple "Settings" screen where music volume can be configured separately from overall game volume.

(This isn't exactly related to the master-volume slider, since the problem is relative volume. But it was definitely a bug that you couldn't hear the sound effects! I kept trying to change the volume-slider to hear sounds, but never could, so I figured I'd better fix it. If this change is inappropriate here, I apologize... I can easily revert this part of the fix.)

@eheimburg eheimburg changed the title Feature/volume control [GOMPS-373] Volume control [GOMPS-373] Mar 22, 2021
@SamuelBellomo SamuelBellomo added the 1-Needs Review PR needs attention from the assignee and reviewers label Mar 22, 2021
@fernando-cortez fernando-cortez added 2-Reviewed with Comments PR requires owner's attention and removed 1-Needs Review PR needs attention from the assignee and reviewers labels Mar 22, 2021
Reverted the Startup scene, then added the new prefab to it. The other scenes should all be unchanged from pre-patch now. Hopefully. (git was giving strange error messages about BossRoom.unity, but in any case, there SHOULD be no changes in this PR to any scene except Startup)
@fernando-cortez fernando-cortez added 2-One More Review One review in, one to go and removed 2-Reviewed with Comments PR requires owner's attention labels Mar 25, 2021
@pdeschain pdeschain added 3-Good to Merge and removed 2-One More Review One review in, one to go labels Mar 26, 2021
@SamuelBellomo SamuelBellomo merged commit 6c49170 into release/v0.1.0-experimental Mar 26, 2021
@SamuelBellomo SamuelBellomo deleted the feature/volume-control branch March 26, 2021 19:12
SamuelBellomo added a commit that referenced this pull request Mar 30, 2021
* release/v0.1.0-experimental: (97 commits)
  adding screenshots (#228)
  [GOMPS-352] Add audiomixer to project (#222)
  feature: transport picker improvements (#200)
  fixing issue where client disconnect boots everyone else (#229)
  removed GC allocs inside of AIBrain (#210)
  init client door with server's current value for IsOpen (#227)
  Photon Realtime Setup Guide for Boss Room (#225)
  Update README.md add link to doc (#226)
  Bug fix: hide icons for unimplemented attacks
  feature: v0.1.0 experimental updating to latest master mlapi (#220)
  fixing missing reference exceptions, and missing animation (#219)
  feat: replace with photon package (#218)
  Replaced LobbyPlayerArray with a NetworkList<LobbyPlayerState> (#217)
  ART:  Warning Message fixes for models, animations, and Shader...and new App icon (#213)
  Updating to latest MLAPI on master (#214)
  null guard added inside of target action for accessing a possibly destroyed reticule (#212)
  [GOMPS-270] bossroom should let users specify connection port# (#205)
  Fix useless log error (#203)
  Bugfix: properly disconnect on quit [GOMPS-324][GOMPS-327][GOMPS-385] (#196)
  Volume control [GOMPS-373] (#195)
  ...

# Conflicts:
#	README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants