The Daily Click ::. Forums ::. Klik Coding Help ::. Problem with random crashes - String related?
 

Post Reply  Post Oekaki 
 

Posted By Message

Strife

Administrator
Der Dairy Crick

Registered
  21/11/2002
Points
  2305

VIP MemberGOTW AWARD! -Astro Dude - part 1 GOTM JULY - 2009 - 3RD PLACE!It's-a me, Mario!Has Donated, Thank You!I donated an open source project
15th August, 2009 at 18:08:04 -

I'm making a space shooter at the moment, and it's working perfectly except for one thing... it seems to randomly crash during play. It's a small chance within a single level, but given the length of the game, it makes playing through from beginning to end without crashing a matter of chance.

At first I thought it was absolutely random, but after observing more closely, it happens the most when i've just hit and destroyed an enemy object. I'm not using any extensions, so there's only two possibilities I can forsee:

1. Something related to string objects. Whenever an enemy is destroyed, it creates a string object that displays its score value. The string object then floats upwards using the Bouncing Ball movement and then fades away.
2. Something related to semi-transparency. Could also be caused by the string object, but i'm not sure.

I'm using MMF 1.5. I really want to see if I can fix these crashes without getting rid of the string objects - i've already placed and coded them in every level, and using active objects wouldn't be flexible enough. Has anyone had problems with string/transparency related crashes in the past?

 

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
15th August, 2009 at 18:31:51 -

When I used mmf 1.5 I ran into this bug. When two objects of the same type get destroyed by 2 or more bullets at the same exact moment it would crash. I fixed this problem by adding in the condition "pick object at random"

Another bug with mmf 1.5 is when too many strings are completly blank the program randomly crashes.

I suggest you remove the strings and see if it crashes, if it doesn't try using the text blitter instead. If that dosent fix it try the first suggestion.

 
n/a

Strife

Administrator
Der Dairy Crick

Registered
  21/11/2002
Points
  2305

VIP MemberGOTW AWARD! -Astro Dude - part 1 GOTM JULY - 2009 - 3RD PLACE!It's-a me, Mario!Has Donated, Thank You!I donated an open source project
15th August, 2009 at 20:09:33 -

I tried your first suggestion, and it seemed to work at first since I was able to play through without issues. Suddenly, though, it came up again. D:

Fortunately, though, i've figured out the source of the problem and solved it. After some debugging which involved spawning large numbers of string objects on the screen at once, i've figured out that the crashes are caused by the "number of objects at runtime" limit. If the limit is exceeded and the game tries to create a string object, then boom, crash. Upping the object limit avoids the issue.

Thanks UrbanMonk! I'll be sure to keep that other bug in mind in the future, too.

 

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
15th August, 2009 at 20:17:22 -

You're welcome

Glad you solved it!

 
n/a

aphant



Registered
  18/05/2008
Points
  1242
16th August, 2009 at 20:15:10 -

When you destroy an enemy, it creates a string. The string moves up and then fades away. After it has faded away, do you destroy the string? It sounds like you are not if the object limit is involved.

 

Strife

Administrator
Der Dairy Crick

Registered
  21/11/2002
Points
  2305

VIP MemberGOTW AWARD! -Astro Dude - part 1 GOTM JULY - 2009 - 3RD PLACE!It's-a me, Mario!Has Donated, Thank You!I donated an open source project
17th August, 2009 at 21:21:06 -

Yeah, I did that Adam. ^^;

Anyway, it turns out that the strings were, in fact, NOT the problem afterall. I tried playing the game again today and it crashed on me just like before. I tried UrbanMonk's suggestion of removing the string objects from the game, but the crashes still occured... and not just when I destroy an enemy either!

The game is finished, and the crashing problem is the only thing that's preventing me from uploading it to TDC. >.<

I have a hunch about a few more things that might be causing it, all of which are unique to this game that I haven't used in any other games.

- Objects using the default MMF path movement. During my tests, creating tons of path-moving objects didn't seem to cause crashes, but you never know.
- My astronomical scoring system. If the player finishes the game from start to finish, they can easily achieve scores beyond 20 million points. The problem with this theory, however, is that the game can still crash on the first level, or it might not crash until one of the last levels.
- Color palettes. I'm using the Klik & Play color palette for each level rather than the default MMF palette, which was accomplished by importing a level from a K&P game. Seeing as how the game is currently set to a 32768 color graphic mode, i'm not sure how this would crash things up, but again... you never know.

Anyone have any last-ditch ideas? If not, then I could either start looking for testers to help me out, or I can just upload it to TDC anyway in hopes that an MMF-savvy person might discover something I didn't pick up on before.

 

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
17th August, 2009 at 21:28:20 -

Well are you using any extensions that haven't been ported to mmf2 yet, if not I could compile it in mmf2 for you.

 
n/a

Strife

Administrator
Der Dairy Crick

Registered
  21/11/2002
Points
  2305

VIP MemberGOTW AWARD! -Astro Dude - part 1 GOTM JULY - 2009 - 3RD PLACE!It's-a me, Mario!Has Donated, Thank You!I donated an open source project
18th August, 2009 at 09:48:13 -

It's only using the direction calculator, but I tried removing that extension and importing the game into the demo version of MMF2. While playing through in MMF2, I still get the crashes, but instead of the usual "program has encountered a problem and needs to close" message, it just freezes up. So whatever's causing it is a mutual issue for both versions of MMF. D:

 
   

Post Reply



 



Advertisement

Worth A Click