Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upMap sound effects. [Ready] #12337
Conversation
CIB
changed the title
Added additional parameters to sound::sound() for playing sound effects.
Map sound effects. [WIP]
May 10, 2015
This comment has been minimized.
This comment has been minimized.
It's pretty easy to open and close doors without making any noise. I do this every time I open or close a door just by turning the handle first. I feel this is something a survivor in a post cataclysmic world would do. If it must be added, then might I suggest that it be dexterity based? Additionally, opening a door should be much quieter than closing one. |
This comment has been minimized.
This comment has been minimized.
|
Ehh.. Yeah, sure, if we had a sneak system that would make sense. But right now, I have the option of assuming that people aren't sneaking around 100% of the time, or reducing atmosphere by making doors be totally quiet. I prefer the former. Can reduce the noise of door opening, yeah. |
This comment has been minimized.
This comment has been minimized.
|
Cool! |
CIB
force-pushed the
CIB:sound
branch
2 times, most recently
from
c1e5591
to
b2a1efd
May 12, 2015
This comment has been minimized.
This comment has been minimized.
|
Looking forward to this! This will make the cataclysm much more immersed for me. |
BevapDin
reviewed
May 12, 2015
| @@ -39,9 +41,9 @@ void sounds::ambient_sound(int x, int y, int vol, std::string description) | |||
| sound( tripoint( x, y, g->u.posz() ), vol, description, true ); | |||
| } | |||
|
|
|||
| void sounds::sound(int x, int y, int vol, std::string description, bool ambient) | |||
| void sounds::sound(int x, int y, int vol, std::string description, bool ambient, std::string id, std::string variant) | |||
This comment has been minimized.
This comment has been minimized.
BevapDin
May 12, 2015
Contributor
This (and the other sound function) should take the strings as const reference.
BevapDin
reviewed
May 12, 2015
| @@ -200,6 +202,8 @@ void sounds::process_sound_markers( player *p ) | |||
|
|
|||
| for( const auto &sound_event_pair : sounds_since_last_turn ) { | |||
| const int volume = sound_event_pair.second.volume * volume_multiplier; | |||
| const std::string sfx_id = sound_event_pair.second.id; | |||
This comment has been minimized.
This comment has been minimized.
BevapDin
May 12, 2015
Contributor
And here is no need to copy the strings, just use const references to them:
const std::string &sfx_id = sound_event_pair.second.id
This comment has been minimized.
This comment has been minimized.
CIB
May 13, 2015
Author
Contributor
Good point, I haven't had to write efficient code in too long. I hear you also made a string-int class like I'd always wanted to have one of, I might even look into using that. :)
CIB
force-pushed the
CIB:sound
branch
from
b2a1efd
to
c3b091f
May 14, 2015
CIB
changed the title
Map sound effects. [WIP]
Map sound effects. [Ready]
May 14, 2015
This comment has been minimized.
This comment has been minimized.
|
This should be ready for merge now. |
This comment has been minimized.
This comment has been minimized.
|
It looks fine and it compiles fine and it works fine (the |
CIB
added some commits
May 10, 2015
CIB
force-pushed the
CIB:sound
branch
from
4edaad0
to
2ac80d8
May 15, 2015
This comment has been minimized.
This comment has been minimized.
|
Latest update was just rebasing against the sounds::sound() 3d refactor. |
Coolthulhu
self-assigned this
May 15, 2015
This comment has been minimized.
This comment has been minimized.
|
It's a pain to get the sound build working on mingw (pkg-config, dependencies etc.). It's probably way easier on Linux. Deassigning now. If no one else has the time to test it I may retry later, but I'm giving up now. |
Coolthulhu
removed their assignment
May 15, 2015
kevingranade
self-assigned this
May 16, 2015
This comment has been minimized.
This comment has been minimized.
|
Code looks good and I'm looking at merging now, but some requests. (that you likely know are desirable already) |
kevingranade
merged commit 2ac80d8
into
CleverRaven:master
May 17, 2015
1 check passed
This comment has been minimized.
This comment has been minimized.
|
@kevingranade Yeah I'll look into improving the docs. Enumerating sound sets is a desired feature, but I don't see it as a priority until the community picks up on creating sound sets of their own, which likely first requires more support for various sound effects in the game. There's also another problem, I guess I'll create an issue on the tracker. |
CIB commentedMay 10, 2015
Adds functionality for map sound effects. The sound effect to be played and the volume is determined directly by the same call made to produce in-game noises. There is a documentation file containing an overview of all the sound effect IDs that are supported so far.
https://github.com/CIB/CDDA-Test-Soundpack/