Assertion failed error
by Amjad Yahya · in Torque 2D Beginner · 08/26/2013 (7:47 am) · 9 replies
I was running my game and suddenly this error pops up, it happened once so far and I couldn't recreate it.


About the author
#2
I also remember it happening when picking areas.
Amjad, do you have code which dynamically scales or shrinks objects? Do you use pickarea anywhere?
08/26/2013 (8:45 am)
true, it usually happens when a collision polygon has two vertices really close to one another or if you try to scale a shape down to a size that is ridiculously close to 0.I also remember it happening when picking areas.
Amjad, do you have code which dynamically scales or shrinks objects? Do you use pickarea anywhere?
#3
08/26/2013 (9:57 am)
@Simon, yes, I use scales, shrinks and also pickarea.
#4
08/26/2013 (10:29 am)
Maybe we should integrate DbgHelp(Windows) and backtrace(Mac/Linux) to at least dump a call stack in those situation, I would guess lots of Torque users do not have a pro version of visual studio allowing them to JIT debug them.
#5
@Jon : Gonna have to check those out.
08/26/2013 (8:06 pm)
@Amjad : When you call pickarea, make sure that your function checks to see if the area is too small. If it is, then just make it 1x1 or print a message to the console.@Jon : Gonna have to check those out.
#6
As you can see not much is happening there, a UI image shrinks and some buttons scale up, I use pickpoint() when the mouse clicks and that's it.
I couldn't recreate the error which makes it too difficult to debug.
08/27/2013 (12:31 am)
@Simon: I'm sorry, I must have been sleepy when I said that I use pickArea(), I mixed it up with pickPoint(), anyways the error occurred in the main menu phase of my game which means no collision shapes at all, in fact here is a video that shows when the error occurred (it happened halfway through the video)As you can see not much is happening there, a UI image shrinks and some buttons scale up, I use pickpoint() when the mouse clicks and that's it.
I couldn't recreate the error which makes it too difficult to debug.
#7
It's really hard to debug anything based on suppositions but I'd investigate what happens when you try to click (when pickpoint is called) and the buttons are not yet at full size. It's just a guess though.
Another thought is that maybe your pickpoint code checks for 'all', which includes checking for collision shapes. Maybe setting it to 'aabb' would solve the issue as well.
The error came from b2PolygonShape.cc, that's why I suspected collision shapes. But b2polygonshape is also used in the picking functions.
08/27/2013 (1:01 am)
Hey that's your Skeleton Pirates game! Cool!It's really hard to debug anything based on suppositions but I'd investigate what happens when you try to click (when pickpoint is called) and the buttons are not yet at full size. It's just a guess though.
Another thought is that maybe your pickpoint code checks for 'all', which includes checking for collision shapes. Maybe setting it to 'aabb' would solve the issue as well.
The error came from b2PolygonShape.cc, that's why I suspected collision shapes. But b2polygonshape is also used in the picking functions.
#8
I've changed it to 'aabb', now I have to sit back and see if this error will occur again.
08/27/2013 (7:56 am)
Yes, I'm converting it to T2D MIT because some users who tried it on BFG.com reported a lag when they are playing especially in the levels where I have rain drops emitted by a particle player.I've changed it to 'aabb', now I have to sit back and see if this error will occur again.
#9
[edit]
I found the problem, it's when I use:
09/03/2013 (8:10 am)
I got this error one more time today. At that instant there was no mouse clicks and pickpoint() was not called. I have no clue what so ever.[edit]
I found the problem, it's when I use:
%this.createPolygonCollisionShape(-%sizex/2 SPC -%sizey/2 SPC %sizex/2 SPC -%sizey/2 SPC %sizex/2 SPC %sizey/2 SPC -%sizex/2 SPC %sizey/2);where %sizex and %sizey are not defined yet.
Alien Cabbage