Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Game crashes on friend's PC

Credits go to piccolo for helping out!
This thread is locked; no one can reply to it. rss feed Print
Game crashes on friend's PC
Raf Vermeulen
Member #7,166
April 2006

I almost finished my game and'm talking to the guy who's going to take care of the music (current music's copyrighted by Nintendo, so not usable). The game runs fine on my comp, and has been tested and works fine on a couple of friends' comps. Only issue I've noticed, is that it tends to crash when starting up if you're playing music.

The composer friend tried the game out, but all he gets, is a quick flash of a window, and it's gone again. It simply doesn't work for him. I have no idea what the problem may be.

Any help on figuring this out is well appreciated. I've attached the game with source and all relevant files.

X-G
Member #856
December 2000
avatar

Make your program log things and do more stringent error checking, and make your friend run a debug version through gdb.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Raf Vermeulen
Member #7,166
April 2006

Well, log and error checking... dunno how much that'd do. The moment the game starts up and initiazed Allegro, it checks if high.txt is made, and if not, it makes that. Even that's not the case for my friend, so it must be something there. My bet's at a missing DLL or so.

Edit: Made a build which pauzes after every initialization part, with command-shell output.

Quote:

Okay, it stops after 'Timer installed' and this time I get the error message:
"Error initialising sound system"
"Failed to init digital sound driver"

Looking further into it... Might just be something with his comp, as he's not playing any music, but's said to have had a weird issue with his speakers earlier today.

gnolam
Member #2,030
March 2002
avatar

Quote:

Well, log and error checking... dunno how much that'd do.

It would let you find the error, instead of blathering nonsense about missing DLLs.

--
Move to the Democratic People's Republic of Vivendi Universal (formerly known as Sweden) - officially democracy- and privacy-free since 2008-06-18!

piccolo
Member #3,163
January 2003
avatar

well its not a dll you seem to have every thing. I recommend getting the stats of the computer it crashed on. and test on a similar computer. :D

wow
-------------------------------
i am who you are not am i

Raf Vermeulen
Member #7,166
April 2006

How friendly, Gnolam.

Anyways, looked further into the speaker issue.

Quote:

Them: The thing is; I had this weird issue with my speakers earlier today, so it might as well be that
Me: What was that issue?
Them: They made this loud hissing sound which went away after some time
Me: That's the hardware. Shouldn't affect the software
Them: I have no clue what caused it. And I'm not sure it was (just) the hardware
Me: You can play the midi-file and hear it outside of the game, right?
Them: Yes

If he can play the midi-file and hear it outside the game, then it's not his comp, but something with the game. There's something wrong with the sound initialization there.

The code that does this, is this:

   if (install_sound(DIGI_AUTODETECT, MIDI_AUTODETECT, NULL) != 0) {
      allegro_message("Error initialising sound system\n%s\n", allegro_error);
      return 1;
   }

piccolo
Member #3,163
January 2003
avatar

i do not think log files will help in this case but they are good to have.

Edit:

Quote:

If he can play the midi-file and hear it outside the game, then it's not his comp, but something with the game. There's something wrong with the sound initialization there.

nope nothing wrong with game itself you tested it on other computers. there is some thing wrong with his computers config.

wow
-------------------------------
i am who you are not am i

Raf Vermeulen
Member #7,166
April 2006

Is there a way to catch the sound initialization error and get it going anyways?

Computer reboot didn't fix the issue, btw.

piccolo
Member #3,163
January 2003
avatar

 if (install_sound(DIGI_AUTODETECT, MIDI_AUTODETECT, NULL) != 0) {
      allegro_message("Error initialising sound system\n%s\n", allegro_error);
      return 1;
   }

return 1; is end the loop when the error happens tack out the return 1;
but you dont want to make any sound calls if the sound got and error at initialising.

so do some thing like this.

1 
2extern bool sound_on=true;
3 
4if (install_sound(DIGI_AUTODETECT, MIDI_AUTODETECT, NULL) != 0) {
5 allegro_message("Error initialising sound system\n%s\n", allegro_error);
6 sound_on=false;
7 }
8 
9//do this to all your sound calls
10if( sound_on==true)
11{
12//play your museic
13}
14 
15if( sound_on==true)
16{
17//play your sample
18}

wow
-------------------------------
i am who you are not am i

Raf Vermeulen
Member #7,166
April 2006

Alright. Thanks for the help:) We'll see if this gets the game working.

Problem's still there:-/ Time to put more checks in it to follow the flow.

Now it crashes here:

    set_color_depth(16);
      cout << "Colour depth set\n";
      system("pause");
    
    if(set_gfx_mode( GFX_AUTODETECT_WINDOWED, SCR_WIDTH, SCR_HEIGHT, 0, 0)) exit(1);

Colour depth set is the last message he gets, so it's a problem with set_gfx_mode this time.

Bit odd that it's at another autodetect.

Edit (Nth): Ahh, problem solved. Friend was testing a friend of his' website out and had his comp in 800x600, which's also the resolution of the game. Seems like it didn't like that.

piccolo
Member #3,163
January 2003
avatar

you should had something like what you had for sound allegro_message("Error initialising sound system\n%s\n", allegro_error);

wow
-------------------------------
i am who you are not am i

Raf Vermeulen
Member #7,166
April 2006

So catching it and changing SCR_HEIGHT and SCR_WIDTH accordingly? Will see if I can add that:)

It all works like a charm now. Thanks alot for all the help:)

Go to: