Opened 3 years ago

Last modified 5 months ago

#5856 new defect

Improving Impact Sounds

Reported by: Stan Owned by:
Priority: Should Have Milestone: Backlog
Component: Core engine Keywords:
Cc: Patch:

Description (last modified by Stan)

Currently no matter whether the projectile actually hits its target or what the target actually is, a generic impact sound is played.

It would be nice if the sound played was different depending on the target nature, and whether it actually hit it or not.

To do so, one needs to do the following.

Move sound handling to MissileHit instead of doing it in UnitAI.

Currently we already know what sound we are gonna be playing when we set the callback for MissileHit. Instead of the sound, we should pass the id of the sending entity (to know what weapon was used) so that we can play different variants, depending on whether we hit the target and what the target is. For that I propose to use classes.

For the Organic class we should have three cases

  • Unit has no armor → "attack_impact_" + type.toLowerCase()+ "_flesh"
  • Unit has metal armor → "attack_impact_" + type.toLowerCase()+ "_metal"
  • Unit was missed → "attack_impact_" + type.toLowerCase()"

We could therefore add a armored class.

For the Structure class we could have two cases

  • Building is hit → "attack_impact_" + type.toLowerCase()+ "_stone"
  • Building was missed → "attack_impact_" + type.toLowerCase()"

For the Ship class we could have two cases

  • Building is hit → "attack_impact_" + type.toLowerCase()+ "_wood"
  • Building was missed → "attack_impact_" + type.toLowerCase()"

Change History (7)

comment:1 by Stan, 3 years ago

Description: modified (diff)

comment:2 by Stan, 3 years ago

Description: modified (diff)

comment:3 by Stan, 3 years ago

In 24582:

Improved arrow impact sounds by @Samulis.

Rename to match conventions, set piority to 80 as per the wiki.

Refs: #5856 Phab:D3113

comment:4 by Stan, 3 years ago

In 24583:

Improved shield impact sounds by @Samulis.

Rename to match conventions, set piority to 80 as per the wiki.

Refs: #5856 Phab:D3113

comment:5 by Stan, 3 years ago

In 24584:

Improved sling impact sounds by @Samulis.

Rename to match conventions, set piority to 80 as per the wiki.

Refs: #5856 Phab:D3113

comment:6 by Stan, 3 years ago

In 24585:

Improved sounds by @Samulis.

Refs: #5856 Phab:D3113

comment:7 by wowgetoffyourcellphone, 5 months ago

This is certainly worth pursuing. Making the sound based on the impacted object instead of the attacking object is how it should be. 

Though, I feel like Structures could have two cases: _stone and _wood. 

Note: See TracTickets for help on using tickets.