Navigation Menu

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

Game: Falling node sounds. #6603

Closed
wants to merge 1 commit into from
Closed

Game: Falling node sounds. #6603

wants to merge 1 commit into from

Conversation

sofar
Copy link
Contributor

@sofar sofar commented Nov 9, 2017

Falling nodes should make a sound. This can only be done here,
so for simplicity we just call the sound_play() here with the node
place sound. We ignore any gain value in the sound spec since a
falling node should be loud, so the 1.0 default gain makes sense
here.

@paramat paramat added Feature ✨ PRs that add or enhance a feature Sounds labels Nov 9, 2017
@paramat
Copy link
Contributor

paramat commented Nov 9, 2017

So the sound will be the same loudness as the node's placing sound? It should be.

We ignore any gain value in the sound spec since a
falling node should be loud, so the 1.0 default gain makes sense
here.

Maybe i misunderstand but this concerns me. The sound should not be played at a fixed maximum loudness as this will be too loud depending on material and waveform amplitde / compression / limiting.
But if you mean the sound will be the placing sound, with the same loudness as the placing sound then that's ok.

@sofar
Copy link
Contributor Author

sofar commented Nov 10, 2017

The text is clear enough.

The default gain value is 1.0. The code omits any gain value from the sound table, and therefore plays at the default (max) gain.

Most placement sounds have lower gain values since placing a node almost always happens close to the player and should be not too loud.However, failling nodes can happen and will happen further away from the player, and a normal sound level (which varies, most are already 1.0 but metal is 0.5) is likely going to result in falling nodes not being heard falling by the player, especially at really low values.

Secondary, the sound of a node crashing into the ground should be loud. No exception.

If the sound of the place sample is too loud to begin with, it should be edited and normalized instead. Reducing the gain for all variants of a sound is akin to asking all players to increase their volume while lowering the volume of the game - double work for zero effort. It also breaks down the soundscape by creating a flat soundscape where all the samples are played at the same volumes, and this becomes dull, and minetest is already an incredible mute game to begin with.

So, that should clarify why this volume level is entirely reasonable.

@ghost
Copy link

ghost commented Nov 10, 2017 via email

@sofar
Copy link
Contributor Author

sofar commented Nov 10, 2017

No, the sounds all play at exactly the same time, so it's a single "thud" even with 500+ nodes (tested). The client doesn't sweat it either, I perceived no lag even with numbers this high. The sound was also a reasonable volume, it doesn't get weird.

@paramat
Copy link
Contributor

paramat commented Nov 10, 2017

Ok i agree falling nodes should be louder than placed.

If the sound of the place sample is too loud to begin with, it should be edited and normalized instead.

This probably won't happen, it also creates extra work where the gain for other uses of the sound needs to be tuned.
Normalisation doesn't equalise perceived loudness because how 'peaky' the waveform is affects that.

Anyway, i've just seen that the large majority of our place sounds are already gain = 1.0, so while i think fall gain should have a fixed relation to place gain, in MTG it makes little difference, so i'm neutral. Good feature though.

@HybridDog
Copy link
Contributor

This can only be done here

No, my mod does this since 23 May 2015: https://github.com/HybridDog/falling_extras/blob/master/init.lua

@paramat
Copy link
Contributor

paramat commented Nov 11, 2017

Will test and probably +1, the idea is good.

@sofar
Copy link
Contributor Author

sofar commented Nov 12, 2017

@HybridDog copying and duplicating the entire falling.lua proves exactly my point, that it has to be done right there...

@paramat
Copy link
Contributor

paramat commented Nov 13, 2017

Fun, makes a good sound and really improves the experience.
Very many nodes falling (1000s) causes a few sound messages in terminal and an odd sound but no problem.

			-- Create node and remove entity
			if core.registered_nodes[self.node.name] then
				core.add_node(np, self.node)
				if self.meta then
					local meta = core.get_meta(np)
					meta:from_table(self.meta)
				end
				local def = core.registered_nodes[self.node.name]
				if def and def.sounds and def.sounds.place and def.sounds.place.name then
					core.sound_play(def.sounds.place, {pos = np})
				end
			end

core.registered_nodes[self.node.name] is got twice, and def is assured to exist due to the first condition. How about:

			-- Create node and remove entity
			local def = core.registered_nodes[self.node.name]
			if def then
				core.add_node(np, self.node)
				if self.meta then
					local meta = core.get_meta(np)
					meta:from_table(self.meta)
				end
				if def.sounds and def.sounds.place and def.sounds.place.name then
					core.sound_play(def.sounds.place, {pos = np})
				end
			end

?
+1 once code is improved.

@ghost
Copy link

ghost commented Nov 13, 2017

I tested it, and enjoyed it, but in my experience I was not far away when the fall impact sounds were played at 1.0 gain. In fact, I was one node away digging sand and gravel deposits.

In this case, both the digging sound and the falling sound occur, and it's frequent because I did from the bottom of these deposits to save on mouse movement.

Just wanted to share, thanks for the PR. I especially enjoyed digging the bottom of a sand tower to hear the falling sounds played sequentially. The actual material sounds themselves don't do this code justice, in my opinion, but that's another matter.

@sofar
Copy link
Contributor Author

sofar commented Nov 13, 2017

Removed the unneeded table lookup.

@HybridDog
Copy link
Contributor

HybridDog commented Nov 13, 2017

Please also set makes_footstep_sound to true, it makes a splash sound when something is falling into water.

core.add_node(np, self.node)
if self.meta then
local meta = core.get_meta(np)
meta:from_table(self.meta)
end
if def and def.sounds and def.sounds.place and def.sounds.place.name then
Copy link
Contributor

@paramat paramat Nov 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'if def' not needed here. Can be fixed on merge.
Otherwise 👍

@paramat paramat added Action / change needed Code still needs changes (PR) / more information requested (Issues) >= Two approvals ✅ ✅ and removed One approval ✅ ◻️ labels Nov 13, 2017
@paramat
Copy link
Contributor

paramat commented Nov 13, 2017

Please also set makes_footstep_sound to true,

-1 Problem is that then causes a long sloshing footstep sound for every water node passed through for every falling node, which is much more intensive than 1 sound on landing. Large numbers of falling nodes already cause sound overload messages in terminal.
Best left to another PR for consideration.

Falling nodes should make a sound. This can only be done here,
so for simplicity we just call the sound_play() here with the node
place sound. We ignore any gain value in the sound spec since a
falling node should be loud, so the 1.0 default gain makes sense
here.
@sofar
Copy link
Contributor Author

sofar commented Nov 13, 2017

Yeah, making a footstep sound isn't the right idea. Ideally we'd play a splash sound when traversing the liquid boundary, but .. yikes.. that will take a lot of code.

Removed one unneeded def check.

@paramat
Copy link
Contributor

paramat commented Nov 13, 2017

👍

@paramat
Copy link
Contributor

paramat commented Nov 14, 2017

41bc0ef

@paramat paramat closed this Nov 14, 2017
@HybridDog
Copy link
Contributor

HybridDog commented Nov 17, 2017

Problem is that then causes a long sloshing footstep sound for every water node

I did it with the falling_extras mod and it sounds quite well, like bubbles under the falling object making their way around it, though I think you're right with the intensity.

@sofar sofar deleted the fallsound branch November 22, 2017 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Action / change needed Code still needs changes (PR) / more information requested (Issues) Feature ✨ PRs that add or enhance a feature Sounds >= Two approvals ✅ ✅
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants