User Tag List

Results 1 to 6 of 6

Thread: Best/Most efficient way to make a "mute" function.

  1. #1
    Clicker Fusion 2.5 (Steam)Android Export Module (Steam)

    Join Date
    Jun 2018
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Best/Most efficient way to make a "mute" function.

    I've searched the forums and found a few things, but the responses are pretty old/incomplete so I figured I'd reignite the discussion. There seem to be a lot of ways to go about this but I want to try to find the balance between efficiency and ease. Efficiency meaning as little of a performance hit as possible and ease because I've already completely designed my game and everything is a spaghetti of mess, so I'd rather do it the simplest way if possible. Of course I'll do whatever I have to, but if there is a real easy "duh" way of doing it then I will do it that way.

    I'd assume to make so when you hit a button it changes a global value, then check for the global value at the beginning of a frame, etc etc. For the event, which is best between "stop channel", "stop any sample playing", "set mail volume", "pause all sounds", etc? And then what, store the volume value in an INI to save the player's preference across sessions?

    Also, I saw an example on another thread that said this:

    [events]
    Add this event to you're current "play sample" events:
    *If Mute (a global value) = 1
    +Sample is playing
    - Pause all Sounds
    *If Mute (a global value) = 2
    +Only once when action event loops
    - Resume all Sounds
    [/events]


    Would that persistent check to see if the global value = x be a large unnecessary drain on performance, or how does Fusion handle that type of process?

    Anyway, thanks for the input.

  2. #2
    Clicker Fusion 2.5 (Steam)Android Export Module (Steam)

    Join Date
    Jun 2018
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also, two things worth mentioning for my specific instance in case they make a difference:
    - I'm developing for Android
    - The mute option can only be selected from the main menu, not during the actual gameplay (it's short/casual), so I don't have to worry about implementing it in every frame.

  3. #3
    Clicker Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jan 2015
    Location
    Australia
    Posts
    245
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    The quickest method I can think of is having the menu option set the main volume to 0


    Audio will still continue to 'play' but at 0 volume, and you can change it depending on the global value/ini file at the start of the frame

  4. #4
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,702
    Mentioned
    133 Post(s)
    Tagged
    0 Thread(s)
    I would do something like this. By manipulating only the main volume, you don't have to worry yourself with activating/deactivating individual sounds, which would be a nightmare. And by storing your preferred master volume in a separate altVal, you can keep it separate from your mute function. So if your user chooses a master volume level of 87, then hits the mute button, then when she unmutes again the game will automatically return to a main volume of 87. Basically, event #6090 in the picture is the crux. The rest is just to flesh out the example:


  5. #5
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,702
    Mentioned
    133 Post(s)
    Tagged
    0 Thread(s)
    sorry, I meant to say event #6091

  6. #6
    Clicker Fusion 2.5 (Steam)Android Export Module (Steam)

    Join Date
    Jun 2018
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Awesome, thanks a bunch! I've been definitely going with the mail volume technique.

Similar Threads

  1. Replies: 2
    Last Post: 12th August 2021, 04:24 PM
  2. Replies: 1
    Last Post: 3rd December 2020, 08:47 AM
  3. Can not make "headshot" function
    By 3DBBQ in forum Fusion 2.5
    Replies: 2
    Last Post: 2nd October 2017, 01:22 PM
  4. Efficient "Text Adventure" Events
    By Soilydude in forum Fusion 2.5
    Replies: 4
    Last Post: 1st April 2016, 04:19 PM
  5. Replies: 6
    Last Post: 18th August 2015, 02:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •