Closed Toma400 closed 2 years ago
I feel like the most coherent implementation of that should make separate .jsons/folders (not bounding this to location file itself), which would contain location id and sound files listed. Each of these could be then appended to location (as a list) and then run randomly. Of course checking of files existence is required.
The only issue I see here is that each location would need to either scan all files, or contain some sort of cache files (though cache files would limit further additions, so these should be deleted after the run). Some ideas on how to handle both broad support (even for vanilla ones) and not run out of RAM is needed here.
Of course, settings would need to have 1) music being turnable on/off and 2) music volume being adjustable (if possible)
We can depend on playsound
module (GitHub), but if so, we will need to keep track of features I asked for, since without them, the module is not really functional, at least not to extent I want it to.
Final idea, I feel, quite good for both "vanilla-appending" and "modded" approaches.
Locations, being separated folders, would have their subfolders which, if existing, would be scanned. These would be default soundtrack, so like location/sounds
folder.
Location file (general) would also have pool which would add another sounds in a list, preferably with value #default
to indicate counting folder mentioned above.
So - if you want to change sounds for the location - change location file and redirections. If you want to append new sounds to existing locations - add new sounds to respective folders.
I assume at the beginning of location, only files put on that "list of counted files" would be scanned, therefore not running out of RAM. Scan would make either:
I guess approach 1. is more valuable overall
Due to issues in f416a63, suggested are two other modules:
playsound
expansionThis may be reviewed and added in Pre-Alpha 3, since all graphical libraries support music in one way or another, so we won't be limited to poor sound libraries and trying to make them work within terminal.
Finished with 4b3b9b5.
Music playing in the background or during events. It could be also supported via some sort of code or .jsons, like worldpacks could have selected some vanilla/modded music playing during playing in specific location.
Idea is especially awesome as it would add some immersivity to the game, while preserving its no-graphical feel. Therefore it could make most of atmosphere from text and music playing alongside.
>> Related Overstackflow Topic <<