Page 1 of 1

Play sound on entity rotation - QoL

Posted: Tue Dec 17, 2019 3:36 pm
by Squelch
TL;DR
Give audible feedback that the entity rotation action has been performed.
What ?
When the entity rotation key is pressed, play a sound to serve as feedback that the action has been performed.
Why ?
Audible feedback is important in games, so due to the proximity of the default E (properties) and R (rotate) keys on an English keyboard layout, it is very easy to accidentally press the R key instead of, or at the same time as the E key. Any entity under the pointer will then be rotated - usually unseen by the player - only to be discovered later when things stop working. Some entities, such as pipe to ground and some buildings, are difficult to spot that they are no longer connected.

Audible feedback on rotation should serve to alert the player that they have performed the rotate action.

This is a quality of life request.

Case example

Re: Play sound on entity rotation - QoL

Posted: Sun Dec 22, 2019 2:57 pm
by Squelch
The more I have looked at this, the more I'm convinced it must be an oversight, or there is a rationale against giving audible feedback for rotation that I've failed to find - yes I've searched extensively.

Almost every other [important entity] action has an accompanying sound, so why not rotation?

Is there an event for rotating an entity? I have thought about making a mod, but somehow cannot find an event to hook for it.

[Edited for semantics]

Re: Play sound on entity rotation - QoL

Posted: Sun Dec 22, 2019 3:16 pm
by eradicator
Squelch wrote:
Sun Dec 22, 2019 2:57 pm
Almost every other action has an accompanying sound, so why not rotation?
False, there's many things that don't.
Squelch wrote:
Sun Dec 22, 2019 2:57 pm
Is there an event for rotating an entity? I have thought about making a mod, but somehow cannot find an event to hook for it.
on_player_rotated_entity + LuaPlayer.play_sound()

Re: Play sound on entity rotation - QoL

Posted: Sun Dec 22, 2019 3:21 pm
by Squelch
eradicator wrote:
Sun Dec 22, 2019 3:16 pm
False, there's many things that don't.
Agreed, most dialog actions do not have a sound, but entity interaction has feedback for everything except rotation. Would you care to expand?
on_player_rotated_entity + LuaPlayer.play_sound()
Thanks, I had just found on_player_rotated_entity and came back to correct myself. :oops:

Re: Play sound on entity rotation - QoL

Posted: Mon Dec 23, 2019 2:18 pm
by Squelch
I strongly believe that there should be some feedback given for an action that has the potential to cease factory production, and then cause the player to go on a debug hunt to find that one pesky pipe to ground that was accidentally rotated unseen and unheard.

I've scratched my own itch and created a small Mod that adds audible feedback to the rotate action.

Mod Portal: Sound On Rotate

Hopefully, something similar will be added to the base game in future.

Re: Play sound on entity rotation - QoL

Posted: Sat Dec 28, 2019 4:10 pm
by MEOWMI
+1

I absolutely believe rotating entities should have a sound, even if it's the same one for everything.

Re: Play sound on entity rotation - QoL

Posted: Sat Dec 28, 2019 5:35 pm
by PyroFire
Squelch wrote:
Tue Dec 17, 2019 3:36 pm
Give audible feedback that the entity rotation action has been performed.
k

Code: Select all

script.on_event(defines.events.on_player_rotated_entity, function(ev) ev.entity.surface.play_sound({path="entity-build/wooden-chest",position=ev.entity.position}) end)
You're welcome.

Re: Play sound on entity rotation - QoL

Posted: Sun Dec 29, 2019 4:12 pm
by Squelch
MEOWMI wrote:
Sat Dec 28, 2019 4:10 pm
I absolutely believe rotating entities should have a sound, even if it's the same one for everything.
I seem to have a distant memory that rotation once had a sound, but that would need confirmation in an older version of Factorio. My little addition re-uses the large deconstruction sound which is familiar, but not too intrusive, and should alert you to having done something important.
PyroFire wrote:
Sat Dec 28, 2019 5:35 pm

Code: Select all

