AGS 3.1 now available!

Started by Pumaman, Tue 04/11/2008 15:18:23

Previous topic - Next topic

Pumaman

It gives me great pleasure to announce the release of AGS 3.1.

Changes since the "3.1 Final" release in the beta thread:
* Fixed crash opening game in editor if there was an empty struct in a script
* Fixed background to dialog options being wiped away by mouse cursor in 8-bit games

Changes since 3.0.2 SP1:
* Added option to use native hi-res co-ordinates.
* Added option to continue running game loops while dialog options are displayed
* Added support for 1024x768 resolution.
* Added support for custom rendering of dialog options
* Added graphics filters to D3D driver, to allow 320x200 games to easily be run in a larger window.
* Added 4x Nearest Neighbour filter to allow 320x200 games to easily be run on widescreen monitors at 1280x800
* Added "Go to sprite" context menu option to script editor when right-clicking on a number
* Added Character.HasInventory, Character.HasExplicitTint, Character.Move, Character.SpeakingFrame, String.Replace, String.StartsWith, String.EndsWith, Game.ChangeTranslation, Game.UseNativeCoordinates, Dialog.ID, TextBox.TextColor, Slider.HandleGraphic, Slider.HandleOffset, Slider.BackgroundGraphic and Parser.FindWordID script functions.
* Added pop-up calltip when hovering the mouse over a function/property in the script.
* Added separate Replace menu option to go straight to the Replace dialog
* Added previous searches list and Case Sensitive option to the Find dialog
* Added Preferences option to configure whether Help window stays on top or not.
* Room objects editor now draws alpha-channel sprites correctly
* When the engine aborts with an error, the editor will now automatically zoom to the line in the script where the error occurred
* Editor now shows the call stack to the current position in the script when debugging
* Improved autocomplete to work better when adding code to existing functions
* Rewrote debugger to use a different method of communicating with the engine (Named pipes instead of Files) which should hopefully resolve some stability issues some people have been having with it
* Added support for calltip help text if you put a comment starting with /// on the line before the import declaration.
* Added feature for editor to send anonymous system information to AGS website
* Added editor plugin API IScriptEditorControl methods: SelectionStart, SelectionEnd, SelectedText, CursorPosition, GetLineNumberForPosition, GetTextForLine and GetTypeNameAtCursor
* Added new GUI Visibility option to have a normal GUI but initially switched off.
* Added ability to set initial GUI Transparency in the editor.
* Added Tip of the Day section to the Start Page.
* Added new file format for exported characters to enable characters with more than 20 frames in a loop or 16 loops in a view to be exported; this also fixes some character settings not being preserved in the old file format.
* Added Preferences option to allow you to do Exact Palette background imports in 8-bit games, like you could in AGS 2.x
* Added warning message when you use the Import New Background option in a room, to help newbies who are using it by accident instead of the Change button.
* Added option for AGS Editor to pop up a message every X days reminding you to back up your game
* GUI Text Box now allows the user to type in extended chars like éíñ when the textbox is using a TTF font
* D3D driver now automatically tries 640x400 if your monitor doesn't support 320x200, like the DX5 driver already did
* Removed Setup option to use the "wrong" resolution.
* Changed winsetup so that it doesn't pop up the Administrator prompt on Vista.
* RunAGSGame now shows an error if you try and use it while running with the debugger, since it doesn't work in this situation
* Moved the inventory hotspot marker settings from the inventory panes to the General Settings area since it makes more sense there and should reduce confusion
* Removed the room height limit of 1400 pixels.
* Removed the 30 character limit on hotspot descriptions
* Obsoleted InventoryScreen command, which is no longer supported.
* Editor now prompts you if you modify a script file in an external application while it is open in the editor
* On Windows XP and earlier, AGS will now create a "My Saved Games" folder in My Documents and then create individual game folders underneath, to avoid clutter
* When clicking the "..." button to go to an event script, AGS will now zoom to the line after the { rather than the "function" line itself
* Renamed String.Contains to String.IndexOf to reduce confusion with other languages such as Java and C#. String.Contains will continue to work as well for the foreseeable future
* Removed obsolete InventoryScreen usage from the Default & Empty Game templates
* Improved import of 2.72 games to ensure that unhandled_event is called with Use Inventory interactions
* Changed Default and Empty Game templates to 16-bit colour by default
* Changed error message when unable to initialise graphics mode to say the real resolution rather than game resolution when using a graphics filter
* Editor now gives error if speech file number > 9999 rather than leading to in-game File Not Found errors
* Fixed alpha-transparent dynamic sprites losing their alpha channel when you restored a save game
* Fixed object image not being refreshed properly if it had a dynamic sprite which you deleted at the same time as making the object invisible
* Fixed autocomplete popping up when it shouldn't do if you pressed space after typing a member property/function
* Fixed problem with Mouse.SaveCursorUntilItLeaves if the original mode was now disabled when it tried to restore it
* Fixed error starting up editor if you closed it while minimized
* Fixed dialog options text window edges with transparent parts not drawing correctly with D3D driver
* Fixed crash restoring save game if there was an active dynamic drawing surface created by CreateCopy
* Fixed Mouse.DisableMode crashing if cursor mode 4 (UseInv) was set as a Standard mode
* Fixed some music skipping problems when using ShakeScreen and during room transitions
* Fixed translations not working on script lines that had embedded speech marks
* Fixed GUI editor to not draw the background colour outside the actual GUI size
* Fixed error trying to save a game to a network share
* Fixed sound numbers over 999 not playing
* Fixed D3D driver smoothing all sprites, not just scaled ones, when "Smooth scaled sprites" was selected
* Fixed problem where if you closed a window and chose not to save changes, when you opened the window again the changes were still there
* Fixed script changes being lost if you opened a room script, made some changes, didn't save them, then opened the room itself, then created an event handler
* Fixed sprite import colours messing up if there were index-0 pixels on the image but index 0 was not being imported as the transparent colour
* Fixed Display() not working if the game had no GUIs
* Fixed changes to blink interval not always being applied immediately
* Fixed crash in Character.Say if the character's talking view had been set to an invalid view number
* Fixed PlayVideo restarting the music after the video finished, even if it was set to play game music
* Fixed the debug console being drawn behind characters and objects
* Fixed duplicate entries in autocomplete if you set an enum value to equal another enum value
* Fixed ListBox.RowCount always returning 0 until the GUI had been drawn for the first time
* Fixed Characters pane chopping off bottom of view preview when run at 120 DPI

Grab it from the download page!
http://www.adventuregamestudio.co.uk

Trent R

Yay!!!! Absolutely love it CJ!!

~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

Dualnames

Yay, yay, as for the blue screen of death, yep it's media manager..ANYWAY glad this is final..
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)

