random sprite crashes plus other weirdness

For questions about using Classic.

Post » Fri Dec 11, 2009 7:04 am

I'm getting random crashes in the sprite plugin. Can't quite figure out why, as it's not consistent.

Also, sometimes my explosion-particle systems are not being placed where they should, and I can't figure out why.

Also, the timer that respawns the player (set as a behavior on the background) seems to get mixed with the timer that creates meteorites on each level after you clear one (set to the player sprite), so that if you die once, meteorites keep appearing over and over.

here's the .cap with the game. Requires Spritefont and Heightmap plus. The error was present even before using spritefont... I'm just polishing it =)

http://octavoarte.cl/asteroids.cap

Please, try playing it a few times to get the crash, get killed early to trigger the meteorite bug, fire a lot to get the explosion bug.
Help with any of these issues is greatly appreciated =)
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Fri Dec 11, 2009 8:44 am

Well I noticed the random explosions toward the center of the screen (to the left, usually three at once if that helps), seems to happen when asteroids are destroyed towards the bottom right.

I did notice the ever increasing number of asteroids, but simply put that down to you being a cruel horrible person and making it insanely difficult after reading my mind when I said to myself "meh this is too easy" and thus quadrupling everything a minute later LOL! :P


But I couldn't for the life of me get it to crash, and I've been playing it for a while now.
B
3
S
2
G
3
Posts: 628
Reputation: 2,531

Post » Fri Dec 11, 2009 6:57 pm

yeah I thought I had to adjust the difficulty formula, but then I noticed big asteroids appearing when there was supposed to be none left. I realised the timer that spawns them is being fired somehow in the middle of the level.... I suspect memory corruption.

Also the 3 or 4 explosions are supposed to be placed in the same spot. When those show up, they do in the place I've put them in the layout.... it means they didn't get repositioned, which is really weird if you look at the events.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Fri Dec 11, 2009 10:42 pm

I'm not sure if it's a bug, or more like incomplete, any way yeah you can only use one named timer on the timer behavior. It is doable if you add an new behavior for each named timer you need.
.... oh Rich... where are youuuu?
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Sun Dec 13, 2009 1:52 am

I FIGURED THE BUGS OUT! (woohoo!)

Okay, so one of them was indeed two distinct timers on the same timer object. Nice one, Newt!

The second bug (explosions not getting set sometimes) is rather obscure but:
I was spawning explosions, setting their positions to a meteorite and then destroying said meteorite on laser collision with that meteorite.
Turns out that sometimes a laser would hit more than one meteorite. This means the actions get run once for each meteorite.... but when destroying the meteorite, Construct destroys the whole matched list of them! So on the next run, there is no meteorite to set the explosions to, and sometimes the runtime crashes.


This one is probably a bug. I got around it by adding "on each meteorite" after the "on collision" condition.... so now for each collided meteorite explosions get spawned and meteorite gets deleted.... one by one.
I hope this was the source of the crashes.... so I can release the game :D
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Sun Dec 13, 2009 1:57 am

Are these bugs in the tracker? Which action was crashing with no meteorites? (It ought to handle zero objects fine)
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Sun Dec 13, 2009 2:11 am

[quote="Ashley":2ovbhsi0]Are these bugs in the tracker? Which action was crashing with no meteorites? (It ought to handle zero objects fine)[/quote:2ovbhsi0]

I'm not exactly sure, it was hard to reproduce... but involved an event matching multiple objects in the condition, then referencing one of them in the actions, then deleting it (which instead of deleting one, deletes all of them in that call, which in turn messes up the remaining calls).

I think I can whip up a test case now. It's not in the tracker, I just figured it out.

EDIT: crash is still there :( apparently it's unrelated to the explosions thing, which is fixed.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests