Changes between Initial Version and Version 1 of Ticket #1223


Ignore:
Timestamp:
Mar 19, 2012, 1:31:58 AM (12 years ago)
Author:
Kieran P
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1223 – Description

    initial v1  
    33The new sound system needs support for music and sound clips, and should work on both the main menu and ingame. The same system should handle things like background music, button clicks, ambient noise etc.
    44
     5The implementation should be 100% C++ object oriented, but should have JS interfaces so that GUI events can trigger sounds (like button presses).
     6
    57'''Details'''
    68
    7 Terminology: 'stack' (collection of tracks), 'track' (object linked to the 'target' sound to be played)
     9Terminology: 'stack' (collection of 'tracks' on a 'queue'), 'track' (object linked to the 'target' sound to be played)
    810
    9 The sound system should support multiple stacks. A stack can be unlimited in size, or can have a limit. If a limit is set, when a new track is added and the limit of the stack is reached, that track is discarded.
     11The sound system should support multiple named stacks. A new track can be added to any named stack. Stacks are worked through concurrently (multi-threaded?), playing through their tracks in order of first priority, then the order the track was added to the queue.
    1012
    11 Stacks are worked through concurrently (multi-threaded?), playing through their tracks in order of priority. If a track has 'async' set to false, the stack waits until the tracks target finishes playing before it moves to the next track. If the track has 'async' set to true, the target starts playing, and the stack moves right onto the track, without waiting for the previous one to finish.
     13A stack can be unlimited in size, or can have a limit. If a limit is set, when a new track is added and the limit of the stack is reached, the stack simply discards the track that was added. This prevent many async sounds piling up and running all at once (like 100 soldiers moving, which should not create a giant "KA-THUNK" when they move).
    1214
    13 '''TODO:''' Describe priorities, describe fade between tracks, describe gain adjustment on zooming, describe gain adjustment on distance from center screen
     15If a track has 'async' set to false, the stack waits until the tracks target finishes playing before popping the track off the queue and initiating the next track. If the track has 'async' set to true, the target starts playing, the stack pops the track right away, and moves onto the next track, without waiting for the previous one to finish.
     16
     17'''TODO:''' Describe stack clearing, Describe fade between tracks, Describe gain adjustment on zooming, Describe gain adjustment on distance from center screen
    1418
    1519'''Basic JSON representation'''
     
    1721{{{
    1822{
    19   "1": {
    20     "limit": 5,
     23  "unit_actions": {
     24    "limit": 10,
    2125    "tracks": [
    2226      { "target": "chop.wav", "async": true },
    2327      { "target": "mine.wav", "async": true },
    2428      { "target": "chop.wav", "async": true },
     29      { "target": "chop.wav", "async": true },
     30      { "target": "mine.wav", "async": true }
    2531    ]
    2632  },
    27   "2": {
     33  "ambient_noise": {
     34    "limit": 20,
     35    "tracks": [
     36      { "target": "tree_falls.wav", "async": true },
     37      { "target": "fish_splash.wav", "async": true }
     38      { "target": "tree_falls.wav", "async": true },
     39      { "target": "tree_falls.wav", "async": true }
     40    ]
     41  },
     42  "music": {
    2843    "limit": null,
    2944    "tracks": [
    30       { "target": "peace1.wav", "async": false, "priority": 2 },
    31       { "target": "peace2.wav", "async": false, "priority": 2 },
    32       { "target": "war1.wav", "async": false, "priority": 1 }
     45      { "target": "peace1.wav", "async": false, "priority": 2 },  # this would play second
     46      { "target": "peace2.wav", "async": false, "priority": 2 },  # this would play third
     47      { "target": "war1.wav", "async": false, "priority": 1 }      # this would play first
    3348    ]
    3449  }