Opened 11 years ago
Closed 11 years ago
#1944 closed enhancement (fixed)
Add optional attribute to action element for beginning of sound playback
Reported by: | stwf | Owned by: | stwf |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 14 |
Component: | Core engine | Keywords: | |
Cc: | historic_bruno, pureon | Patch: |
Description (last modified by )
This is a feature request from Pureon to support having a sound file that begins at a different time than the action animation.
Here is a copy of the email
1) For siege weapons and probably other units we need a new actor time value that can be set separately from the 'event' trigger (which fires when the weapon's projectile is released). Our attack sound effects currently start on the 'event', but for catapults and some other units the sound effects should start much earlier - for example when the Roman Ballista is being cranked ready to fire, that's when the cranking sound should start.
What we have now is:
<animation event="0.75" load="0.7" file="mechanical/rome_ballista_atttack.dae" name="Melee" speed="150"/>
Which fires the sound and projectile at event="0.75" and the projectile appears on the Ballista at load="0.7"
What we would like to have is something like this:
<animation event="0.75" load="0.7" sound="0.1" file="mechanical/rome_ballista_atttack.dae" name="Melee" speed="150"/>
Here the sound would start to play at sound="0.1" of the catapult cranking + firing animation.
Attachments (1)
Change History (13)
by , 11 years ago
Attachment: | sound_attribute.patch added |
---|
comment:1 by , 11 years ago
Summary: | Add optional attribute to action element for beginning of sound playback → [PATCH REVIEW] Add optional attribute to action element for beginning of sound playback |
---|
comment:2 by , 11 years ago
Milestone: | Backlog → Alpha 14 |
---|
comment:3 by , 11 years ago
Keywords: | patch review added |
---|---|
Summary: | [PATCH REVIEW] Add optional attribute to action element for beginning of sound playback → [PATCH] Add optional attribute to action element for beginning of sound playback |
comment:4 by , 11 years ago
Cc: | added; removed |
---|
comment:5 by , 11 years ago
Component: | Music & Sound FX → Core engine |
---|---|
Description: | modified (diff) |
I tested the patch with the given example of a Roman ballista, it seems to work, but I have some questions, mostly for Pureon:
- Would we need a new sound recorded that combines both the winding and firing actions in a single sound?
- Would that be a pain to synchronize between the animation and the sound, as well as meaning if the catapult can fire faster for some gameplay reason, the sound still won't be synced? (I'm sure this is something we already deal with but maybe not this obvious an example)
follow-up: 7 comment:6 by , 11 years ago
Thanks guys.
My responses to the above questions: 1) The ballista sounds already have the winding and firing actions in a single sound. Our animations also include both winding and firing actions in one file, so having the sound engine support this was needed. 2) I'm not sure about this, but it seems to work for firing animations, so should also work for sounds.
follow-up: 8 comment:7 by , 11 years ago
Replying to Pureon:
2) I'm not sure about this, but it seems to work for firing animations, so should also work for sounds.
I think it actually "stretches" animations to fit into the time required for gameplay. That's easy for animations, I don't know how it could work for sound.
comment:8 by , 11 years ago
Would you be willing to commit the patch despite that? I can't see any way around the desync without stretching sounds, which isn't an option.
comment:9 by , 11 years ago
If it doesn't bother you guys (art dept.), it doesn't bother me :) I just wanted to make sure everyone was aware of possible caveats.
comment:10 by , 11 years ago
Just to confirm, all existing sound effects will still use the 'event' trigger if no 'sound' trigger is added?
I ran the caveat by Michael and he was also fine for the patch to be committed as is.
comment:11 by , 11 years ago
I'm not sure about stretching sounds. But OpenAL may provide a way. I can look into it if this turns out to be a problem.
yes, as it is all existing files will work fine. Behavior is the same unless there is a sound attribute.
comment:12 by , 11 years ago
Keywords: | patch review removed |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Summary: | [PATCH] Add optional attribute to action element for beginning of sound playback → Add optional attribute to action element for beginning of sound playback |
ok this has been applied in r13529
patch file