AGS 3.2 Final 5 - Recession-busting edition

Started by Pumaman, Sun 03/05/2009 15:34:47

Previous topic - Next topic

Dualnames

Quote from: Leon on Tue 09/06/2009 08:35:15
Quote from: Dualnames on Mon 08/06/2009 23:53:34
Woohoo you fixed the translation thingy. Downloading..


Does that mean that I can stop digging for this bizarre bug?

Yep. For now. I'll test and tell ya.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Adamski

I've been playing around with the new audio functions in my lunchbreak and the possibilities are very exciting. I'll have a play around further in the evening but I think it'll be possible to have transition cues and crossfading that's synced to the tempo of your music, so you could actually do something as complex as Woodtick from Monkey Island 2 but with streamed audio!

One question though Ceej, how large is the buffer in samples for music and streamed audio? There's going to be some lag compensation necessary I think on the scripting side, and if the time it takes to buffer music tracks is known then it'll make this a lot easier!

Cheers,
Adam

Trent R

Quote from: DavidCB on Tue 09/06/2009 09:10:09Oh, what a mistake!  :o I saved my piece of  adv. in the version 3.2 beta 1 with no copies and now I won't open in the 3.2 beta 2.  :P
Is there any way back?  :'(
Well David, your best bet is to export things that can be (Guis, Chars, Sprites, etc) and copy-pasting scripts. Note also that you directly import the rooms from the old game (just find the .crm files)

Another way, would possibly be to text-edit the .agf file, but this could turn out buggy so I'd suggest just building it up like above.


~Trent
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

Pumaman

#63
QuoteWill you be making it so that when the final version is released it will automatically convert the obselete lines of code in the audio system to the new.  This would make life a lot easier.

This isn't something I had planned on doing. The old lines of code like PlaySound should still continue to work as long as you leave the sound and music audio clips with their default names like "aMusic1" and "aSound5", and don't change the configuration of the Audio Types.

Quoteeven if it means checking to see if the room has a music file set to play on load and changes that out for an audio call to the music file in the room load script

This is probably worth doing, especially as the Play Music On Load number is no longer visible -- it should at least pop up a warning and tell you.

QuoteOh I see, thanks for this info. Then I'd better play a silent ogg and use it as a timer

Well, if you have this problem when the game starts up maybe you could just use a Wait(100) at the start of the game before playing any audio, to let your PC catch up with whatever it's doing?

QuoteOh, what a mistake!   I saved my piece of  adv. in the version 3.2 beta 1 with no copies and now I won't open in the 3.2 beta 2.  
Is there any way back?

It is possible for me to revert this, if you upload the Game.agf file and send me a link to it I can repair it for you.

Or if you want to try and fix it yourself, MAKE A BACKUP COPY OF IT, then open the Game.agf in Notepad and:
Find the <AudioClips> section and delete everything between <AudioClips> and </AudioClips> including those two lines themselves.
Then, go back to the top of the file, find this: VersionIndex="5" and change the 5 to 4.
Be very careful if you do that though, you can easily accidentally corrupt your game by editing the file manually.

QuoteDoes Beta 2 remove the 1 music channel limit from Beta 1? Lots of music channels would be extremely useful!

Yes, the limit is now configurable in the Audio Types section. It is still 1 for Music by default, because most people will expect a PlayMusic command to change the playing music rather than starting a second simultaneous one.

QuoteWhen switching quickly through different ogg music tunes in the properties pane AGS crashed.  I was basically playing one and then switching to the next on the list, etc.  It might have something to do with trying to play one music track over the other.

What was the error message? Did you Send Error Report? The server isn't showing any error reports submitted with this beta...

QuoteOne question though Ceej, how large is the buffer in samples for music and streamed audio? There's going to be some lag compensation necessary I think on the scripting side, and if the time it takes to buffer music tracks is known then it'll make this a lot easier!

