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

Weapon muzzles (and player noises?) occur from origin #408

Closed
Paril opened this issue Feb 10, 2017 · 21 comments
Closed

Weapon muzzles (and player noises?) occur from origin #408

Paril opened this issue Feb 10, 2017 · 21 comments

Comments

@Paril
Copy link
Collaborator

Paril commented Feb 10, 2017

If I fire from this position:

http://i.imgur.com/YreHJgt.jpg

I hear no muzzleflash because it's underwater.

@WickedShell
Copy link
Collaborator

WickedShell commented Feb 10, 2017 via email

@jdolan
Copy link
Owner

jdolan commented Feb 13, 2017

The muzzle flash takes places from the projected shot origin, so those are "correct" -- tho I agree that they are problematic with swimming in opaque volumes. That's one fix.

Entity sounds are indeed originated from the entity's origin. For client entities, we could modify this (with some hacks) in Cg_EntityEvent, to project the origin at least upwards, so it comes from the center of their head. I think we have Cg_IsDucking that can help.

@jdolan jdolan added this to the 1.0 release milestone Feb 14, 2017
@kaadmy
Copy link
Collaborator

kaadmy commented Feb 18, 2017

Got an idea for this one, would it be possible to use md3 model tags for the sound origin if enabled?
Maybe have a new flag in s_play_sample_t to control it, S_PLAY_MODEL_TAG or something.
Could use the sound_source model tag by default, and fall back to head if it's not found, and if everything else fails, use the original method of using the entity origin.

@kaadmy
Copy link
Collaborator

kaadmy commented Feb 18, 2017

Which sounds specifically should originate from the player's head? I'd guess all the drown/gurp/falling sounds.

@jdolan
Copy link
Owner

jdolan commented Feb 19, 2017

For clients, everything but the footstep and landing sounds should originate from origin + playerstate->view_offset. Footsteps should originate from origin + mins + vec3_up. The cgame module is probably the right place to handle this logic, so a Cg_ClientSample(cl_entity_t *ent, const char *sample, atten_t atten) or something makes sense. A quick strstr for "footstep" || "land" would branch the function, and then project the sample origin accordingly. Thoughts?

@jdolan
Copy link
Owner

jdolan commented Feb 19, 2017

The other change I think I want to make here, is to update quemap to not divide PHS by opaque liquids. Opaque liquids should be equally hearable with transparent ones. We'll have to re-VIS our maps that have opaque liquids (ugh, Gehenna..), but in this case, I think it's worth it.

@kaadmy
Copy link
Collaborator

kaadmy commented Feb 19, 2017

Can you even get inside any liquids on Gehenna?

@Paril
Copy link
Collaborator Author

Paril commented Feb 19, 2017

Don't strstr to figure out which path to use, use a flag on attenuation or something. Seems incredibly ugly to base it on the filename.

@jdolan
Copy link
Owner

jdolan commented Feb 20, 2017

Yea, attenuation is sent as a byte, and we only have like 4 attenuations, so we could use the high bits for these origin / offset flags.

@kaadmy
Copy link
Collaborator

kaadmy commented May 29, 2017

Will try working on this one, how should the origin offset work for non-players?

@kaadmy
Copy link
Collaborator

kaadmy commented May 29, 2017

Would the upper 4 bits as a signed int with an 8x multiplier for the Z offset from the origin be good enough?
Edit: I'm using a 4x multiplier

@kaadmy
Copy link
Collaborator

kaadmy commented May 29, 2017

Also what maps have waist-deep opaque water to test this?

@Paril
Copy link
Collaborator Author

Paril commented May 29, 2017

None, need to make some in sandbox.

@kaadmy
Copy link
Collaborator

kaadmy commented May 29, 2017

Done, my fixes didn't seem to work
KaadmY cries

@Panjoo
Copy link
Collaborator

Panjoo commented May 29, 2017

There's some waist deep water here in ThePits if you stand on the ramp.

waistdeep

(Btw I've asked Arseflute (Matt) to make a more useful sandbox map as he said he wanted to get refreshed on mapping in general. So I'm not sure if he'll also add waist deep water. JSYK.)

@kaadmy
Copy link
Collaborator

kaadmy commented May 29, 2017

I made a new sandbox map yesterday already that has waist deep clear and opaque water ;)
I was also mainly asking about opaque water since that's what this issue is from.

@Panjoo
Copy link
Collaborator

Panjoo commented May 29, 2017

Okay gotcha!

@jdolan
Copy link
Owner

jdolan commented Sep 29, 2017

@kaadmy can you provide an update on this ticket? Is there still work to be done here for sound origin placement?

@Panjoo in terms of gameplay impact, should we pursue changing our VIS algorithm to not separate PHS for opaque liquids?

@kaadmy
Copy link
Collaborator

kaadmy commented Sep 29, 2017

I think in master I already implemented offsets but they weren't working properly for some reason, so I disabled them. Not sure though.

@jdolan
Copy link
Owner

jdolan commented Nov 9, 2020

This is still a problem. The following fixes should be made:

  • Use Cm_BoxLeafnums to bitwise-OR PHS for all sounds. Entity sounds should use the full entity bounding box for PHS resolution.
  • Per my comment above, opaque liquids should not serve as boundaries for PHS. This will be a quemap change, possibly to portal file authoring, and / or almost definitely to the VIS process itself.

@jdolan
Copy link
Owner

jdolan commented Feb 8, 2021

This is moot now, since we don't have PVS / PHS :)

@jdolan jdolan closed this as completed Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants