OreCruncher / BetterRain

Based on the BetterRain mod from Wirsbo
20 stars 12 forks source link

[Request] Sound Configs #69

Closed O13SC3N3 closed 8 years ago

O13SC3N3 commented 8 years ago

Secondary Config for ALL Dynamic Surroundings integrated sounds. Master Volume is good and all. but I still feel some sounds are to heavy or to light. And some more frequent then others should be. Would like to see the setup like the originals. Probably done in a 2nd config file, and put the visual features and other features left in the main.

"frog croaks" {
    I:Chance=25
    B:Enabled=true
    S:"Scaling Factor"=1.0
}
O13SC3N3 commented 8 years ago

Or can I do this already just adding more to the original config below frog croaks etc with like "wolf" ? or w.e it may be.

OreCruncher commented 8 years ago

All the sound config stuff moved to external Json files. You can create new block sound configuration for frog croaks, or biome config for biome sounds. The reason is that the block and biome sound lists are growing in size which makes putting them in the config file a bit messy.

If you want to take a look at the built-in config files you can find them here.

BTW, if you have a list of sounds and an indication of louder/softer, more frequent, etc. let me know. I can adjust the defaults directly.

OreCruncher commented 8 years ago

Example of tweaking the water lily frog croak:

{
    "entries":[
        {
        "blocks":[
            "minecraft:waterlily"
        ],
        "chance":25,
            "soundReset":true,
        "sounds":[
            {
            "sound":"dsurround:frog",
            "volume":0.4,
            "pitch":1.0,
            "variable":true
               }

            ]

    }
    ]
}

Change "chance" to a higher value to decrease the chance that a spot sound will play for a water lily block. "soundReset" causes all existing sounds for the block to be cleared, and the sound in this particular entry will be added. (If you forget the soundReset it will add another frog croak sound as a possible spot sound.) "volume" controls how loud it is. Put this entry into a Json file and update the "blocks" section of the configuration file so Dynamic Surroundings will update.

O13SC3N3 commented 8 years ago

So I could do this with the hissing? I assume its attached to tall grass. cuz its like somebody is breathing in your ear lol.

OreCruncher commented 8 years ago

lol - yeah, I had the same thought. Seems too frequent and the sound needs a bit more growl. The hissing isn't doing what I want. But yes, it is attached to tall grass.

What do you find wrong with the hissing? Wrong sound, too frequent, or both?

EDIT: BTW that is a recording of a snake hiss. I need to find a meaner snake recording. :D

OreCruncher commented 8 years ago

Found an angry catting hissing sound. Fitting since one gave me an allergic reaction yesterday. :) Also going to lessen the frequency from 1-in-10000 to 1-in-25000. (Plains are full of grass.)

O13SC3N3 commented 8 years ago

well a lot of biomes kick it off at least in my modpack. I think it was just way to frequent. I suggest adding the rattlers rattle to the deserts biome. maybe attached to the dead bush, Either way man it adds a lot of elements to the game which was needed. I also suggest opening up more sound channels and stream channels set by default in your generated configs. I was having issues with the footsteps and the sound engine crashing and the game locking up. Of course I got probably A LOT more sound elements going on then most people. I bumped mine up a little bit and haven't had any issues with the footsteps currently. Your almost tot he point where you could just absorb METMOS lol :p

OreCruncher commented 8 years ago

Rattesnake is configured for the desert already. They aren't long playing ones like you see in the movies. There are also several different types of rattles. Attaching them to a deadbush is possible to give it some locality would be interesting - need to explore that.

What defaults did you set for your sound configs? Reason I haven't changed from the defaults is because what values are picked is dependent on the sound system of the computer. Based on what I read Java only specifies 32 channels, which Minecraft divides into 28 normal and 4 stream (stream has higher priority than normal as well as directly reads from a file vs. loading directly into memory before playing). Increasing by default could cause problems for system that aren't capable of handling that many channels. I been looking for docs with additional detail in hopes of finding the sound capabilities of the sound system but have had no luck thus far.

O13SC3N3 commented 8 years ago

I think I did 38 and 8. When I get home I'll confirm

O13SC3N3 commented 8 years ago

