Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: monkey0506 on Tue 06/12/2005 02:56:17

Title: Game crash -- no error message.
Post by: monkey0506 on Tue 06/12/2005 02:56:17
I've been trying to make my QueuedSpeech module 2.7 AND 2.71 compatible (one version compatible with both).  I used the #define AGS_NEW_STRINGS to check if 2.71 was being used, used Strings if it was, and strings if it was not.  I got all that worked out, and I got it to compile on both 2.7 and 2.71 fine.  And it runs on 2.71 without a problem.  However, when I try to run it off of 2.7, the game crashes whenever I try to add speech to the queue.  It appears to be an instantaneous crash, and AGS supplies no error message, except "The game terminated unexpectedly.  If the problem persists post it on the Tech Forum." or some such (after the Windows XP message telling me that the program unexpectedly terminated).  I've uploaded the game here (http://www.sitesled.com/members/meleepta/queuedspeechtes.rar) for somebody to look at.  I'm not worried about taking anything, as I plan to release the module as open source anyway, so anybody can feel free to take a look.  I've searched over the code several times and I can't find what's making it crash, so if anyone wants to help me out here, it would be greatly appreciated.

Thanks.

[EDIT:]

I removed the Compiled folder and all of the *backup.* files from the rar, so if I need to upload those...I can try...but my internet is screwed up.  I can't maintain a steady connection.  We're supposed to be throwing away this satellite and getting DSL (the modem comes Friday, activation Monday...a week :'().  So, if you want me to sent that along, I probably won't be able to for a week.
Title: Re: Game crash -- no error message.
Post by: Gilbert on Tue 06/12/2005 04:16:28
Hmmm used Display() and commenting, the problem is narrowed down to the QueuedSpeech.RemoveSpeech(0); line near the end of the module code, so the problem probably lies within RemoveSpeech() or something it called.

EDIT: Found the problem, it's with that
QueuedSpeech_MessageType Buffer[QUEUEDSPEECH_QUEUE_MAX];
declaration just below the #ifndef part of RemoveSpeech(), moving this declaration outside of the function seems to be okay, so it's probably a memory crash due to "large" amount (about 300*200 ~ 60KB I suppose) of temporal memory assignment within a function.
Title: Re: Game crash -- no error message.
Post by: Pumaman on Tue 06/12/2005 18:47:28
Well spotted, that should generate a Stack Overflow error, not crash AGS. I'll get it fixed.