Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial environmental sounds mod with flowing water sounds #2064

Merged
merged 6 commits into from Sep 11, 2019

Conversation

@paramat
Copy link
Member

commented Mar 1, 2018

Add initial environmental sounds mod with flowing water sounds

default:river_water_source can also create sound if desired as
rivers are considered to be flowing water.
A simple mod for now, with the intention to later use new engine
sound features when they appear.
//////////////

Each interval (3.5s):
A volume around a player (currently radius 8, so the volume is 1 mapblock) is searched for the relevant nodes.
The sound is played at the average water node position with gain determined by node count.

There are 4 sounds to reduce repetition.
Each sound is 6s long, fades in for 2s and fades out for 2s, the intention is for the fade out of a sound to overlap the fade in of the next (at the new position), to hopefully create a smoothly shifting sound source as the player moves.

@Fixer-007

This comment has been minimized.

Copy link
Contributor

commented Mar 1, 2018

What about water_flowing and river_water_flowing as well?

@paramat

This comment has been minimized.

Copy link
Member Author

commented Mar 2, 2018

Those are also counted.

@ClobberXD

This comment has been minimized.

Copy link

commented Mar 2, 2018

@paramat - A good start - kudos to the initiative - This is at least better than having to hear only the lava cooling, the flames burning, or the dungeon master's fire-balls flying... Can't even hear my own breathing - creepy indeed! XD

On a more serious note, how about including the Immersive Sounds mod (or it's variants) in MTG by default?

@paramat

This comment has been minimized.

Copy link
Member Author

commented Mar 2, 2018

The ambience mods i know of are unsuitable, too intensive, have large file sizes (causing slow download) and have far too many sounds, many of which in my opinion don't make sense (non-existant animals etc.) or are unnecessary, irritating, tasteless, stereotyped or unsuitable for an abstract environment. Sorry for my refined taste but when i watch MT let's play videos the ambience mod sounds are irritating for me.

The reason why this PR has few sounds and we are somewhat waiting for new engine features before going further is because MT is not well suited to multiple ambience sounds.

@Ezhh

This comment has been minimized.

Copy link
Member

commented Mar 2, 2018

Haven't tested yet, but water sounds are probably the biggest want for me. My worry is that not all water is flowing... and still water should not sound like flowing water.

@paramat paramat force-pushed the paramat:ambience branch from a6a2359 to 2f501f6 Mar 2, 2018

@paramat

This comment has been minimized.

Copy link
Member Author

commented Mar 2, 2018

Tuned gain, it was too quiet.
Tuned interval for less gain variation.
Removed one of the sounds that had a problematic background noise.

River water source is usually only used in rivers, which are considered to be flowing, however whether they make sound is debateable because some players may use river water source to create non-flowing collections of water. However, if it doesn't make sound then a level stretch of river will be silent.

For an ambience mod i consider it essential that only things existing in a MT world can make sound, so no field recordings of jungles with howling monkeys etc. =)

@ClobberXD

This comment has been minimized.

Copy link

commented Mar 3, 2018

For an ambience mod i consider it essential that only things existing in a MT world can make sound, so > no field recordings of jungles with howling monkeys etc. =)

A step in the right direction! No more rats and bats in underground caverns anymore! XD

Ambience should be just that - ambience - sounds made by the surroundings, and not by non-existent creatures. That being said, I'd love it if the mobs (are they going to be added to MTG anytime?) get their own sounds too, they're too quiet ATM.

@Fixer-007

This comment has been minimized.

Copy link
Contributor

commented Mar 3, 2018

Looks/hears very nice to me in-game!

Another important suggestion:

@rubenwardy

This comment has been minimized.

Copy link
Member

commented Mar 3, 2018

Seems to work well, apart from a delay when adding / removing flowing.

Calling the mod ambience is probably a bad idea though - maybe env_sounds would be better

This should also probably have an API to add flowing nodes. I suggest doing the API in such a way that in the future the engine could pick up support for environmental sounds like these - ie: use a group or node property, rather than a function call

@paramat

This comment has been minimized.

Copy link
Member Author

commented Mar 3, 2018

I didn't really think about mod name clashes, i'm ok with another name.
Lava sound may be a good idea too. That sample sounds like an earthquake though.

@paramat

This comment has been minimized.

Copy link
Member Author

commented Mar 3, 2018

How about this simply searches for nodes with a new group 'water_sounds'? Then modders can use that group.

@paramat paramat added the Low priority label Mar 3, 2018

@Fixer-007

This comment has been minimized.

