Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: theo on Sat 21/08/2010 19:33:37

Title: Game crashes on loading saved game
Post by: theo on Sat 21/08/2010 19:33:37
Hey guys!

I've encountered a strange problem in my game. When loading a saved game that was saved in certain specific rooms, it crashes.
Most rooms I save in don't do this, but some certain rooms do it every single time without fail (upon loading them again).

I'm using a simple SaveGameSlot(30, "save game"); and RestoreGameSlot(30); so there's nothing fancy involved whatsoever.
I use the exact same slot every time i save and load.

The game shuts down and throws this:
An exception 0xC0000094 occurred in ACWIN.EXE at EIP = 0x00483D9D ; program pointer is +220, ACI version 3.12.1074, gtags (1,0)

Does anyone have a clue as to why it does this?

thanks!
Title: Re: Game crashes on loading saved game
Post by: Pumaman on Mon 23/08/2010 20:02:37
Interesting, probably the only way to investigate this is if you could upload a copy of the game that I could reproduce the problem with?
Title: Re: Game crashes on loading saved game
Post by: theo on Mon 23/08/2010 23:25:59
Quote from: Pumaman on Mon 23/08/2010 20:02:37
Interesting, probably the only way to investigate this is if you could upload a copy of the game that I could reproduce the problem with?

You can reproduce it easily with the current release of the Journey Down, it's just a matter of saving the game in the right room. Incidentally, the first room with real player interaction is actually the first room that has this issue. (Standing by power box) Try saving the game there and then loading it again. The quite hefty 125 mb download of the game can be found in my signature.

I'm having this bad feeling that I'm just doing something stupid with my save code but I can't for the life of me figure out what that might be.

Thanks for looking into this! It has put my n00b brain in a spin.
Title: Re: Game crashes on loading saved game
Post by: Pumaman on Tue 24/08/2010 19:53:55
Are you using MP3 music in the rooms where this crash happens?

There have been cases where the AGS MP3 decoder can't handle the seeking required after loading a save game, and crashes. If this is the case, could you try converting that track to OGG and see if the problem goes away?
Title: Re: Game crashes on loading saved game
Post by: theo on Wed 25/08/2010 21:22:54
You seem to have nailed the issue. I tried simply removing the bg music (mp3's) in the faulty rooms and it stopped crashing.
However it does not crash for all rooms with mp3's - for some reason. It appears switching to ogg is the safe way to go though. Hopefully my musician has all his raw files intact so we can bounce them all to ogg!

Thanks for the explanation. My angst is fading.
Title: Re: Game crashes on loading saved game
Post by: Pumaman on Sat 28/08/2010 12:47:10
Glad to hear that we've isolated the cause.

It's annoying that this happens, it only seems to happen with some specific MP3 files, there must be something about those files that AGS's decoder can't handle.
Title: Re: Game crashes on loading saved game
Post by: Dualnames on Sat 28/08/2010 18:04:40
Quote from: Pumaman on Sat 28/08/2010 12:47:10
Glad to hear that we've isolated the cause.

It's annoying that this happens, it only seems to happen with some specific MP3 files, there must be something about those files that AGS's decoder can't handle.

I had the same thing with HHGTG. But I came across it on the release, and I did a workaround. It crashed at random times, just steadily in some way. I sent you the files(at least I recall I did). I'm using .ogg so I fear that's not the issue.
Title: Re: Game crashes on loading saved game
Post by: Nlogax on Sat 28/08/2010 20:02:29
Hey, I've got this problem with The Journey Down. Twice now I've had to restart because when trying to load saves, cos the game crashes and I get:

An exception 0xC0000094 occurred in ACWIN.EXE at EIP = 0x00483D9D ; program pointer is +220, ACI version 3.12.1074, gtags (1,0)

Can someone confirm if this is because of the room I've saved in? This has really annoyed me as last time I got far and now I will have to start again, so I'd prefer to know how I can avoid crashing in the future!!!
Title: Re: Game crashes on loading saved game
Post by: Dualnames on Sat 28/08/2010 20:18:59
Can I ask theo if you're having any mouse modes disabled/enabled or the number of objects?
Title: Re: Game crashes on loading saved game
Post by: theo on Sun 29/08/2010 10:07:24
Nlogax: most rooms are safe to save in. The charter overview always works for me. I can't swear that this bug behaves the same way on all computers though.

Dualnames: I do all sorts of wacky stuff with my mousemodes. Dont think there's a connection there though but who knows? Number of objets? what objects? where?
Title: Re: Game crashes on loading saved game
Post by: Dualnames on Sun 29/08/2010 12:57:04
On that room I had the same problem as you do, I changed the mouse modes from 2 to 5 or 6. And I also had many objects. And I used ClaimEvent on mouse click. So any of those might be the case.
Title: Re: Game crashes on loading saved game
Post by: Pumaman on Sun 29/08/2010 16:38:00
Quote from: Nlogax on Sat 28/08/2010 20:02:29
Hey, I've got this problem with The Journey Down. Twice now I've had to restart because when trying to load saves, cos the game crashes and I get:

An exception 0xC0000094 occurred in ACWIN.EXE at EIP = 0x00483D9D ; program pointer is +220, ACI version 3.12.1074, gtags (1,0)

Can someone confirm if this is because of the room I've saved in? This has really annoyed me as last time I got far and now I will have to start again, so I'd prefer to know how I can avoid crashing in the future!!!

You should be able to run Setup, turn off sound and music, then run the game and restore your save game.
Then, re-save the game in a different room, and you should be able to turn the sound/music back on and get it working again.
Title: Re: Game crashes on loading saved game
Post by: cianty on Sun 29/08/2010 16:41:34
You just saved my saved game. Thank you! :)
Title: Re: Game crashes on loading saved game
Post by: Nlogax on Sun 29/08/2010 21:12:33
Brillliant, thanks Pumaman. You're a life saver!  ;D