Short of rewritten or injecting into Paul's code which would entitle a lot of work probably pretty limited in stabability with the sound engine. We also utilize on our server like glibys bc. I wonder if it be possible to generate a separate sound engine through a give port plugged into Minecraft. Probably could open up a huge opportunity of sound capabilities then what mine craft has. Could.beajor symching issues. But I honestly.don't see it being hard on servers since most cpu usage on servers is hardly thottled to max. Be kinda.cool.could symch.clients to hear the same.sounds at the same time.

OreCruncher commented 8 years ago

Funny you mention the sound engine. I just started thinking about doing just that. The sound manager in Minecraft is good enough for Minecraft, but when you start layering in sound effects it gets a bit messy. As you found out increasing the number of channels/voices that the sound system uses could help, but that is very much dependent on the computer system capabilities.

In terms of synchronizing sound across system Minecraft does that already for it's sounds. A "play sound" occurs in the server code and a special packet is sent to all clients. The clients then queue the sound into the sound system based on their individual configurations (volume enabled/disabled, etc.) Unfortunately this system is "hard coded" to only work with Minecraft sounds. A new layer would have to be built to permit more generic playing of sounds/music across clients. Not hard too do.

The main issue with sharing sounds across clients is the number of effects that could occur. For environmental/biome sounds this may be feasable. I would not want to do this with footsteps or block sounds. Reason is that the server would have to do all the processing per tick per player and that means overhead.

EDIT: I may redo the rain sound effects. Right now it generates a lot of sound - each one of those splashes that hit the ground have a chance of generating the noise. I could make it into a sound track and vary volume and pitch accordingly. Just have a single sound playing when it rains.

O13SC3N3 commented 8 years ago

Look at how resource packs do it it's just a sound file with conditions in Minecraft. One plays outside one plays in caves at certain y level or I doors. When closer to outside etc

OreCruncher commented 8 years ago

Understand. Let's use lava pops as an example. That effect is generated purely client side without any server input. In the client thread it does a "random display tick" event for a lava block. In that event the lava pop visual effect triggers as well as the pop sound event. When you see that lava spark and hear that pop in game other players that are standing next to you will not have that specific visual effect or sound - there is no coordination. Keep in mind, though, on their systems they will have their own lava sparks and sounds that you will not see/hear.

This is how the block sound events in Dynamic Surroundings currently works. It essentially mimics the "random display tick" process that exists in Minecraft, but extended to do other things. What we are talking about is moving all that logic to the server thread to have coordinated sounds between clients. Certainly doable, but it will increase server load. And there may be other artifacts introduced, like sound latency. For a cow mooing its not a big deal. But something like a sword swoosh could be a problem if the latency between the visual action and the sound play is too great.

O13SC3N3 commented 8 years ago

True maybe in the future we can play around with it maybe an extra sound add-on and a code in the original jar to synch clients sound and visuals. Maybe even achieve hearing other players walk, although that would have to be severely lightened to reduce load on footsteps. But be cool lets say players were playing an arena map, currently only thing you can hear if another player breaks a block. Be something to play with. So.ethimg simple to add to servers to synch clients but at server owners discretion simch some can't afford or have server capable. Hell mine might not

O13SC3N3 commented 8 years ago

@OreCruncher hey m8 just goto a Jungle with the latest release lol... All i can say.

OreCruncher commented 8 years ago

I think the only thing remaining for this entry is sound sync'ing across clients. Other things that were touched on (auto-configure sound channels, changed hiss sound, decrease frequency of grass spot sound, sound culling/blocking) are in the latest released version. If this is the case I will make a separate entry for the sound sync and close this one out.

OreCruncher commented 8 years ago

With the change a volume scaling factor can be specified for all sounds registered with Minecraft. GUI will list all registered sounds and a slider is provided where the player can increase/decrease volume factors between 0-200%. The config file can be edited directly, but it is more manageable to use the GUI.

O13SC3N3 commented 8 years ago

Awesome

OreCruncher commented 8 years ago

Yeah - had to find the right place to hook the sound volume. Nice thing is that with the next BETA a lot of the parameters can be adjusted on the fly in game by selecting "Mod Options" after hitting ESC to get the menu. A player can then adjust the applicable sound when it occurs in game until they like the volume.

OreCruncher commented 8 years ago

Release with feature change posted to CurseForge.