Author Topic: Game crash - There was an error drawing object1.  (Read 2165 times)

cat

  • Mittens Baronet
  • AGS Baker
    • cat worked on one or more games that won an AGS Award!
    •  
    • cat worked on one or more games that was nominated for an AGS Award!
Maybe solved!
Doc_Savage found a possible solution to this problem. As I was not able to reproduce the problem, I cannot verify if it helps.
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=45945.msg617135#msg617135

Hi!

Selmiak reported an error in my game:
"There was an error drawing object1. It's current sprite, 56, is invalid."



He used 2x antialiased filter. I can't reproduce it and the error did not reoccur when he restarted the game.

Another player reported the same error but with completely different screen settings (fullscreen, no filters).

Both were using Direct3D 9 (I set this as default because in direct draw mode the music stuttering happens on room change)

Additionally I have to say that all sprites use alpha channel.

There is no line number in the error message but I think this lines cause the problem:

Code: [Select]
      oBowlEmpty.Visible = true;
      Wait(40);
      oUdder.Graphic = 56;
      Wait(20);
      oUdder.Graphic = 100;
      Wait(20);
      oUdder.Graphic = 56;
      Wait(20);
      oUdder.Graphic = 100;
      Wait(20);
      oUdder.Graphic = 55;

Any idea what this could be?

Edit: Forgot to mention - I use AGS Editor .NET (Build 3.2.1.111)
v3.2.1, March 2011
« Last Edit: 07 May 2012, 19:29 by cat »

Dualnames

  • AGS Baker
  • Rottwheelers
  • Pretty Badass
    • Dualnames worked on one or more games that won an AGS Award!
    •  
    • Dualnames worked on one or more games that was nominated for an AGS Award!
Re: Game crash - There was an error drawing object1.
« Reply #1 on: 23 Jan 2012, 08:17 »
Does sprite 56 exist?
No more military army stuff. I'm alive and back.

cat

  • Mittens Baronet
  • AGS Baker
    • cat worked on one or more games that won an AGS Award!
    •  
    • cat worked on one or more games that was nominated for an AGS Award!
Re: Game crash - There was an error drawing object1.
« Reply #2 on: 23 Jan 2012, 08:19 »
Yes it does. For me it always works, I can't reproduce the error. Also, in Spritemanager the properties of 56 look ok to me.

Gilbert

  • Local Moderator
  • * KILL* * KILL * * KILL *
    • Lifetime Achievement Award Winner
Re: Game crash - There was an error drawing object1.
« Reply #3 on: 23 Jan 2012, 11:05 »
Hmmm. Just a quick guess. Is sprite #56 of the same colour depth as the game's?

Also, did the error reported by the other player involve the same sprite?

Ponch

  • AGS Baker
  • Fashionably Late
    • Lifetime Achievement Award Winner
    • Ponch worked on one or more games that won an AGS Award!
    •  
    • Ponch worked on one or more games that was nominated for an AGS Award!
Re: Game crash - There was an error drawing object1.
« Reply #4 on: 23 Jan 2012, 16:25 »
When this bug was first reported, I tried every combination of resolution, filter, and setting. I can't get the game to crash.

Very strange.   :-X
*

Ghost

  • Guest
Re: Game crash - There was an error drawing object1.
« Reply #5 on: 23 Jan 2012, 16:33 »
Same here, I tried it out this morning. No crash at all.

And by its description this sounds like a bug that should always happen- an object's sprite doesn't change its colour depth or attributes at runtime, after all. I can't break your game, cat!
« Last Edit: 23 Jan 2012, 16:36 by Ghost »

cat

  • Mittens Baronet
  • AGS Baker
    • cat worked on one or more games that won an AGS Award!
    •  
    • cat worked on one or more games that was nominated for an AGS Award!
Re: Game crash - There was an error drawing object1.
« Reply #6 on: 23 Jan 2012, 17:27 »
Thanks guys for testing!

Hmmm. Just a quick guess. Is sprite #56 of the same colour depth as the game's?
Yes, all 32 bit.
Quote
Also, did the error reported by the other player involve the same sprite?
Just got the confirmation from Tabata (she is the other person) - yes it is the same sprite. Luckily she has offered to help me reproducing and finding the error.

She also mentioned that before the crash the cursor vanished but got visible again after rightclick (deselect inv item).
« Last Edit: 23 Jan 2012, 17:29 by cat »

selmiak

  • ǝsıɔɹǝxǝ ʞɔǝu puɐ uıɐɹq
    • I can help with play testing
    • I can help with proof reading
    • I can help with translating
    • I can help with web design
    • selmiak worked on one or more games that won an AGS Award!
    •  
    • selmiak worked on one or more games that was nominated for an AGS Award!
Re: Game crash - There was an error drawing object1.
« Reply #7 on: 23 Jan 2012, 22:35 »
ZOMG, I think I played the german translation, and tabata probably too, so further investigation there might lead to another imagefile with a translation on it. Or the cow should moo in german and this crashed the game ;)

cat

  • Mittens Baronet
  • AGS Baker
    • cat worked on one or more games that won an AGS Award!
    •  
    • cat worked on one or more games that was nominated for an AGS Award!
Re: Game crash - There was an error drawing object1.
« Reply #8 on: 24 Jan 2012, 08:17 »
I tried the German translation too but couldn't crash it. Tabata did use the German translation, but wasn't able to reproduce it either.

Actually, the reference pic for the cow was a photo I took in Switzerland a few years ago, so the cow will indeed moo in German  ;)

tzachs

  • Mittens Vassal
  • AGS Baker
  • Parking Goat- games that goats like!
    • I can help with translating
    • tzachs worked on one or more games that won an AGS Award!
    •  
    • tzachs worked on one or more games that was nominated for an AGS Award!
Re: Game crash - There was an error drawing object1.
« Reply #9 on: 24 Jan 2012, 12:33 »
Just a few thoughts.
- Are you using sprite 56 anywhere else in the code?
- Try and reproduce it by running it a lot of times. Change (temporarily) the code to this:
Code: [Select]
oBowlEmpty.Visible = true;
Wait(40);
int i = 0;
while (i < 1000)
{
      oUdder.Graphic = 56;
      Wait(20);
      oUdder.Graphic = 100;
      Wait(20);
      i++;
}
oUdder.Graphic = 55;



cat

  • Mittens Baronet
  • AGS Baker
    • cat worked on one or more games that won an AGS Award!
    •  
    • cat worked on one or more games that was nominated for an AGS Award!
Re: Game crash - There was an error drawing object1.
« Reply #10 on: 25 Jan 2012, 18:47 »
Nope, only usage of this sprite. And even turbo milking with only Wait(5) didn't result in an error.

There is nothing more for me to do than hoping it doesn't happen again...