The buffer size depends on the audio type (I think it's 16 KB for OGG, for example) so it depends on the frequency of the audio file as to how many milliseconds of sound is buffered. For beta 2, I updated the PositionMs property on OGG audio to interrogate the buffer and return a more accurate position, whereas in beta 1 it was returning a position rounded to the nearest buffer size.



Now, one thing I'm not sure how to implement with the new audio system is crossfading. In previous versions of AGS, there was a special hidden audio channel (channel -1) that was used to play the track that was fading out. However, with the new multi-channel system you might have any number of audio clips crossfading across each other (which you could of course now implement manually) so I need to think further about how to provide an easy-to-use default implementation like the one in previous versions.

Shane 'ProgZmax' Stevens

#64
AGS just stopped responding or I would have given you an error message.  I had to end the process because it stalled.

Something else:  I can't seem to figure this out, but all my old songs that were set to play in specific rooms still play but there is no script in the room file (whatever.Play) and of course the room music setting is now gone.  Even more interesting, when I try playing a new song with MaxChannels set to 1 it plays over the existing room music rather than stopping it, so I'm guessing there's some Legacy PlayMusic code still running?

To fix this I might just recopy the game again, go through the rooms and set the music property in each one to 0 before importing, but I thought it was worth mentioning.


Edit:  There's a small issue with the Speech/Audio/Sound folder file numbering.  Instead of going from 1-10 and up it goes 0,1,10-19,2,20-29,3 and so on.  Not a big deal, really.

Edit2:  I think the problem with the music playing wasn't a result of the room music setting but the PlayMusic funtion.  It seems to play on a separate channel from the new music.Play command so all my old calls to it still work (but playing a new tune just plays over the old).  Perhaps you could do a a quick code update for the PlayMusic(x) calls to amusicx.Play() (as well as room music calls)?

Edit3:  When you do implement crossfading, could it be a a pull-down property option under the Music/Sound setting and each individual music/sound file?  That would allow people to quickly set crossfade for all music as well as tweak individual tunes that they might not want handled in that way or at a certain crossfade speed.

Adamski

QuoteThe buffer size depends on the audio type (I think it's 16 KB for OGG, for example) so it depends on the frequency of the audio file as to how many milliseconds of sound is buffered. For beta 2, I updated the PositionMs property on OGG audio to interrogate the buffer and return a more accurate position, whereas in beta 1 it was returning a position rounded to the nearest buffer size.

Aha, this would explain a lot!

There still seems to be a large amount of inaccuracy when seeking in a streaming channel that's currently playing. If I do the following:

Code: ags
track1 = aMusic1.Play();


...and then any time later in the script/game:

Code: ags
track2 = aMusic2.PlayFrom(track1.PositionMs);


...then track2 will sync to track1's position exactly (which is what we want!). However if do the following.

Code: ags
track1 = aMusic1.Play();
track2 = aMusic2.Play();

...and then any time later in the script/game:

Code: ags
track2.Seek(track1.PositionMs)


...track2 is out of sync with track 1 by a very large number of milliseconds (250 at the very least!).

I'm not sure if this is a bug or something else, but it's not a HUGE problem as I think that every case where I'll need to sync tracks together I'll always use the PlayFrom command... but it's there for your information anyway :)


monkey0506

#66
Here's a minor one. Just downloaded 3.2 for the first time since I don't really have any projects going on with the audio functions right now, so I started up a new project. On compilation I got an error that:

Quote from: The error messageUnexpected error: Could not find a part of the path 'F:\AGS\Projects\AudioTest\Music'.

I actually had to create this folder manually in Windows to compile my new project (Default Template). If the folder doesn't exist...wouldn't it be more logical just to create it? Especially considering this is a new project! 8)

Other than that, took a look through the manual at the new audio script functions. Looks good so far...

Edit: Also, forgive me if I'm being daft here but where is System.AudioChannelCount set at? I double checked and it's not in the System Limits page so I assume it's set somewhere in the editor? But I can't seem to find it....

I do now see that each of the audio types has a MaxChannels setting in their respective properties pane, so would System.AudioChannelCount be the summation of those? How then would it total "unlimited" channels? Further, is there a way to check the maximum channels available to a specific audio type?

DavidCB


abstauber

#68
QuoteOh I see, thanks for this info. Then I'd better play a silent ogg and use it as a timer

Well, if you have this problem when the game starts up maybe you could just use a Wait(100) at the start of the game before playing any audio, to let your PC catch up with whatever it's doing?

I'm afraid, my cheesy celeron does its workout (or whatever) on an irregular base.
But my main issue is, that during the stuttering, my manual counter of msecs stops, whereas audioChannel.PositionMs advances.

Here's apost, where I've tried to describe my problem:
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=37985.msg499409#msg499409

Dualnames

First of all with the translation all done and set. Thanks a lot :D

Secondly a small problem..:
I don't really mind about it, (meaning its not vital), but well, there's a 1kb speech vox file being created every time I compile the game.

1. I have no files in my speech folder
2. I used auto-remove all number lines from speech lines. But the 1kb vox was still there.
3. I'm using the latest STABLE AGS Version (3.1.2)
4. I created a translation so I could search what lines have '&' to them.
And those are:

Code: ags


&5 Sorry, not now.

&6 Restore

&7 Cancel

&8 Select a game to restore:

&9 Save

&10 Type a name to save as:

&11 Replace

&12 The save directory is full. You must replace an existing game:

&13 Replace:

&14 With:

&15 Quit

&16 Play

&17 Are you sure you want to quit?

&18 You are carrying nothing.

&19 Talking to yourself is a sign of madness!

&20 You rub your hands up and down your clothes.

&21 Damn, I'm looking good!



Those lines are AGS default things..So I can't edit them.


Sorry if I'm being too picky about this..
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

JpSoft

You have the solution here

I had this same trouble and i solved it.

Jp

Trent R

@Jp: Hahaha, you linked a thread where I quoted Dualnames from this very thread!

@CJ: Woohoo-Curry! DLing now.

@Dave: Glad to help, but did you see Pumaman's reply to your question? It's smack in the middle of his big post above.


~Trent
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

Pumaman

QuoteAGS just stopped responding or I would have given you an error message.  I had to end the process because it stalled.

Hmm, that's a bit worrying. Let me know if it happens again.

QuoteI can't seem to figure this out, but all my old songs that were set to play in specific rooms still play but there is no script in the room file (whatever.Play) and of course the room music setting is now gone.  Even more interesting, when I try playing a new song with MaxChannels set to 1 it plays over the existing room music rather than stopping it, so I'm guessing there's some Legacy PlayMusic code still running?

Yes, the old "Play Music On Room Load" setting is still there, it's just hidden. This is why I was saying I really need to add something to the editor to automatically convert this into a script line when you load the room.

QuoteThere's a small issue with the Speech/Audio/Sound folder file numbering.  Instead of going from 1-10 and up it goes 0,1,10-19,2,20-29,3 and so on.  Not a big deal, really.

Well, these are only default names for the files that have been imported from the old version. Ideally you'll rename them to have proper names like "aExplosion" so there won't be a huge list of numbered names.

QuoteEdit2:  I think the problem with the music playing wasn't a result of the room music setting but the PlayMusic funtion.  It seems to play on a separate channel from the new music.Play command so all my old calls to it still work (but playing a new tune just plays over the old).  Perhaps you could do a a quick code update for the PlayMusic(x) calls to amusicx.Play() (as well as room music calls)?

Are you saying that a tune played with aMusic5.Play() plays simultaneously with a PlayMusic(5) command? Have you changed any of the default Audio Types?

QuoteEdit3:  When you do implement crossfading, could it be a a pull-down property option under the Music/Sound setting and each individual music/sound file?  That would allow people to quickly set crossfade for all music as well as tweak individual tunes that they might not want handled in that way or at a certain crossfade speed.

Well the problem is that cross-fading requires an extra audio channel (since it is basically just playing two sounds at the same time), so if cross-fading was allowed for everything, it would mean you could only have 4 audio channels since the other 4 might be needed to crossfade them ... this is where the difficulty lies.

Quote
track2 = aMusic2.PlayFrom(track1.PositionMs);

...then track2 will sync to track1's position exactly (which is what we want!). However if do the following.

track2.Seek(track1.PositionMs)

...track2 is out of sync with track 1 by a very large number of milliseconds (250 at the very least!).

Interesting thanks, I'll look into it. It's probably finishing playing the current buffered data before seeking to the new position, I'll see if I can fix it.

QuoteOn compilation I got an error that:
Unexpected error: Could not find a part of the path 'F:\AGS\Projects\AudioTest\Music'.

Thanks for reporting this. You shouldn't need to have a Music folder any more, so I'll get that fixed.

QuoteEdit: Also, forgive me if I'm being daft here but where is System.AudioChannelCount set at?

Currently it is always 8. The "unlimited" channels with the audio types simply means that there is no specific limit on the number of channels that audio type can use, and it can use any remaining ones available within the overall 8.

QuoteFurther, is there a way to check the maximum channels available to a specific audio type?

In the editor, this is set on the Audio Type. There's currently no script method to access the setting, if that's what you mean?

QuoteI'm afraid, my cheesy celeron does its workout (or whatever) on an irregular base.
But my main issue is, that during the stuttering, my manual counter of msecs stops, whereas audioChannel.PositionMs advances.

Yes, as I said, this is to be expected because the sound card has its own buffer which will continue to play if your CPU is locked up. Unfortunately there's not much that can be done about it (other than figuring out why your PC keeps locking up!)

QuoteSecondly a small problem..:
I don't really mind about it, (meaning its not vital), but well, there's a 1kb speech vox file being created every time I compile the game.

Are you sure you don't have a syncdata.dat file lying around in the game folder?

QuoteThose lines are AGS default things..So I can't edit them.

Yeah those are the old Global Messages from 2.72. I need to add an option to get rid of them to a future version.

monkey0506

Quote from: Pumaman on Wed 10/06/2009 19:04:29
QuoteAlso, forgive me if I'm being daft here but where is System.AudioChannelCount set at?

Currently it is always 8. The "unlimited" channels with the audio types simply means that there is no specific limit on the number of channels that audio type can use, and it can use any remaining ones available within the overall 8.

Okay thanks! That was driving me batty trying to find that...is it in the manual somewhere? And is this a limit that you are planning on changing? I was just wondering why it's a property instead of, for example, a macro (like all the AGS_MAX_* ones).

Quote from: Pumaman on Wed 10/06/2009 19:04:29
QuoteFurther, is there a way to check the maximum channels available to a specific audio type?

In the editor, this is set on the Audio Type. There's currently no script method to access the setting, if that's what you mean?

That's precisely what I was asking. Would it be difficult to have a something like System.AudioChannelLimitForType(AudioType)? I can't think of any specific examples, but I think that if it's something that can be set in the editor, it might be reasonable to want this information in the script at some point.

Shane 'ProgZmax' Stevens

QuoteAre you saying that a tune played with aMusic5.Play() plays simultaneously with a PlayMusic(5) command?

I tried a different song from the one playing, but that shouldn't make any difference with 1 music channel, right?  Other than that, yeah, I get two songs playing simultaneously.

GarageGothic

Quote from: Pumaman on Sun 03/05/2009 15:34:47* Added AudioChannel.LengthMs property

Brilliant! Thank you very much!

Dualnames

Okay removed the syncdata thingy and that speech vox file went on holidays!! Ty CJ. AGAIN. ;)
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Pumaman

