Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: trevbot on Tue 10/03/2009 04:54:24

Title: Unable to load Sprite Set
Post by: trevbot on Tue 10/03/2009 04:54:24
So, I went to save my project and it gave me an error that said it couldn't save the sprite data. I minimized AGS to check out the forum, and when I restored the window, I got this error:

"Error: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Version: AGS 3.1.2.82

System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at GetRelativeSpriteHeight(Int32 )
   at AGS.Native.NativeMethods.GetRelativeSpriteHeight(Int32 spriteSlot)
   at AGS.Editor.NativeProxy.GetRelativeSpriteHeight(Int32 spriteSlot)
   at AGS.Editor.ObjectsEditorFilter.GetSpriteHeightForGameResolution(Int32 spriteSlot)
   at AGS.Editor.ObjectsEditorFilter.PaintToHDC(IntPtr hDC, RoomEditorState state)
   at AGS.Editor.RoomSettingsEditor.bufferedPanel1_Paint(Object sender, PaintEventArgs e)
   at System.Windows.Forms.Control.OnPaint(PaintEventArgs e)
   at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.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)"

So, I tried shutting the prgram and opening it again, and it says:

"Unable to load the sprite file ACSPRSET.SPR. The file may be missing, corrupt or may require a newer version of AGS."

What's worse, is that it won't load my project at all. Am I going to be able to recover my last update, or am I back to my last backup? (In this case: square one.)

I just downloaded AGS from the site two days ago, so I doubt the version is the problem.

-T

ps. There was no dump file made.
Title: Re: Unable to load Sprite Set
Post by: Dualnames on Tue 10/03/2009 09:20:00
That reminds me of the error I recently posted about..
Title: Re: Unable to load Sprite Set
Post by: Khris on Tue 10/03/2009 12:26:53
There should be a file called backup_acsprset.spr.
Rename that to acsprset.spr, overwriting the corrupt one.

But make a backup of the complete game dir first!
Title: Re: Unable to load Sprite Set
Post by: Pumaman on Tue 10/03/2009 19:07:38
Following on from your previous thread:
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=37104

it seems like you have some serious system instability going on, and I wouldn't recommend trying to continue because it seems like you could easily lose all your work.

Is AGS the only application you're having problems with? Are you sure you haven't got a faulty RAM module or anything like that?
Title: Re: Unable to load Sprite Set
Post by: redspark on Thu 09/04/2009 18:34:25
Sorry to dredge up an older thread but I just got this error too.  I'm using a computer that has not changed in 2 years for hardware.

I was just importing a new set of sprites for a speech animation when I went to run the game it blew up with this error.  I have 2GB of memory.  My ACSPRTSET file is about 25MB with around 1600 sprites. 

I was able to restore from the backup file and will backup the entire game folder before I continue.  However, I notice that the import acted a little strange.  I did a Quick Sprite import and brought in about 240 sprites or more in one shot.  The last two sprites were placed at the beginning instead of just the last one and a couple of the sprites were out of order.  This hasn't happened before as far as I know.

Thanks.
Title: Re: Unable to load Sprite Set
Post by: Pumaman on Thu 09/04/2009 18:43:54
Which error did you get (there are two different ones in the first post of this thread)?

Did the error happen when you saved the game, or when you tried to load it the next time?

Was the game running when you tried to save it?
Title: Re: Unable to load Sprite Set
Post by: redspark on Thu 09/04/2009 20:39:29
I got both errors.  After importing the sprites I tried to run the game which triggered the save, when the first error displayed about "Attempted to read or write protected memory".  I got a little window that said to send a report.  So I did.

I think I tried to save manually and got the error again and sent another report.  Then, I shutdown my game without saving and opened it up again.  That's when I got the spriteset missing/corrupt error.

The game was not running when I tried to save it.  Although I did do that earlier today by accident.  I'm certain I ran the game at least once after that though and didn't get an error then.
Title: Re: Unable to load Sprite Set
Post by: Pumaman on Thu 09/04/2009 23:59:19
Hmm, looks like it wasn't able to save the sprite file for some reason.

The only thing that I know can lead to this is if the game is running when you save it, but in your case it's not this so I'm not sure yet what else it might be.

I'll do some further investigation and see if I can work out what might lead to this happening; in the meantime, if it happens again please do keep on sending the error reports to let me know about it.
Title: Re: Unable to load Sprite Set
Post by: redspark on Fri 10/04/2009 02:47:34
The game is running from a USB pen drive.  Could that cause any problems because of the caching or IO speed?
Title: Re: Unable to load Sprite Set
Post by: Pumaman on Fri 10/04/2009 12:18:02
Hmm, I suppose that's possible. AGS writes the sprite file then immediately tries to read it back, if there was some dodgy caching going on with the USB drive maybe it might interfere with this process.

Also, I presume the USB drive has plenty of free space and didn't fill up when it was trying to save?
Title: Re: Unable to load Sprite Set
Post by: redspark on Sat 11/04/2009 11:59:05
Yeah.  Nearly a 1GB free on it.  No chance of it filling up.  I was thinking of the dodgy caching myself.  But I wasn't sure if that were possible.  I know it isn't suppose to be. :)