Ability to crossfade from scene to scene #38

Closed
gene1wood opened this Issue Feb 15, 2013 · 10 comments

Comments

Projects
None yet
2 participants
@gene1wood

I haven't figured out how to do this but I may have just misunderstood.

I want to be able to have the audio from scene to scene crossfade from one to the next. I've found a way to get this working but it's clunky, I'm wondering if there's a way to improve this.

Assumptions :

  • With "Fade" set to say 5 seconds and to "In and Out", you can effectively crossfade from a background to foreground scene or from a foreground to background scene by clicking "Stop" and then immediately typing the hotkey of the scene you're going to. This fades out the existing scene and fades in the new scene.
  • This "Stop" "Start" trick won't work from background to background scene or from foreground to foreground scene.
  • If you try this method going from a foreground to foreground or background to background scene, you hit Stop and the old scene begins to fade out but as soon as you hit start on the new scene, the old scene stops completely mid-fade-out

The result of my work around is that I maintain two copies of every scene, one as a foreground and one as a background. This way I can fade between any two scenes by picking the opposite type (foreground for background, background for foreground).

Is there a way to be able to fluidly crossfade from any scene to any other scene?

My use case is that I'm establishing scenes based on theme/emotion of a scene. I've got

  • exploration
  • combat
  • dread
  • town
  • sorrow
    etc.

Ideally I'd like to be able to setup these scenes (only once, not having 2 copies of each), and just hit a single hotkey to crossfade from one to the next. I'd like to also retain the cool functionality of using background for music and foreground for things like the dragon roar in your example. This would mean being able to crossfade from background to background and then play over the background a foreground sound effect.

@JakobKallin

This comment has been minimized.

Show comment
Hide comment
@JakobKallin

JakobKallin Feb 16, 2013

Owner