edmundito

Man, I hope you don't mean that media manager I wrote years ago that only worked on my computer. ¬¬
The Tween Module now supports AGS 3.6.0!

Dualnames

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)

TheMagician

CJ, thank you so much for your hard work on this editor. It was and is a source of inspiration in my life and it only keeps getting better and better.

Rocco

Totally agree.
To see how much effort and work are you putting in AGS, is a great motivation.
Specially if the working on a game stucks on some points.

Big Thx, CJ.  :)

edmundito

Quote from: Dualnames on Wed 05/11/2008 11:14:35
I don't know if you wrote it..

http://www.adventuregamestudio.co.uk/yabb/index.php?topic=32937.0

I'm talking about this one.

Nope, but I tried something similar years ago under the same name:

http://www.adventuregamestudio.co.uk/yabb/index.php?topic=19045.0

I didn't know there was a new one! that's cool!
The Tween Module now supports AGS 3.6.0!

abstauber

Even if I feel a bit hypocritical, posting here again after such a long time... Thanks a lot for this great release. I really really like the 3.x branch of AGS!

Electroshokker

#9
Great job! On to AGS 3.2 it is!  ;D

Quote from: Pumaman on Mon 05/02/2007 21:42:22
"break" can be simulated as monkey_05_06 has demonstrated (though I would like to add support for it in future).
"switch" can be simulated by using "else if"s (thoug again, I agree it's not as nice and it would be good to add switch support in future.

I can't say how many times I wanted to use a switch in my code. (I mean, all the if's and else if's are ugly and make the code unclear and bulky.)

Pretty please with sugar on top look into this for the next version! Thanks!  :=

Pumaman

Glad you guys are enjoying the new version :)

