Coder Social home page Coder Social logo

jakobkallin / rpg-ambience Goto Github PK

View Code? Open in Web Editor NEW
36.0 36.0 9.0 9.59 MB

Bring your tabletop RPGs to life with sound and visuals.

Home Page: http://rpg-ambience.com

License: GNU General Public License v3.0

JavaScript 87.45% CSS 7.81% HTML 4.74%

rpg-ambience's People

Contributors

jakobkallin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

rpg-ambience's Issues

Automatic overlap durations

If it is possible with the Web Audio API and with a relatively simple algorithm, an option for automatically choosing overlap durations based on audio volume would be useful.

Another deleted adventure can become selected when an adventure is deleted

When an adventure is deleted, the previous adventure in the list is automatically selected. However, it should not do this if the previous adventure is also deleted. Instead, it should select the first adventure earlier in the list that is not also deleted, or create a new adventure if all other adventures are deleted.

Media loading in one adventure can slow down media loading in current adventure

When RPG Ambience is started, all media for the most recently created adventure is automatically loaded. If the user then switches to another adventure, or creates a new one, the loading of media for the previous one continues, which slows down the loading of media for the adventure that is currently being edited. Preferably the current adventure should somehow be given priority.

Incomplete media saving makes adventure data inconsistent

A media item added to a scene is immediately stored in the adventure object, even before the request to add it to IndexedDB has completed. If the application is terminated during this time, the adventure data links to a media ID that is not in the database. This is not a fatal error; it simply generates a request for a non-existing key in the database, causing errors when trying to reference properties of the dataURL variable inside MediaLibrary.load().

Audio fade level is not respected during mixin

The underlying problem is that the visual fade is handled in one location while the audio fade is handled in another. It might be possible to create a single animation object that manipulates the properties of several objects, assuming that used-defined volume levels (such as 40%) are also respected and not scaled from 0 to 100 as the opacity.

Detachable editor

In order to make RPG Ambience more flexible for users with multiple monitors, the application should support detaching the editor into a new tab separate from the stage.

Dropbox integration

The library interface is now sufficiently general that adding support for a new storage service basically involves implementing auth, file selection, file download, and file upload.

There are at least two challenges in adding support for Dropbox:

  • The Dropbox API has no concept of file IDs. The current library interface assumes that every file has a unique ID. This might be simulated by using the file's path, but this would break things when a file is renamed.
  • Using the Dropbox API requires approval from Dropbox. I don't know how much work this requires, and what happens when a new version of the app is released.

Media files cannot be selected or drag-and-dropped

At present, image and sound files can only be used in adventures by specifying their URL or file path. This is due to several factors:

  • <input type="file"> is notoriously difficult to style, making it inflexible to build a user interface around.
  • Selected and drag-and-dropped files can only be referenced by their file data, not their URL or file path. This makes caching difficult, and it vastly increases the size of saved adventure files. The Filesystem API, which can solve these issues, is not widely supported.
  • Basing the user interface on file selection or drag-and-drop makes it more difficult to allow URLs, especially since there is not a native HTML control that allows for selecting both files and URLs.
  • Creating adventure files that link to files using relative paths becomes impossible if only the file data is read. This makes it impossible to store a standalone adventure on a USB stick, unless all the media data can be stored in the adventure file.

Color inputs are not cross-browser

This could be solved by replacing them with dropdowns including the most common choices. For background color, this is acceptable because white and black are the colors that will be used 99% of the time. For text color, however, it's a bit more difficult. Either way, some way will be needed to choose a transparent background color.

Media format support is not explicit

Firefox will fail pretty much silently if given an MP3 file to play. Most users will be surprised by this, so it should be explicitly signaled in some way. This could also be extended to unsupported image formats, providing that there is a programmatic way of determining support in the current browser. Image formats have better support across the board, however, so it's not necessary.

Firefox sometimes gives incorrect duration for audio

The duration is NaN or Infinity, and when the audio starts playing it is continuously equal to the current time, causing crossover to occur all the time. This seems to be an issue related to object URLs, but it's not very clear when the problem arises or why.

Playing scenes in quick succession leaves leftover media

Playing a scene multiple times in very quick succession (by pressing the same key several times, for example) causes the earlier scenes to not stop properly and leaves multiple copies of the same track playing. These tracks can not be stopped in the usual manner and do not even show up in the document.

Opera is not supported

This is because Opera does not support IndexedDB, which makes it impossible to save media using the current system.

Copying scenes does not work in Opera

Copying a scene in Opera only adds a new empty scene. This is due to a for loop over prototypal properties not working as it does in other browsers.

Fading scenes cannot be played in short succession

When a fading scene is started and then faded out, trying to play the scene again right away throws an exception. This is because a state variable in the animation object is not properly set right away when the scene ends. Instead, it is set later when a callback occurs after a timeout.

Scripting

Scripting here refers to sequencing of scenes through some interface, not necessarily with a programming language.

Track removal button is not always visible

This is because text-overflow is difficult to master. Preferably the track name should take up all the space that is not used by the removal button. This should be easier with flexbox but that is not stable or widely supported yet.

Number inputs are not cross-browser

This could be solved by simply falling back to the regular text input. Hopefully, at least Firefox will catch up soon enough. Using polyfills is tedious and should be avoided unless crucial.

Ability to crossfade from scene to scene

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.

Manually uploaded adventures are not downloaded

This is because Google Drive is queried for files with the mime type application/json, and then filtered by extension. The Google Drive API does not appear to allow queries based on file extension. Unfortunately, this means that manually created files will not be downloaded.

Overly broad Google Drive scope

Google Drive integration was adapted from examples in Google's documentation that for some reason use the scope granting full access to the user's Drive. This is despite their documentation in other places pointing out that apps can only access files created or opened with the app itself.

The scope should be changed from https://www.googleapis.com/auth/drive to https://www.googleapis.com/auth/drive.file.

Graphical playback interface

Users who only use audio scenes or have multiple monitors might want to control scene playback visually instead of memorizing keyboard shortcuts. A new "Playback" tab in the user interface would allow for this without affecting the rest of the interface.

Non-looping shuffle is not useful

Setting shuffle to true and repeat to false for a playlist causes it to continue until the last track in the playlist happens to play, which is not very useful. Preferably, it should play each track exactly once but in random order.

IE is not supported

While IE 10 does support IndexedDB, there are some peculiarities that prevent other parts of the code from working. They can probably be fixed after some debugging.

Pressing "Hide Editor" twice hides editor permanently

The "Hide Editor" button is automatically hidden when pressed, but it can be pressed twice by using the keyboard while the hidden button still has focus. Doing so hides the editor permanently, likely because the hide button saves the current editor width, which is 0 when the editor is hidden.

Animations

Although they have received a bad reputation due to being overused in slideshow applications, animations done right can make scenes more immersive. At present, fading scenes in and out is the only supported type of animation.

Cloud storage integration

It should be possible to save adventures to cloud storage services like Dropbox and Google Drive.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.