Raptor007 / aq2-tng

Action Quake 2: The Next Generation. Raptor007's sandbox for testing changes. When verified stable, this code is pushed to the official aq2-tng repo:
https://github.com/aq2-tng/aq2-tng/tree/bots
4 stars 2 forks source link

Enhancement: Make weapon sounds selectable like the cl_chat_sound #137

Closed darkshade9 closed 8 months ago

darkshade9 commented 1 year ago

Currently, clients can select a variety of chat beep sounds in the menu, example:

pairs "chat beep" cl_chat_sound \
        disabled "" \
        default misc/talk.wav \
        alternative misc/talk1.wav \
        misc/talk_user.wav misc/talk_user.wav
action --align "test chat beep" "stopsound; popmenu; pushmenu sound; echo playing $cl_chat_sound; play $cl_chat_sound"

Research the necessary changes to make this compatible with weapon sounds. Example:

pairs "M4 Shot" cl_m4_sound \
        default weapons/m4a1fire.wav \
        alt1 weapons/m4a1fire2.wav \
        alt2 weapons/m4a1fire3.wav
action --align "Test M4 Shot sound" "stopsound; popmenu; pushmenu sound; echo playing $cl_m4_sound; play $cl_m4_sound"

Trello card: https://trello.com/c/DBtg0bAG

Raptor007 commented 1 year ago

Maybe I'm missing something, but this sounds like a Q2Pro client feature rather than an AQ2 server feature.

One thing to keep in mind is that it may need to replace multiple sounds for llsound servers to work right.

darkshade9 commented 1 year ago

I was looking into the code a bit to see if this was possible from the gamelib, it's this weird area where Q2Pro handles the sound engine and menu UI, but the sounds and weapons we're referencing only exist in TNG. If it must be done in Q2Pro then we can remove this as a TNG issue and we'll see what the lift would be to get it in Q2Pro

darkshade9 commented 1 year ago

An in-game representation of the configurable sounds https://www.youtube.com/watch?v=4sOk3WdQt1M

would also resolve this issue

https://github.com/actionquake/distrib/issues/217

Raptor007 commented 1 year ago

I like the demo, but how was it done? This still seems like something that will need to be done in Q2Pro rather than the AQ2-TNG server code. Each player should only control their own local sounds.

Btw, if each number is meant to correspond to a sound set, I think they're mixed up. Here's what I heard:

cl_mp5_sound 0: Hickok45 cl_mp5_sound 1: Quake 2 machinegun cl_mp5_sound 2: Rogue Spear

cl_m4_sound 0: Quake 2 machinegun? cl_m4_sound 1: Hickok45 cl_m4_sound 2: Rogue Spear

cl_m3_sound 0: Counter-Strike cl_m3_sound 1: Hickok45 cl_m3_sound 2: AQ2 original

cl_hc_sound 0: AQ2 original cl_hc_sound 1: Hickok45 cl_hc_sound 2: Rogue Spear

cl_ssg_sound 0: AQ2 original cl_ssg_sound 1: Hickok45 cl_ssg_sound 2: Rogue Spear

It's missing the original AQ2 sounds for the MP5 and M4: aq2-mp5-m4.zip

I extracted the main weapon sounds from some sound paks so you can compare for yourself: aq2-sound-sources.zip

darkshade9 commented 1 year ago

This was done in the gamelib as a proof of concept, it does change the sounds for everyone on the server when changed, so it's not currently limited to the client, as you said, it likely needs to be done in Q2Pro. This would probably break some things though, because from what I've reviewed, the gamelib takes over the weapon sounds from the client.

darkshade9 commented 1 year ago

The change implemented involved adjusting how q2pro handles llsound, but it is operational in the latest version of AQtion. It requires the server to run llsound 1 to function.

darkshade9 commented 8 months ago

This is live with great success in https://github.com/actionquake/aq2-tng/, closing this issue