I've now uploaded it to the website, and if no issues are found in a couple of days I'll set the Check For Updates feature to recognise it and send out the e-mail.

QuoteI can't say how many times I wanted to use a switch in my code. (I mean, all the if's and else if's are ugly and make the code unclear and bulky.)

Pretty please with sugar on top look into this for the next version! Thanks

No promises I'm afraid -- I appreciate that not having it is a bit messy, but it's not top of my priority list at the moment.

edmundito

Code: ags

switch (Pumaman.Status) {
case eBusy:
     Frown();
     break;
default:
     RequestSwitchFeature();
}
The Tween Module now supports AGS 3.6.0!

Lt. Smash

#12
I got this error while testing my game in debug mode:
Code: ags

Error: The length cannot be smaller than 0 (null).
Paramname: length
Version: AGS 3.1.0.60

System.ArgumentOutOfRangeException: The length cannot be smaller than 0 (null).
Paramname: length
   at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
   at AGS.Editor.DebugController.ParseCallStackIntoObjectForm(String callStackFromEngine, String errorMessage)
   at AGS.Editor.DebugController._communicator_MessageReceived(XmlDocument doc)
   at AGS.Editor.NamedPipesEngineCommunication.MessageSenderThread()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

What cause this error: It seems that I was running my code into something like a loop. Function A calls Function B. Function B calls Function C. C calls A. A -> B....
What could the errormsg mean: Shouldn't the callstack open? Instead I got this error message and when closing it AGS hung up.

Question: Where can I see the call stack? When I get an error message, it says at the bottom check the call stack.

Trent R

#13
Where can I delete the search history? I have stupid things in there such as "on_ev", figuring I could delete them by pressing the delete key while selecting from the pull-down.

I assume that it's stored somewhere in the install folder... right?


~Trent


Another thing I noticed. I have high-res coordinates in scripts turned on. When I use FaceLocation, the ~box shows high-res, but Walk and WalkStraight shows low-res (Start move to x, y). I don't know about other functions, as I've only used these two so far.

~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

#14
Quote from: Lt. Smash on Sat 08/11/2008 19:36:11
System.ArgumentOutOfRangeException: The length cannot be smaller than 0 (null).
Paramname: length
   at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
What could the errormsg mean: Shouldn't the callstack open? Instead I got this error message and when closing it AGS hung up.

Ah... I can reproduce this error if the call stack has more than 5 functions in it. I'll look into a fix.

Quote
Question: Where can I see the call stack? When I get an error message, it says at the bottom check the call stack.

A new window should open at the bottom of the editor with the call stack in it. However, if it's crashing with that error that you just posted, this probably isn't happening as a result.

QuoteWhere can I delete the search history? I have stupid things in there such as "on_ev", figuring I could delete them by pressing the delete key while selecting from the pull-down.

You can't delete entries from the search history, however it will only remember the most recent 20 so it won't go on adding entries forever. I strongly recommend that you just leave it... if for some reason you really have to delete those entries, you'll need to dive into the registry which I wouldn't recommend.

QuoteAnother thing I noticed. I have high-res coordinates in scripts turned on. When I use FaceLocation, the ~box shows high-res, but Walk and WalkStraight shows low-res (Start move to x, y). I don't know about other functions, as I've only used these two so far.

Thanks for the report. The Debug Console hasn't had much love recently so I wouldn't be surprised if it's a bit dodgy, I'll take a look.

Trent R

Search entries: It keeps 20 entries? I didn't figure that out, I just noticed that it was keeping some of my 'pointless' searches. Thanks for the reply.

Debug Console: Ya it's old, and as soon as Dualnames can upload it I hope to be using the Console2b module instead. But right now I'm coding my battle system and I show the console as an extra tool. It doesn't get in the way for me, so I just leave it there.


~Trent
PS-One thing that annoys me with the new search is that focus priority goes to it when it's visible. I'd like to be able to search, and then click the script and edit it--while leaving the search still open to search for the next thing.
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

rbaleksandar

First - thanks a lot! :)

