FakeFishGames / Barotrauma

A 2D online multiplayer game taking place in a submarine travelling through the icy depths of Jupiter's moon Europa.
http://www.barotraumagame.com/
1.75k stars 407 forks source link

[Unstable] Speaker/jukebox bugs and inconsistencies #14842

Open Regalis11 opened 3 weeks ago

Regalis11 commented 3 weeks ago

Discussed in https://github.com/FakeFishGames/Barotrauma/discussions/14841

Originally posted by **NotWendy** October 16, 2024 ### Disclaimers - [X] I have searched the issue tracker to check if the issue has already been reported. - [ ] My issue happened while using mods. ### What happened? This is a set of issues I discovered with the new items that play audio, which are used in outpost modules. - Speakers/jukeboxes which are on at the start of the round begin playing their music slightly out of sync. Annoying when you want to put multiple speakers in one module to even out the volume across a large room. - Changing the state of the speaker/jukebox with wiring is broken. Speaker has a state checkbox that's visible when you manually interact with the item. Sending a signal to switch the speaker off via wiring does NOT affect the state of the visible checkbox. In order for the speaker to be on and play music, the visible checkbox needs to be checked on manually AND the invisible state variable needs to be set to 1 via wiring. Compare this to something like a relay, where sending a toggle_state signal into it toggles the state of its state checkbox. This is the expected behavior. - Speakers and jukeboxes don't have a power pin, but they do have power consumption specified in the item settings by default. Why? Doesn't seem to affect anything, it's just odd. - Speakers and jukeboxes play the same tracks, but the order in which tracks are numbered is reversed in the jukebox. It'd be better to keep the numbering consistent. All testing was done within the submarine editor's test mode. ### Reproduction steps For the wiring issue: 1. Place a speaker in the outpost module. 2. Press E on it to open the interaction menu and uncheck the "On" checkbox. 3. Wire a switch to the "set_state" pin or a button to the "toggle_state" pin. 4. Load the module in the test mode and interact with the switch/button. 5. The speaker does not play music. 6. Repeat the process with the "On" checkbox being checked. 7. The switch/button now properly affects the speaker's state, but regardless of whether it's wired to be on or off, the "On" checkbox will maintain its original state. ### Bug prevalence Happens every time I play ### Single player or multiplayer? Happens outside single player or multiplayer game modes (e.g. game launches on startup, something broken in the main menu) ### - _No response_ ### Version v1.6.4.0 (unstable) ### - _No response_ ### Which operating system did you encounter this bug on? Windows ### Relevant error messages and crash reports _No response_
Jasontti commented 2 weeks ago

Testing notes: https://github.com/FakeFishGames/Barotrauma-development/pull/5895#issuecomment-2431262648

Issues addressed:

Could not repro out of sync issue anymore, so could also be fixed. Power pin and track ordering still stands, I'll leave this ticket up for those.