Author Topic: sciAudio - a new way to put sound in your games!  (Read 7198 times)

0 Members and 1 Guest are viewing this topic.

Offline Collector

Re: sciAudio - a new way to put sound in your games!
« Reply #30 on: August 26, 2014, 04:28:07 PM »
Give me a little time and I'll try to get around to a new version. One other thing, your "captures= ." could cause issues on machines with UAC turned on. This is why the default is in %LocalAppData%\DOSBox. If the game is in a system folder in %ProgramFiles% with UAC on, all of the captures will end up in the VirtualStore. For my own use I have the captures set to the game's folder, too. Sort of makes sense for developers to keep all material for a project together. I could add a method to see if a a game's path includes a system folder or if UAC is turned on and adjust the generated conf entry accordingly.

It might make sense to have two versions. One for game development and one for distribution. It was originally designed to work with Studio's and Companion's run command for development. The needs for game distribution are a bit different. Gumby and I had been working on something that addresses the needs for both as part of a larger project, but that project has been placed indefinitely on the back burner for various reasons.

If I am going to do a rewrite of the run tool, are there any features anyone desires? Any thoughts or ideas are welcome.
KQII Remake Pic

Offline Cloudee1

Re: sciAudio - a new way to put sound in your games!
« Reply #31 on: September 12, 2014, 11:41:31 AM »
Ok, Gumby are you ready for this...

How difficult would it be to base the volume, not only off of the volume passed in the mp3's init statement, but to also incorporate the games current volume setting into that as well. Such that an in game volume of 15 would play the sound at 100% of the volume set in the init statement. So if init is set to 50% and gVolume is set to 15 then the sound would play at 50%. Likewise, lowering gVolume to say 10 via the menubar would then force the same mp3 to play at the same level as if I had entered 33% instead of 50% (.67 * 50) and lowering it to 5 would play the sound at 16% (.33 * 50).

As well, F2, or toggle sound. Any thoughts on how we could go about giving a user the ability to mute or unmute. Even moreso, while a sound is playing.


*Edit
 Actually it appears as though the current in-game volume controls do not actually work. It took me a bit of testing to come to this conclusion but now I am pretty sure of it. In both the pnc template and the parser template, changing the volume has no effect on the games actual volume. Add this code to the init section of any room to see for yourself
Code: [Select]
FormatPrint("volume: %d %d" sndVOLUME gVolume)

Then simply go in the room, exit it and change the volume via menubar and then reenter room. I can't get either of the values to change and they should be changing as the volume is changed... which tells me the volume isn't changing.

Also, closely tied into that I tried to do some basic manipulating of the volume variable in the sciAudio script by adding this to the top of the if <> volume -111 snippet, for testing I figured just using a switch statement would be the easiest to see a result.

Code: [Select]
(if(<> volume -111)
  (switch(sndVOLUME)
   (case 0 = volume 0)
   (case 8 = volume (/ 3 volume)) // until we fix the volume control issue noted above... this is the only case triggered.
   (case 10 = volume (* (/ 3 volume) 2))
   (case 15 = volume (* 1 volume))
  )
...

Unfortunately, the value passed to the command.con didn't come out looking very pretty.
   soundClass noSoundClass
   volume u˝ó?«╦Žamp;▄?^]├╝br />   loopFadeInMillisecs 0000

** Edit 2
Ok I am no closer to any kind of solution, but assuming that someone figures out how to fix the in-game volume control, this line in the sciaudio script I believe makes sense logically, unfortunately it is still no closer to working as this time it sends an empty result to the con file which quickly kills the player.

Code: [Select]
//StrCat(@msgBuf (/ (* gVolume volume) 15))
« Last Edit: September 12, 2014, 03:17:26 PM by Cloudee1 »
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline gumby

Re: sciAudio - a new way to put sound in your games!
« Reply #32 on: September 12, 2014, 03:45:58 PM »
I had this thought at one point as well regarding integrating the volume controls into sciAudio.  I'll take a look at implementing this functionality.

I do remember doing a lot of testing around the playback levels.  I think it works like a percentage, so it's perfectly legitimate to pass in a value like 500, which should play the sound at 500% normal volume.  As I recall, a value of 100 is 100%, so play it at the MP3 normal volume.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Collector

Re: sciAudio - a new way to put sound in your games!
« Reply #33 on: September 12, 2014, 04:29:28 PM »
It would be good to have the sound mute on game close, even if the user simply clicked the close window button rather than quitting the game. I have heard complaints from people about the audio not terminating with the game.
KQII Remake Pic

Offline gumby

Re: sciAudio - a new way to put sound in your games!
« Reply #34 on: September 13, 2014, 05:05:05 PM »
Yeah that's bugged me too when the music keeps playing for 20 to 30 seconds after the DosBox window is closed.  I should just more aggressively check to see if the game is running,  maybe every 5 seconds or so.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Collector