Like the new things added to AGS :)
Second - I have question, that may sound dull, but anyway I am going to ask it  ;D
How can we upgrade AGS without uninstalling the previous version. And one more thing. I opened AGS this morning, with the thought of continuing my project. Then I decided to make a short visit on the website just to see that a new version is available. So with AGS running (stupid I know, but I forgot to turn it off) I uninstalled it. Well surprisingly it uninstalled some things...But AGS was still running and no warning message occurred. The main application was still standing in the installation folder after uninstalling it along with other files like the NativeCompiler.dll (Demo game was missing) How is it possible to uninstall a running application, to get it uninstalled and there it is still running and kicking  ???

PS: How do you get the blue screen of death from the media manager? I don't have problems with it and AGS 3.1 ...  ::)
I am a mighty pirate. Arrrrgh!

Lt. Smash

Quote from: Pumaman on Sun 09/11/2008 00:28:13
Quote
Question: Where can I see the call stack? When I get an error message, it says at the bottom check the call stack.

A new window should open at the bottom of the editor with the call stack in it. However, if it's crashing with that error that you just posted, this probably isn't happening as a result.
Now I changed my code a bit and got a normal error (with that 'I've finished examining the error'-button):
Code: ags
Error running function '...':
Error: Script appears to be hung (a while loop ran 150001 times). 
The problem may be in a calling function; check the call stack.

But there is no call stack. I haven't ever saw something like that in AGS. (I'm running the editor on a 1680x1050 display.)

Lt. Smash

Debug feature request:
It would be really useful for debugging if we could see the content of specific/all variables.
There would be a list with the current stored variables and their values.
At the moment I have to put a Display command everywhere when the content gets changed, to see where the error could be.
The list would have an ideal place where the normal output window normally is.

Pumaman

QuotePS-One thing that annoys me with the new search is that focus priority goes to it when it's visible. I'd like to be able to search, and then click the script and edit it--while leaving the search still open to search for the next thing.

Well, you can close the window, edit the script, and then just press F3 to find the next match...

QuoteHow can we upgrade AGS without uninstalling the previous version. And one more thing. I opened AGS this morning, with the thought of continuing my project. Then I decided to make a short visit on the website just to see that a new version is available. So with AGS running (stupid I know, but I forgot to turn it off) I uninstalled it. Well surprisingly it uninstalled some things...But AGS was still running and no warning message occurred.

You don't need to uninstall the old version of AGS first. You can have both versions installed at the same time if you want.

As for uninstalling while it's still in use ... looks like a quirk with the installer, I'll see if there's anything I can do to prevent that.

QuoteHow do you get the blue screen of death from the media manager? I don't have problems with it and AGS 3.1 ... 

It sounded like Dualnames' problem was related to some sort of driver that he has installed, it's not a general problem with the Media Manager plugin.