Quoteis it in the manual somewhere? And is this a limit that you are planning on changing? I was just wondering why it's a property instead of, for example, a macro (like all the AGS_MAX_* ones).

Good point, I'll add it to the manual for the next beta.

It's not an AGS_MAX_* constant because if it changes you don't need to rebuild your game. It's a limitation of the currently running AGS Engine and not a limitation of the game file format like the Max Inv Items is.

QuoteWould it be difficult to have a something like System.AudioChannelLimitForType(AudioType)? I can't think of any specific examples, but I think that if it's something that can be set in the editor, it might be reasonable to want this information in the script at some point.

If there is a scenario where this would be useful I can look into adding it. However at the moment there's a lot of other stuff I need to sort out so without a good reason to do this I'm not planning on it.

QuoteI tried a different song from the one playing, but that shouldn't make any difference with 1 music channel, right?  Other than that, yeah, I get two songs playing simultaneously.

Ok thanks, I'll look into it.

Pumaman

Quote from: ProgZmax on Wed 10/06/2009 21:18:19
I tried a different song from the one playing, but that shouldn't make any difference with 1 music channel, right?  Other than that, yeah, I get two songs playing simultaneously.

I can't replicate this. Have you got crossfading enabled (if so does turning it off stop the problem?) and have you changed any of the default Audio Types in any way?

Shane 'ProgZmax' Stevens

I had crossfading on from before I imported it, yes.  I changed none of the default settings; all I did was do aMusic2.Play() in the room's load script and it played over a PlayMusic call from before.

SMF spam blocked by CleanTalk