Copy link
Contributor

commented Mar 3, 2018

or "liquid_sounds" or "sounds" or "ambience"

@paramat

This comment has been minimized.

Copy link
Member Author

commented Mar 3, 2018

This is very WIP now and rather experimental, i'll try adding lava sounds to experiment with multiple sounds.
Until we have new engine sound features this is intended to be quite simple and temporary, so i don't want to make it complex or work on it too much.

@rubenwardy

This comment has been minimized.

Copy link
Member

commented Mar 3, 2018

This mod doesn't really need an API as it's temporary, however if it has one it should be future proof - ie: the same API that an engine feature would have.
I suggest having something like ambient_grouped in sounds, then doing this:

local source_nodes = {}
local sound = {}

minetest.after(0, function()
    for node_name, def in minetest.registered_nodes do
        if def.sounds and def.sounds.ambient_grouped then
            source_nodes[#source_nodes + 1] = node_name
            sound[node_name] = def.sounds.ambient_grouped
        end
    end
end)

@rubenwardy rubenwardy closed this Mar 3, 2018

@rubenwardy rubenwardy reopened this Mar 3, 2018

@paramat

This comment has been minimized.

Copy link
Member Author

commented Mar 3, 2018

IRC http://irc.minetest.net/minetest-hub/2018-03-03#i_5244130 onwards.
There are engine obstacles to searching for multiple nodes, the search would need to be done once per sound type. So this may have to be restricted to water sounds only, if that is worth doing. I'm now even more uncertain about this PR.
Or maybe we add a new type of search API that allows a single search to divide positions by node name.

@paramat

This comment has been minimized.

Copy link
Member Author

commented Apr 11, 2018

So closing for now.

mods/env_sounds/init.lua Outdated Show resolved Hide resolved
mods/env_sounds/init.lua Outdated Show resolved Hide resolved
mods/env_sounds/depends.txt Outdated Show resolved Hide resolved
Add initial environmental sounds mod with flowing water sounds
default:river_water_source can also create sound if desired as
rivers are considered to be flowing water.
A simple mod for now, with the intention to later use new engine
environmental sound features if/when they appear.

@paramat paramat force-pushed the paramat:ambience branch from 1b2b6e4 to 95fb14a Sep 9, 2019

@paramat

This comment has been minimized.

Copy link
Member Author

commented Sep 9, 2019

Attended to most reviews. Testing still to be done and a simplification of using '#wpos' instead of 'waters'.

@paramat paramat force-pushed the paramat:ambience branch from 5709d77 to fe544f4 Sep 10, 2019

@paramat

This comment has been minimized.

Copy link
Member Author

commented Sep 10, 2019

Tested. Simplification done too.
Still need to add to settingtypes.txt.

mods/env_sounds/init.lua Outdated Show resolved Hide resolved
mods/env_sounds/init.lua Outdated Show resolved Hide resolved
mods/env_sounds/init.lua Outdated Show resolved Hide resolved
mods/env_sounds/init.lua Outdated Show resolved Hide resolved
@paramat

This comment has been minimized.

Copy link
Member Author

commented Sep 10, 2019

Added setting to settingtypes.txt.
Now to attend to latest reviews.

@paramat

This comment has been minimized.

Copy link
Member Author

commented Sep 10, 2019

Next i'll check it works without the handles table, and if so make that change.

@paramat

This comment has been minimized.

Copy link
Member Author

commented Sep 10, 2019

All done hopefully. Thanks for the reviews, the code was quite a mess and it is nicely simplified.

@paramat paramat removed the WIP label Sep 10, 2019

@sfan5
sfan5 approved these changes Sep 11, 2019
Copy link
Member

left a comment

Works nicely.

@sfan5 sfan5 added the One approval label Sep 11, 2019

@DS-Minetest

This comment has been minimized.

Copy link
Contributor

commented Sep 11, 2019

Tested.
I'm not sure whether it really makes sense to put the sound to a position.

@paramat

This comment has been minimized.

Copy link
Member Author

commented Sep 11, 2019

Will fix lua check.

@paramat paramat merged commit ea992bd into minetest:master Sep 11, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@TumeniNodes

This comment has been minimized.

Copy link
Contributor

commented Sep 12, 2019

Can't wait to check this out this weekend when I have some time!

@paramat

This comment has been minimized.

Copy link
Member Author

commented Sep 12, 2019

I recommend setting river water source nodes to make sound, as this makes mgvalleys rivers make more sound. The setting is disabled by default on request of Ezhh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
10 participants
You can’t perform that action at this time.