QuoteNow I changed my code a bit and got a normal error (with that 'I've finished examining the error'-button):
But there is no call stack. I haven't ever saw something like that in AGS.

Are you saying that this Call Stack window doesn't appear:


QuoteDebug feature request:
It would be really useful for debugging if we could see the content of specific/all variables.
There would be a list with the current stored variables and their values.

Yes, this is something I'd like to do -- however it would require significant changes to the script compiler and interpreter, and is a very big job that I haven't had time to do yet.

Lt. Smash

Quote from: Pumaman on Sun 09/11/2008 15:48:03
Are you saying that this Call Stack window doesn't appear
It seems that it doesn't appear when the project tree is on the left side.

Quote
Yes, this is something I'd like to do -- however it would require significant changes to the script compiler and interpreter, and is a very big job that I haven't had time to do yet.
would be cool to see this in  the next beta.

Trent R

Search focus- I don't always want to search the same thing, so sometimes F3 is useful, sometimes it's not. But it's minor.

Variable Debugging-OMG I'd love to have this feature. I'd rather forego all other suggestions to implement this. (Including my stupid search request)

Intellisense- When does this get compiled to use? I've tried to figure it out (Save, F5, etc) but so far I'm not seeing a pattern. But I'm also an idiot, so who knows?


~Trent
PS-Your infiniteloop function made me laugh out loud.
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

DoorKnobHandle

Small glitch: the auto-complete seems to get confused for elements that begin with an underscore - other signs might affect the behavior as well, didn't check.

Assume:
Code: ags

struct TObject
{
      int _life;
      int life;
};


Now, when you type:

Code: ags

TObject test;

test.


...the list will pop up and list both elements correctly, but when you start typing the _life element, it will not select the right one, it won't complete the element at all.

densming

Is there a way to disable the "automatic space after comma" functionality in the script editor (so that when I type a comma it won't automatically insert a space immediately afterward)?  It seems like this used to be an option in previous versions but I can't find it anymore.

DoorKnobHandle

In addition to densming's suggestion, I would be for a simple boolean option that can be set via the AGS options with a checkbox switching AGS's "meddling" with keyboard input at all. What this means is, if switched off, the editor would no longer add the spaces after commas and it wouldn't move the closing brackets } left one tab-space automatically (that still irritates me), so it would be all like typing in Notepad. And by default it could stay on for all users who know and love these functions.

Ishmael

I second the option to disable AGS automatically formating my script for me. Since AGS is not the only thing I code in and no other editor does this for me it's a bit of work to have to remove spaces and move the braces around all the time.
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Pumaman

QuoteIt seems that it doesn't appear when the project tree is on the left side.

Ah well spotted thanks, I'll get that fixed.

QuoteVariable Debugging-OMG I'd love to have this feature.

I'd love to have it too. But as I said, it's a *big* job and something that I'll probably just roll into the rewrite of the script compiler, whenever I finally get around to doing that.

QuoteIntellisense- When does this get compiled to use? I've tried to figure it out (Save, F5, etc) but so far I'm not seeing a pattern. But I'm also an idiot, so who knows?

The contents of the header files (.ASH) are updated in intellisense whenever you save or run the game.
Local variables within a .ASC file are only updated in intellisense when you open the script, and then when you switch to another tab and then switch back.

Quotethe auto-complete seems to get confused for elements that begin with an underscore

Yeah I've noticed this before, I should really get round to looking into it. It's quite minor though, everything works except it won't automatically highlight the entry in autocomplete if it has an underscore.

QuoteIs there a way to disable the "automatic space after comma" functionality in the script editor (so that when I type a comma it won't automatically insert a space immediately afterward)?
QuoteWhat this means is, if switched off, the editor would no longer add the spaces after commas and it wouldn't move the closing brackets } left one tab-space automatically (that still irritates me), so it would be all like typing in Notepad. And by default it could stay on for all users who know and love these functions.

These are reasonable suggestions, I'll look into them. However I will be changing the behaviour of the } handling, because the way it works at the moment is quite annoying.

Trent R

Excellent, thanks for the reply!
~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

DarkRiver Design

I may be a novice, but the removal of the event editor has rendered this totally usesless to me. This program has officially moved beyond the realm of an accessible, user-friendly game creation tool. It was just as powerful before, why remove the accessible parts? Just for spiteful elitism?

Khris

#29
This was discussed a long time ago; afaik the interaction editor was removed because it was way too limited, and the time it would take CJ to extend and maintain it is better spent working on improvements of the engine.
You can always stick to 2.72.

I wouldn't call it elitism at all; scripting isn't rocket science, especially not if you're only going to use the script equivalents of IE commands. Give it a try.

DarkRiver Design

I'm sure it was discussed. I'm not trying to rehash, but I don't frequent this forum. Anyway, it's not a big problem -- 2.72 is still more powerful than I'm capable of taking advantage of. Just wish I could take advantage of that extra resolution while, you know... actually being able to do something with no scripting knowledge.

Ishmael

The basics shouldn't be too hard to grasp. As said, AGS is not for everyone. If you can't get a hold of the simplest things of the scripting language with the tutorial and some examples, makes me wonder if you're the type to actually put a game together...

'Scuse my elitism, but I still find it hard to accept people could be so stupid or helpless not to even try. No offence intended; on the contrary.
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

DarkRiver Design

None taken. I'm sure by-and-large that you're right. You're certainly right that it's not for everyone, but now it's just for even less people.

Pumaman

This has been discussed at length so I don't want to go over it again, but basically the problem with the interaction editor was that it lulled people into a false sense of security by allowing you to do very simple commands quite easily, but as soon as you needed to do something that wasn't on the predefined list you'd need to script it anyway. That then became very scary and off-putting since you'd managed to make the game so far without scripting and so wouldn't know how to take the next step.

QuoteIt was just as powerful before, why remove the accessible parts? Just for spiteful elitism?

I think that's rather un-called for. It's not a matter of deliberately going in and spitefully removing the interaction editor; rather, since the editor was completely re-written from scratch it was a matter of not spending an extra 3+ months of development time re-implementing the interaction editor.

It may resurface one day as some form of automatic script generator, but there would need to be some evidence that people were following the text and video tutorials and still not being able to grasp simple scripting commands, before that happened.

.M.M.

Should it be possible to get resolution options back in the game setup? I use font for 640x400 in 320x200 game and the work only with second option (bigger resolution) chosed, option 2x nearest - neighbour filter does not work, too.

Pumaman

Quote from: Mirek on Wed 19/11/2008 19:30:10
Should it be possible to get resolution options back in the game setup? I use font for 640x400 in 320x200 game and the work only with second option (bigger resolution) chosed, option 2x nearest - neighbour filter does not work, too.

Sorry, no. This "hack" of using a 640x400 font in a 320x200 game is no longer supported. If your game relies on it, then I suggest you stick with AGS 3.0.2 SP1.

Ryan Timothy B

#36
I'm using AGS 3.1.  I quickly scrolled through the 3.1.1 thread to see if there were any fixes for this (since I haven't upgraded yet).
I noticed quite often in my current game-in-production that when I play audio several times over, the game seems to hold a segment of audio and replays it over and over.

Lets explain this a little better..  My car in my racing game, when it crashes into a wall/etc I play a sound.  Using PlaySoundEx so I can control my audio (since I'm using up all the channels as is).  Whenever I crash into a wall I check to see if the channel is playing still, then stop the channel, then play the crashing sound (since that channel is also used for braking).

Well for some odd reason a segment of the crashing sound will be played over and over as though it is an ambient sound playing only a segment of the crashing audio.  But usually only if I'm repetitively playing the crash sound.

Whenever I call up the script to do this back-to-back:
  SetDigitalMasterVolume(0);
  SetDigitalMasterVolume(100);
The problem goes away.

EDIT:  Oh and the audio clip is less than 0.2 seconds.  I'll try adding a large section of silence after the 0.2 seconds of audio.

AGAIN:  Look at that.  I added 0.8 seconds of silence to the end of the audio clip making it a whole 1 second long.  And VOILA!  I crashed the car into a wall more than 300 times and nothing happened.

Shane 'ProgZmax' Stevens

Yes, the ags sound routines do have a problem with really brief sound clips, and it's something I've mentioned to CJ before.  Adding some silence to the problem effects seems to solve the issue (including when they don't play at all).

Ryan Timothy B

Hmm.. I'm actually testing my game right now to see if all the walls are collision proof, and sadly, I've still encountered the audio segment looping just recently.  I'll try adding another second of silence and doubling any other small length looping ambient sounds I have (just in case it's the other short sounds that are causing it.  but it only happens with the one crashing sound.  And I don't believe it's corrupt in anyway, they are all OGG's too.  :-\).

Pumaman

Sounds that are less than a second can sometimes cause problems, but this usually involves them not playing at all rather than looping. Can you post a sound file that has this problem?

Ryan Timothy B

#40
Certainly..
http://www.bryvis.com/roadracer/sound15.ogg

Since the problem still occurs even though it's longer than a second, I'll try pumping up the silence to 3 seconds in length.
EDIT:  Still with no luck.  I wouldn't doubt if it's my programming.. I'm like a monkey at a keyboard.   :D

Pumaman

Well, I tried a PlaySound(15) with that sound and it was fine. What exactly is happening to you, and how have you scripted the PlaySound commands?

Ryan Timothy B

#42
Code: ags
if (IsChannelPlaying(4)==1) StopChannel(4);
PlaySoundEx(15, 4); 


The script is a big mess of functions and what-not, but the only part that plays audio clip 15 is that part.
95% of the time that clip is played (sometimes more, sometimes less), it will play without any problems whatsoever.  If you're really keen on figuring out what my problem is, I could always send you the entire uncompiled game and you can crash into walls over and over until the problem occurs. :)  AND have fun while doing it! :P

Also, is it unusual for repeating music to suddenly stop playing?  When I crash into the walls repeatedly, having all the sound channels used, after a while the music stops.  And ismusicplaying() still registers as if it's playing.

Anyway, I'm really not too worried about the sound glitch for this game, hitting walls is something the player isn't supposed to be doing.  So it could be like an audibly annoying lesson for them NOT to do it again.  :P

EDIT:  I feel like I'm plaguing this thread.. I've been getting this error message when I go from script to script today.  It's been like 5 times now.
Code: ags

Error: StartIndex cannot be less than zero.
Parameter name: startIndex
Version: AGS 3.1.0.60

System.ArgumentOutOfRangeException: StartIndex cannot be less than zero.
Parameter name: startIndex
   at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
   at AGS.Editor.ScintillaWrapper.CheckFunctionForLocalVariables(Int32 currentPos, ScriptFunction func, String scriptExtract)
   at AGS.Editor.ScintillaWrapper.GetListOfLocalVariablesForCurrentPosition(Int32 currentPos)
   at AGS.Editor.ScintillaWrapper.FindLocalVariableWithName(Int32 startAtPos, String nameToFind)
   at AGS.Editor.ScintillaWrapper.GetFinalPartOfExpression(Int32 currentPos, ScriptStruct& memberOfStruct, Boolean functionsOnly)
   at AGS.Editor.ScintillaWrapper.ShowCalltip(Int32 openingBracketPos, Int32 parameterIndex, Boolean functionsOnly)
   at AGS.Editor.ScintillaWrapper.scintillaControl1_DwellStart(Object sender, DwellStartEventArgs e)
   at Scintilla.ScintillaControl.DispatchScintillaEvent(SCNotification notification)
   at Scintilla.ScintillaControl.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Pumaman

Quote from: Ryan Timothy on Mon 22/12/2008 00:36:19
Code: ags
if (IsChannelPlaying(4)==1) StopChannel(4);
PlaySoundEx(15, 4); 


The script is a big mess of functions and what-not, but the only part that plays audio clip 15 is that part.
95% of the time that clip is played (sometimes more, sometimes less), it will play without any problems whatsoever.

Is that bit of script in repeatedly_execute or some sort of place where it could be running too many times? When the problem happens, can you place a breakpoint on that PlaySoundEx line and see if the script is repeatedly running there?

QuoteAlso, is it unusual for repeating music to suddenly stop playing?  When I crash into the walls repeatedly, having all the sound channels used, after a while the music stops.  And ismusicplaying() still registers as if it's playing.

That sounds pretty unusual to me. I presume you haven't changed the music volume down to make it silent?

QuoteEDIT:  I feel like I'm plaguing this thread.. I've been getting this error message when I go from script to script today.  It's been like 5 times now.
Error: StartIndex cannot be less than zero.

Next time that happens can you post here what your mouse cursor is hovering over in the script? It looks like an error trying to pop-up the help window when you hover over a variable/function.

Ryan Timothy B

Quote from: Pumaman on Mon 22/12/2008 19:50:24
Is that bit of script in repeatedly_execute or some sort of place where it could be running too many times?
Negative.  It only accesses it whenever the speed is higher than zero and a collision was detected.
I even (just now just to absolutely make sure) put in some fail safe booleans so the collision sound will only happen once if the front end detects collision, until you put it in reverse.

QuoteWhen the problem happens, can you place a breakpoint on that PlaySoundEx line and see if the script is repeatedly running there?
I wasn't sure what you meant by breakpoint.  So I installed a fail safe button.  A.
If you press A it sets a boolean to TRUE and it runs this:
Code: ags

  if (keycode==65) { //press A
    a=true;
    StopChannel(1);
    StopChannel(2); //just for the sake of doing it
    StopChannel(3);
    StopChannel(4);
    StopChannel(5);
    StopChannel(6);
    StopChannel(7);
    StopAmbientSound(1);
    StopAmbientSound(2); //just for the sake of doing it
    StopAmbientSound(3);
    StopAmbientSound(4);
    StopAmbientSound(5);
    StopAmbientSound(6);
    StopAmbientSound(7);
    StopMusic();
    }

At first I tried stopping only the channel that the looping sound was played on.  Then tried stopping ambient sound on that channel just in case.  Then went all out and tried stopping every single channel including music.
And prevented the function containing the only playsoundex/playambientsound's, from running.
Still the sound looped for minutes on end (perhaps infinite).
I'm now pretty confident this is a weird AGS glitch.  Progz seemed to have heard of it before, so maybe he knows more about it.

QuoteThat sounds pretty unusual to me. I presume you haven't changed the music volume down to make it silent?
I again double checked to see if I could have been wrong.  The only time setdigitalmastervolume command is run whenever a new room is loaded or esc is pressed.

QuoteNext time that happens can you post here what your mouse cursor is hovering over in the script? It looks like an error trying to pop-up the help window when you hover over a variable/function.
I can tell you approximately what I did from the 2 times this happened.
I had 5 room scripts I needed to update to match the first script.
I copied the top half of the  function room_RepExec() on the first script.  Had the second script already opened, clicked on it, deleted the top half of the   function room_RepExec()  and pasted.  I think when I clicked to go back to the first script is when I had the error.

When I say I copied and deleted the top half of the function room_RepExec(), this is what I mean:
Code: ags

function room_RepExec()
{
  [...plus the code....]
  [..I also didn't copy or delete the bottom half of the script with the closing bracket..]


I've tried it twice today to see if I could encounter this again, and it won't.

Pumaman

Quote from: Ryan Timothy on Mon 22/12/2008 22:08:55
Negative.  It only accesses it whenever the speed is higher than zero and a collision was detected.
I even (just now just to absolutely make sure) put in some fail safe booleans so the collision sound will only happen once if the front end detects collision, until you put it in reverse.

Would you be able to upload the game so that I can try and reproduce the problem?

QuoteI wasn't sure what you meant by breakpoint.  So I installed a fail safe button.  A.

What I mean is, click on the line of script where PlaySoundEx is, and press F9. The line should turn red, and then when you use F5 to run the game, it should pause whenever the script gets to this line. That way, you can see whether this line of script is somehow getting repeatedly called, or whether you are just playing the sound once and AGS is repeating it without being asked to.

QuoteI can tell you approximately what I did from the 2 times this happened.
I had 5 room scripts I needed to update to match the first script.
I copied the top half of the  function room_RepExec() on the first script.  Had the second script already opened, clicked on it, deleted the top half of the   function room_RepExec()  and pasted.  I think when I clicked to go back to the first script is when I had the error.
I've tried it twice today to see if I could encounter this again, and it won't.

Interesting, thanks. I'll see if I can reproduce it.

Ryan Timothy B

#46
Quote from: Pumaman on Mon 22/12/2008 22:42:47
Would you be able to upload the game so that I can try and reproduce the problem?

Here you go CJ.
I deleted everything from the game so the file size wouldn't be as large.  Added a small room with black boundaries.
I kept anything to do with audio in the game; that includes the music player.  Press 'P' if you want to stop the music.

The best location to reproduce the audio glitch would be between the red car and wall.  Just go back and forth and you should hear it within 20-40 hits (usually).

http://www.bryvis.com/roadracer/rr_audio_test.zip


One thing I had actually never thought of doing until this very second, was completely swapping sound15 (the crashing sound) with a completely different sound.  I'll give that a shot and let you know.
EDIT: Errr.. nevermind.. still happens.

Pumaman

Thanks for uploading the game.

The bug seems to be a problem in AGS when you switch a sound channel from playing a normal sound to an ambient sound, or vice versa, without stopping the channel first. I'll look into a fix, but in the meantime a workaround would be to use Channel 4 only for PlaySoundEx commands and move the Ambient Sound 11 onto a different channel.

Ryan Timothy B

#48
That's odd.  I'm pretty sure I have a stop channel each time before playing any playsoundex or ambients.
Anyway, either way, yes I am playing both an ambient and playsoundex on the same channel.  I'll look at my sounds and see if there is a more organized possibility while separating the two types of sound.

Thanks for looking at it.

EDIT:  This seems to, without a doubt, be the problem.  Which it is now working at full steam with no audio glitches.  Yay.
If you end up not getting around to solving this AGS glitch before releasing 3.1.2, I recommend putting a warning in the Help file to possibly prevent any future glitches.  :P
Thanks again, CJ!

SMF spam blocked by CleanTalk