ihhub / fheroes2

fheroes2 is a recreation of Heroes of Might and Magic II game engine.
https://ihhub.github.io/fheroes2/
GNU General Public License v2.0
2.61k stars 366 forks source link

Spell sounds on high animation speeds #1058

Open Branikolog opened 4 years ago

Branikolog commented 4 years ago

Some sound effects of spells last more, than spell animation itself, when adjusting higher battle animation speed. Causing a mess of sounds and animation. "Holy Shout" spell, for example, has long lasting sound effect, and on high speeds animations, finishes at the time sound is still in process, We've already met same problem with teleport spell. #681 In the OG spell animation seemed not to effect by battle speed adjustment. How do we make up with this issue? Shall we take away dependency of battlespeed and spell animations? Or can we speed up spell animation, till the moment, sound finishes? Or can we speed up sounds of spells together, with spell animation? If we decide to speed up spell animation, we can use two last proposals together.

Branikolog commented 4 years ago

Shall we take away dependency of battlespeed and spell animations?

Sound of some (especially mass) spells is finished long before, animation of spell finishes. It would be nice if we set definite spell duration, so it will be played together with sounds perfectly. I mean sounds should last till the moment, spell animation finishes... (or close to it) But in this case difference in game speed and spell animation will be notably evident, on extremely high or low speeds... Unless we turn off the lowest and the fastest speeds, leaving the adjustment variety of available battle speed presets within two more or less comfortable values.

idshibanov commented 4 years ago

In the OG spell animation seemed not to effect by battle speed adjustment.

You are totally right, most of the spells do not scale with battle speed in OG. My thoughts on this:

  1. Speeding up the sound is not an option as it will sound bad.
  2. We can make the game wait until sound is finished, as in Teleport implementation you linked.
  3. We can turn off speed adjustment, but I personally like it on moderate speeds (3-8 for example) for spells with long animations, like Armageddon or Death wave.

I already looked into this and wrote a small function to get sound duration. We can still scale the spell speed, but make that duration a minimal. This means that at higher speeds there will be less scaling. Downside is that this will be more work since we will have to adjust and test each spell separately.

Branikolog commented 4 years ago

I think at first we should scale spell animation speed to the sound duration. (For the spells, that have long lasting sound) And set it to average/default speed. (4-5 in current adjustments). For each spell individually. And after that we should think of speeding up these spells. It can be a minor speeding up (both sound and animation) till the moment sound of spells is still pleasant to ear. (I suppose it can be max ~1.1x-1.2x acceleration). If we can, let's do the same thing to slow down spell. If not - simply scale spell speed from (6-7) to (8-9) within 1.0 and 1.2 speeds of animation+sound. And leave battlespeed adjustments 1-5 and 9-10 with minimal and maximum speeds, as if we scale spell speed from 1.0 to 1.2 over whole 10 adjustments - difference between two neighboring adjustments will be unessential. My thoughts: spell acceleration would be welcomed by those players, who make speedruns, or play tournaments, where turn time is limited. So they are supposed to play game at fast speeds (like 8-10 in current adjustments), where accelerated spell animation will become most useful. And for normal and slower speeds will be enough default, perfectly timed spell speed.

idshibanov commented 4 years ago

Again, have to disagree on sound. Scaling of sound is a bad idea. Scaling distorts it and will sound like garbage. I also don't see benefit from that.

My thoughts: spell acceleration would be welcomed by those players, who make speedruns, or play tournaments, where turn time is limited.

Speedrunners and such can disable sound and music. Without sound you don't have to wait for it (especially battle start) to end and can scale animation speed linearly as usual.

Branikolog commented 4 years ago

Scaling distorts it and will sound like garbage

I cannot say anything, before I can hear it with my own ears.)

But nevertheless, lets start from making perfect timings for each spell separately, according to the sound, animation and our personal feelings.

ihhub commented 2 years ago

Does the original game modify the speed of sound playback?

Branikolog commented 2 years ago

Hi, @ihhub . In the original game sounds doesn't seem to become faster or slower while hasting or slowing creatures with spells. While passing each cell game initiates sound playback, so when creature is slowed (moving speed on a battlefield slows also) each playback happens with increased gap between each cell sound, which makes feeling of slowed sound, which is not the case.

ihhub commented 2 years ago

In this case I suggest to just close this issue.

Branikolog commented 2 years ago

@ihhub Well, we need another opened issue then, regarding optimizing spell animation and sound duration for each spell. ;)

ihhub commented 2 years ago

... fine, please update the first message and title of this issue.