You have understood it correctly: there is no built-in way to crossfade between scenes. Playback at the moment is very simple: first the current scene is stopped immediately (even if it's fading out), then the next scene is started. Adding support for crossfading scenes would require this mechanic to become more complex, since two scenes would be playing on the same layer at once. I also don't know at the moment how this functionality could be added to the interface in a simple way, especially in relation to the existing fade functionality.

It can also cause edge cases where the proper behavior is difficult to specify: if a crossfading scene is started while another one is already crossfading in, are all three played simultaneously? Although those problems can probably be solved with some effort, I'm wary of introducing these sorts of cases unless the benefit is considerable.

At this point it's not a prioritized feature, but I would still appreciate suggestions on how it should work and how it could be added to the interface.

Owner

JakobKallin commented Feb 16, 2013

You have understood it correctly: there is no built-in way to crossfade between scenes. Playback at the moment is very simple: first the current scene is stopped immediately (even if it's fading out), then the next scene is started. Adding support for crossfading scenes would require this mechanic to become more complex, since two scenes would be playing on the same layer at once. I also don't know at the moment how this functionality could be added to the interface in a simple way, especially in relation to the existing fade functionality.

It can also cause edge cases where the proper behavior is difficult to specify: if a crossfading scene is started while another one is already crossfading in, are all three played simultaneously? Although those problems can probably be solved with some effort, I'm wary of introducing these sorts of cases unless the benefit is considerable.

At this point it's not a prioritized feature, but I would still appreciate suggestions on how it should work and how it could be added to the interface.

@JakobKallin

This comment has been minimized.

Show comment
Hide comment
@JakobKallin

JakobKallin Jul 13, 2013

Owner

I've been thinking some more about this, and I believe it's possible to add seamlessly to the application. Right now, a scene with fading stops any currently playing scene and then fades in. Instead of stopping the old scene, it could fade the old scene out at the same speed as the new scene fades in. To keep it simple, the number of scenes fading at the same time should probably be limited to two, in order to prevent strange edge cases. This would require some changes to the underlying Ambience Stage library, but I think the current interface and adventure files could stay the same.

Owner

JakobKallin commented Jul 13, 2013

I've been thinking some more about this, and I believe it's possible to add seamlessly to the application. Right now, a scene with fading stops any currently playing scene and then fades in. Instead of stopping the old scene, it could fade the old scene out at the same speed as the new scene fades in. To keep it simple, the number of scenes fading at the same time should probably be limited to two, in order to prevent strange edge cases. This would require some changes to the underlying Ambience Stage library, but I think the current interface and adventure files could stay the same.

@gene1wood

This comment has been minimized.

Show comment
Hide comment
@gene1wood

gene1wood Jul 15, 2013

That would be awesome. I've not found a solution so far and have just reverted to playing music which isn't bound to the action in the game for a lack of tools. I tried modifying the code to get what I was looking for but wasn't able to figure out a solution. Thanks for looking at this Jakob

That would be awesome. I've not found a solution so far and have just reverted to playing music which isn't bound to the action in the game for a lack of tools. I tried modifying the code to get what I was looking for but wasn't able to figure out a solution. Thanks for looking at this Jakob

@JakobKallin

This comment has been minimized.

Show comment
Hide comment
@JakobKallin

JakobKallin Jul 15, 2013

Owner

I believe that I have come up with a design that can offer this feature with just a few changes. I will let you know how it goes and hopefully have a version for you to try out within a few days.

Out of curiosity, do your scenes consist of sound and images or just sound?

Owner

JakobKallin commented Jul 15, 2013

I believe that I have come up with a design that can offer this feature with just a few changes. I will let you know how it goes and hopefully have a version for you to try out within a few days.

Out of curiosity, do your scenes consist of sound and images or just sound?

@gene1wood

This comment has been minimized.

Show comment
Hide comment
@gene1wood

gene1wood Jul 15, 2013

I just use the tool for audio. Audio needs tight coupling to action in the game. Dramatic music starting before the party encounters a bad guy, or after they're encountered him doesn't work.

However, imagery, I find, doesn't need as tight of coupling. If the party encounters some new character and while I'm describing the scene and the new character I rummage around and find the image file and bring it up on the screen for the party, this doesn't seem to be a problem. It also allows me to be more flexible/improvisational.

Since I'm not binding audio to a specific encounter in the game, but instead to a theme/vibe which might occur in any encounter it requires less up front commitment to a game sequence.

I just use the tool for audio. Audio needs tight coupling to action in the game. Dramatic music starting before the party encounters a bad guy, or after they're encountered him doesn't work.

However, imagery, I find, doesn't need as tight of coupling. If the party encounters some new character and while I'm describing the scene and the new character I rummage around and find the image file and bring it up on the screen for the party, this doesn't seem to be a problem. It also allows me to be more flexible/improvisational.

Since I'm not binding audio to a specific encounter in the game, but instead to a theme/vibe which might occur in any encounter it requires less up front commitment to a game sequence.

@JakobKallin

This comment has been minimized.

Show comment
Hide comment
@JakobKallin

JakobKallin Jul 16, 2013

Owner

I have implemented an experimental version of the feature that you requested. Since I'm not releasing a new version of RPG Ambience just yet, I have put it in a separate unstable part of the website. Let me know what you think!

(Don't mind the warning that pops up when you open the application - this new feature doesn't affect your adventure files; I'm simply putting it there for the future. It's also possible that you will have to explicitly refresh the page in order for the app to load properly.)

Note that all you need to do now in order to crossfade between two scenes is to start a scene with fading while another scene is playing; no need to manually stop the first scene before starting the second scene.

The crossfading feature currently leaves a DOM element behind every time a new scene is started, but this shouldn't affect anything unless you start a very large number of scenes.

Owner

JakobKallin commented Jul 16, 2013

I have implemented an experimental version of the feature that you requested. Since I'm not releasing a new version of RPG Ambience just yet, I have put it in a separate unstable part of the website. Let me know what you think!

(Don't mind the warning that pops up when you open the application - this new feature doesn't affect your adventure files; I'm simply putting it there for the future. It's also possible that you will have to explicitly refresh the page in order for the app to load properly.)

Note that all you need to do now in order to crossfade between two scenes is to start a scene with fading while another scene is playing; no need to manually stop the first scene before starting the second scene.

The crossfading feature currently leaves a DOM element behind every time a new scene is started, but this shouldn't affect anything unless you start a very large number of scenes.

@JakobKallin

This comment has been minimized.

Show comment
Hide comment
@JakobKallin

JakobKallin Jul 17, 2013

Owner

I should also mention that this experimental feature currently breaks the foreground/background feature: If you start a foreground scene, you won't be able stop any background scenes that are running, even after stopping the foreground scene.

Owner

JakobKallin commented Jul 17, 2013

I should also mention that this experimental feature currently breaks the foreground/background feature: If you start a foreground scene, you won't be able stop any background scenes that are running, even after stopping the foreground scene.

@JakobKallin

This comment has been minimized.

Show comment
Hide comment
@JakobKallin

JakobKallin Jul 29, 2013

Owner

When you've had a chance to try this out, I would love to hear how it's working out for you.

The issues that I mentioned above have now been fixed in the development branch, which will be published soon, so I'm closing this for now (but you can still use the same thread to leave feedback about the feature).

Owner

JakobKallin commented Jul 29, 2013

When you've had a chance to try this out, I would love to hear how it's working out for you.

The issues that I mentioned above have now been fixed in the development branch, which will be published soon, so I'm closing this for now (but you can still use the same thread to leave feedback about the feature).

@JakobKallin

This comment has been minimized.

Show comment
Hide comment
@JakobKallin

JakobKallin Jul 30, 2013

Owner

The new version of RPG Ambience, which includes crossfading without the bugs mentioned above, has now been released. Go to the site in order to use it. (The version available under /unstable/ is now an old version.)

Owner

JakobKallin commented Jul 30, 2013

The new version of RPG Ambience, which includes crossfading without the bugs mentioned above, has now been released. Go to the site in order to use it. (The version available under /unstable/ is now an old version.)

@gene1wood

This comment has been minimized.

Show comment
Hide comment
@gene1wood

gene1wood Aug 6, 2013

I tried it out last week and it works fantastically! Thank you so much for adding this!

I tried it out last week and it works fantastically! Thank you so much for adding this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment