Adding sound and music to my game

  • #1, by aaron-gwynaireSunday, 31. March 2019, 15:55 A year ago
    Hey guys
    I have been using Visionaire Studio 5 since early Feb this year and have put together a test build of my Myst point-and-click adventure puzzle game Neyyah. The only element I need to add to it is sound and music.

    I can't seem to find any tutorials on how to implement or work with sound in VS 5.

    Can anyone direct me to any tutorials or information? 

    I understand that VS 5 also provides a new mixer system which has improved the variability of using various sound sources / music in the game engine.

    All sounds exciting, and could explore it all myself and work out what I need, though time is spent more on modelling the rest of the game, recording the sounds for the test build etc so any speed-ups in the process will be great and also making sure to make the best of the engine too!

    Thanks guys smile 

    Newbie

    4 Posts


  • #2, by caligarimarteSunday, 31. March 2019, 23:06 A year ago
    Normally, you can just set the Music for a Scene in the Scene's Properties -- there is the Option to just continue the Music from a previous Scene, but keep in Mind that that means the Scene itself technically would be saved without Music, and if a Player loads a Savegame in a Scene that continues the last Scene's Music, the loaded Scene would have no Music at all, as far as I am aware, so better consider adding the same Music to all the multiple Scenes/Screens of an Area that should have the same Music playing (like, giving the same Music to all Screens on the Boiler-Island, if the whole Island should have the same Music).
    Alternatively you can also set Music via Actionparts, for Example have an Actionpart executed at the Beginning of a Scene that plays a particular Music -- that Way, you could e.g. check for certain Conditions to be fulfilled to change what Music should be playing, or you can change the Music in a Scene after a particular Riddle has been solved or so.

    I am afraid I have no Experience with the new Audiomixing-Features, and do not know any Tutorials on the Topic either, but I hope that was a good Starting Point for you. smile (I can't wait to hear the first Tracks, I really enjoy following your Project.)

    Forum Fan

    145 Posts

  • #3, by aaron-gwynaireMonday, 01. April 2019, 05:57 A year ago
    Hey. Thanks for that input smile i am very much looking forward to implementing this different aspect of the game (feels to me the sound and music is almost a complete world of its own when dealing with the development smile). Another aspect I need to look at is the sounds playing over animation sequences - eg portal descending and switching on, the shutter door opening etc. As well as continuous music there will also be continuous sounds from one scene to the other such as wind or ocean sounds. Its going to be interesting putting it all together. 
    Glad you are liking the project. Are you following Neyyah on the fb site www.facebook.com/DefyRealityEntertainment?  smile

    Newbie

    4 Posts

  • #4, by caligarimarteMonday, 01. April 2019, 18:08 A year ago
    "sounds playing over animation sequences - eg portal descending and switching on, the shutter door opening etc." 

    That should be no Problem, you can just use the Actionpart "Play sound" right before playing your Animation or in an Action on an Animationframe instead. And if your are using In-Scene-Videos for your Animations (with which I have no Experience though so far), placing the "Play sound"-Actionpart right before the Video should also work, and Videos can be set to continue the currently playing Sounds as well. (I guess the Sounds could be Part of the Video-File, but maybe that would allow for less Control or so.)
    (EDIT: Ah yes, I just saw you are working ony an Animation-Video with the Sound.)

    "there will also be continuous sounds from one scene to the other such as wind or ocean sounds."

    Now, that is a Bit more of a Problem. By Default, Visionaire does not have that as a Feature, but you can use two simple Lines of Lua (an older Prototype of mine, never actually used it myself so far) to get it done.

    (EDIT: The Following Solution only works if the Scene-Change is immediate, if there is no Fade-Effect set! If the Transition is set to directly fading to the next Scene (or Shift, I suppose), the Solution is not necessary at all, but with the Default-Fade it won't work at all. I might have to try and find a Fix for that.)

    At the Beginning of a Scene:
    Sound_Offset = getSoundProperty(SndCnt_Test, "offset")
    1

    At the End of a Scene:
    SndCnt_Test = startSound("vispath:INSERTYOURFILEPATH.ogg", {flags=1, offset=Sound_Offset, loop=true})
    1

    Execute these two Scripts as shown in my Screenshots below, add these Actions to all the Scenes that should have one particular Sound playing, and the Sound will continue from the previous Scene once you enter a new one.

    (Well, technically not "continue", but it will remember the Offset/Position of how far the Sound has been playing and continue from there on -- I have just tested this with two Scenes and have not had any Problems, it sounds like the Sound is just continuing.)

    (EDIT: I should note, where it says "INSERTYOURFILEPATH", you must insert the Filepath relative to your Project-File -- so, if you have a Folder-Structure like "C://Neyyah/sounds/sound01.ogg" where the Project-File is inside the "Neyyah"-Folder, the String in the Code must be "vispath:sounds/sound01.ogg" -- the "vispath:" must stay.)

    (On a Sidenote unrelated to this but to the Topic of Music, I forgot to mention that there is also an Action Part specifically for changing the currently playing Background-Music, so maybe that might also come in handy at some Point, if you ever need to change the Music due to an Event.)

    "feels to me the sound and music is almost a complete world of its own when dealing with the development [...] Glad you are liking the project. Are you following Neyyah on the fb site[?]"

    Yes, I am following the Project on Facebook (Christopher Summer) primarily because I'm a pretty big Riven-Fan -- I only follow with silent Likes, but after I saw that you are starting to record Sounds and intend to create the Music by yourself as well, I have started to think I really should comment for once or pm you just to say how much I appreciate it when someone creates pretty much everything for his Project by himself (well, I never wrote that on FB, so I am doing it here).
    I have the same Philosophy (basically) and do the same with my own Project(s) -- I think that an Artist should try and create as much as he can by himself... especially if developing Sounds and Music (for this Game at Least) are "a complete world of its own" -- thumbs up for venturing into stranger Territories (like having to deal with Lua-Code, to get back on topic).

    So, I hope these two Lines of Lua-Code will help you with the continuous Sound. smile
    (I once prototyped them for the Developer behind "Noon's Journey - The Tideshell Keeper", but I'm afraid she left Visionaire before she could get the Code to work. I hope you have more Luck with it. smile )

    Forum Fan

    145 Posts

Write post