script.on_event(defines.events.on_player_rotated_entity, function(ev) ev.entity.surface.play_sound({path="entity-build/wooden-chest",position=ev.entity.position}) end)
You're welcome.
Thank you PyroFire. I had already thought of exploring the use of Surface as I thought it would be the correct route instead of using the Player Character. I believe this should be more multiplayer friendly too.

Mod updated with attribution.

Re: Play sound on entity rotation - QoL

Posted: Sun Dec 29, 2019 10:44 pm
by MEOWMI
I'm using the mod from now on. I'll reply here if I get any different thoughts about it as I use it, though I do feel pretty certain that this is a useful QoL change, period.

I mean, placing and removing entities have their own sounds, so I'm pretty sure rotating should as well. In fact, you can't place or remove an entity accidentally, but you can rotate one. And from a gameplay, lore, realism or physics perspective, all of the actions would qualify for having a sound effect.

Re: Play sound on entity rotation - QoL

Posted: Tue Dec 31, 2019 12:18 pm
by eradicator
Squelch wrote:
Sun Dec 29, 2019 4:12 pm
Thank you PyroFire. I had already thought of exploring the use of Surface as I thought it would be the correct route instead of using the Player Character. I believe this should be more multiplayer friendly too.
Are standard building sounds played to every force in vanilla?

Re: Play sound on entity rotation - QoL

Posted: Tue Dec 31, 2019 2:30 pm
by Squelch
eradicator wrote:
Tue Dec 31, 2019 12:18 pm
Are standard building sounds played to every force in vanilla?
That's a good question, and I honestly don't remember if building construction can be heard from or by other players in multiplayer - it's been a long while. I did check some videos of multiplayer games and thought I could hear other players interacting with buildings, but that may have been via the mixdown of the voice channel.

I would say, that intuitively, we would hear the actions of other players while in proximity, and the Surface location method should play the sound subject to the normal falloff with distance. It is afterall, a natural thing experienced in everyday life.

Is this a wrong assumption to make? Does the Surface location method offered by @PyroFire play globally regardless of distance to source?

Re: Play sound on entity rotation - QoL

Posted: Tue Dec 31, 2019 3:00 pm
by PyroFire
eradicator wrote:
Tue Dec 31, 2019 12:18 pm
...
Squelch wrote:
Tue Dec 31, 2019 2:30 pm
...
Defining position makes it not play globally for everyone on that surface/force/etc.
Distance falloff as you'd expect.


See also
PyroFire wrote:
Tue Dec 31, 2019 1:39 pm
*Edit

Gave it some thought and you could do the processing and conditions in lua and play it individually per player (if you really needed to):
https://lua-api.factorio.com/latest/Lua ... play_sound

Re: Play sound on entity rotation - QoL

Posted: Tue Dec 31, 2019 3:38 pm
by Squelch
PyroFire wrote:
Tue Dec 31, 2019 3:00 pm
eradicator wrote:
Tue Dec 31, 2019 12:18 pm
...
Squelch wrote:
Tue Dec 31, 2019 2:30 pm
...
Defining position makes it not play globally for everyone on that surface/force/etc.
Distance falloff as you'd expect.
Thank you for confirming my understanding on that point.
See also
PyroFire wrote:
Tue Dec 31, 2019 1:39 pm
*Edit

Gave it some thought and you could do the processing and conditions in lua and play it individually per player (if you really needed to):
https://lua-api.factorio.com/latest/Lua ... play_sound
I had originally designed it as a player only audible feedback, but upon reflection, your Surface method seemed to be more suitable and would also allow other players to hear that something was happening that may affect what they were currently doing.

I think I'll add a Mod setting (default player only) that leaves the exact method up to the individual player just in case other players find it to be too intrusive - personally, I'd rather be aware of other player's actions while close by.

Re: Play sound on entity rotation - QoL

Posted: Wed Nov 25, 2020 9:28 pm
by Squelch
Thankfully we now have feedback sounds to accompany entity actions including rotation in vanilla 1.1.x.

I will not update Sound On Rotate, and it will be deprecated in due course.

Re: Play sound on entity rotation - QoL

Posted: Thu Nov 26, 2020 5:20 am
by ssilk
moved to implemented— ssilk