Re: sciAudio - a new way to put sound in your games!
« Reply #35 on: September 13, 2014, 09:29:16 PM »
Or do a task kill from the run utility. I could have it wait for the DOSBox process to exit, then kill the sciAudio process. Not sure if there was some way to pass something on to sciAudio to exit more gracefully? Perhaps have it write to the conductor file to issue an exit command?
KQII Remake Pic

Offline gumby

Re: sciAudio - a new way to put sound in your games!
« Reply #36 on: September 14, 2014, 10:57:52 AM »
We can certainly cause the music to stop if the game is exited 'correctly' (i.e. from the 'Quit' command within the interpreter and wiring in a call to issue a stop command to sciAudio) but I quite frequently kill off DosBox with the 'X'.  So within sciAudio, I have it polling the running tasks maybe once a minute within Windows and if I can't find either 'RUN.EXE', 'DOSBOX.EXE' or 'SCIV.EXE' running, I then kill off the audio playback.  My thought was to just poll more frequently and hopefully that would take care of the issue.

I think also adding in a task kill within the RUN utility would be good too, I'm all for it.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Collector

Re: sciAudio - a new way to put sound in your games!
« Reply #37 on: September 14, 2014, 12:55:46 PM »
We should probably try to cover all of the bases. More frequent polling and having the run utility issue a mute all and possibly a task kill. A mute all would avoid the possibility of killing the wrong instance of sciAudio, in case a user might have two going at the same time for some reason. Otherwise I would have to not only check for the process name, but also to see what the parent process is.

It has been a while, but I believe I had a separate run for the sciAudio, so it would certainly be possible. Cloudee also mentioned a couple of things in another thread that would require a rewrite of the run utility I am going to be redoing it in C#, which will give me a great deal more flexibility. I guess it is time to do a proper implementation.
KQII Remake Pic

Offline Collector

Re: sciAudio - a new way to put sound in your games!
« Reply #38 on: September 19, 2014, 02:40:37 PM »
I thought that I would try to get started this weekend. The approach that I was going to take was to make the run tool remain running in the background to wait for the DOSBox process to end, then issue a command via the COMMAND.CON file to cause sciAudio to mute all. Then it occurred to me that it might be better if sciAudio simply had an exit command that the run tool could write to the COMMAND.CON.
KQII Remake Pic

Offline Collector

Re: sciAudio - a new way to put sound in your games!
« Reply #39 on: September 20, 2014, 12:12:31 AM »
OK, the new run tool is now adds:

Code: [Select]
(sciAudio
   exit
)

to the end of the COMMAND.CON file when DOSBox is closed by the window exit button. If sciAudio changed to close when the game is normally exited AND accepts the above code to exit, it should take care of the trailing audio on exit. The game exit could close sciAudio with the same command.

What I am thinking is to have two different config tools. One for the developer and one for distribution of the game. The development one will have a few extra options that can be set, such as backup, being able to run a debug version of DOSBox, etc.
KQII Remake Pic

Offline gumby

Re: sciAudio - a new way to put sound in your games!
« Reply #40 on: September 20, 2014, 11:33:05 AM »
Yes, I can make those modifications to sciAudio.  Not sure when, but I'll get to it.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Collector

Re: sciAudio - a new way to put sound in your games!
« Reply #41 on: September 20, 2014, 01:18:46 PM »
Here is the beginning of the new config tool for the developers. Two tabs. Any suggestions for additional features? I still have to decide how I am going to pass information between the run utility and the config utility since they are stand alone apps. It would work out great if I could force them to use the same .NET config XML settings file.
KQII Remake Pic

Offline Cloudee1

Re: sciAudio - a new way to put sound in your games!
« Reply #42 on: September 20, 2014, 01:30:31 PM »
small window resolution 640x400  ;)
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline Collector

Re: sciAudio - a new way to put sound in your games!
« Reply #43 on: September 20, 2014, 11:12:49 PM »
Already done. Those label are dynamic. If you deselect aspect correction, the labels will reflect it.

Just spent the day adding in a CTRL+Click on each control that will open a browser that load the DOSBox Wiki entry for that setting for more info. That was a lot f busy work that got old very fast. I still need to track down the right URL to add for each control.
KQII Remake Pic

Offline Collector

Re: sciAudio - a new way to put sound in your games!
« Reply #44 on: September 23, 2014, 06:01:21 PM »
The new run is mostly finished. I am waiting to know exactly what to hook into sciAudio. I managed to get the two apps to share the same XML config file, so setting from the config tool can be used but the run tool. So now, if you set it to not backup the game's resources on run from the config tool, the run tool will not.

On another note, while testing switching of sciAudio and the backup feature, I had started 120 Below from the new run, but closed the window before clicking past the first credit screen. sciAudio crashed before it had played the first sound. I have attached the crash logs, but I suspect that if it is changed to exit properly on DOSBox close, it would prevent  the crash. The run did write to the COMMAND.CON, so could it be a sharing violation?
KQII Remake Pic


SMF 2.0.11 | SMF © 2015, Simple Machines
Simple Audio Video Embedder

Page created in 0.126 seconds with 22 queries.