Getting "stuck" while sliding along ground
by Nic Biondi · in Torque Game Builder · 06/21/2008 (4:01 pm) · 15 replies
Hi GG gang, Top of the morning to you! Working on my game CracklePop and getting stuck in the sand.. litterally:
It seems to be somewhat random when I get stuck but it happens pretty often. Any ideas?
hmm, images don't seem to be coming up so heres a link to my blog where it shows the images of the physics and collision roll-outs.
carpetscooter.blogspot.com/


movie showing problem: www.youtube.com/watch?v=it0HCs3CIjU
It seems to be somewhat random when I get stuck but it happens pretty often. Any ideas?
hmm, images don't seem to be coming up so heres a link to my blog where it shows the images of the physics and collision roll-outs.
carpetscooter.blogspot.com/


movie showing problem: www.youtube.com/watch?v=it0HCs3CIjU
#3
06/21/2008 (6:47 pm)
Thanks tom. I don't have /image at the end because it doesn't show up again even in the code block. However that isn't the problem; In my post above I have it defined correctly. What I really would be interested in would be the solution to the sticky problem (;D)
#4
Your problem may appear to be random, but there are probably some clues as to what is causing it, you just must really test it and pay attention to little details.
How did you do the collision on the sandy bank? If you're using multiple collision polys pushed together, you may experience stopping issues. They must line up more than perfectly for there to be a smooth ride. I'd suggest turning on the collision debug mode and seeing if your dude stops on the seams between collision polys.
06/27/2008 (5:29 am)
Wow, Nic. Your game looks really cool. I've experienced some issues with circle collision mode, such as the object going through world limits. You usually need a lot of speed.Your problem may appear to be random, but there are probably some clues as to what is causing it, you just must really test it and pay attention to little details.
How did you do the collision on the sandy bank? If you're using multiple collision polys pushed together, you may experience stopping issues. They must line up more than perfectly for there to be a smooth ride. I'd suggest turning on the collision debug mode and seeing if your dude stops on the seams between collision polys.
#5
06/27/2008 (10:11 am)
Thanks for the reply. I have noticed one way that is causing a problem. I think it's related to the stickiness found in other places; if you roll off a corner slowly you get stuck on it. You can see every second that it's testing the collisions very hard.. and bugging out.. as you get to the end of the corner while rolling.. well blinking really since your stuck on it... the ticks happen faster as if the collision system is taking less iterations.. until finally you pop off the end of the corner.. usually going at great speeds. This happens in circle mode irregardless of collision mode: rigid, bounce etc. Anyone else have this happening?
#6
The second problem is sliding on a banked surface. This bug sticks your ball, never to be released again. Either way, there's no chance I can finish my game without some kind of fix to this.
any thoughts?
07/06/2008 (11:30 am)
Ok. I'm re-opening this thread for discussion. I still haven't found a way to stop these frequent game-destroying collision bugs I am dealing with. I can't believe I am the only one getting this problem. if you take an object using an eliptical collision box, and slowly roll it off a square... using rigid physics: it breaks. It may be something related to tick physics or something. I don't know enough about it.. but you can clearly see the collision checking cugging along trying to figure out what's going on until it finally blasts you off the corner at high speeds.The second problem is sliding on a banked surface. This bug sticks your ball, never to be released again. Either way, there's no chance I can finish my game without some kind of fix to this.
any thoughts?
#7
1> Sticky corners still exists with no noticeable improvement.
2> sticky ramps still exists as well.
I am certainly puzzeled.
-nic
07/09/2008 (4:30 pm)
Hmm.. 1.7.4 does not fix any of my collision issues. 1> Sticky corners still exists with no noticeable improvement.
2> sticky ramps still exists as well.
I am certainly puzzeled.
-nic
#8
07/09/2008 (4:54 pm)
Hey Nic, I sent off an email to Melv to see if he had any ideas as to what's going on with the stickiness.
#9
07/09/2008 (5:03 pm)
Thanks!
#10
www.youtube.com/watch?v=8rXDV_L0IQ4
problems shown in the video
1)sticky corners.. engine collision bug related to circle mode
2)trigger bug sucks you into the ground (might be a user error but it could be an engine bug)
3)sticky ramp.. engine collision bug?
it seems that the sticky corners can be fixed by not using circle collision mode.. but it creates a really choppy experience trying to make a cirlce out of polygons.
07/09/2008 (6:46 pm)
If it helps I created a video showing the two problems. www.youtube.com/watch?v=8rXDV_L0IQ4
problems shown in the video
1)sticky corners.. engine collision bug related to circle mode
2)trigger bug sucks you into the ground (might be a user error but it could be an engine bug)
3)sticky ramp.. engine collision bug?
it seems that the sticky corners can be fixed by not using circle collision mode.. but it creates a really choppy experience trying to make a cirlce out of polygons.
#11
%this.setCollisionMaxIterations(100);
if I do setCollisionMaxIterations(1); it acts terribly when going over a corner.. chugging along trying to resolve collisions about every second or so. when you go:$pBall.setCollisionMaxIterations(100) it works much better.. not perfect but at least it doesn't break the game.. it just makes me look amateurish, which I am so that's ok I guess.
The problem is that the higher I set the max iterations, the better the sticky corner problem is, but the worse the sticky ramp problem is. My assumption is that there was a fix that tried to resolve the settling physics issue that did something to the effect of "it's close enough to zero so lets just stop it and check again later".
Well, any help would be appreciated.
thanks in advance!
-nic
07/09/2008 (10:12 pm)
The sticky corners problem can be improved by hacking this little bit of frame-rate eatage into it:%this.setCollisionMaxIterations(100);
if I do setCollisionMaxIterations(1); it acts terribly when going over a corner.. chugging along trying to resolve collisions about every second or so. when you go:$pBall.setCollisionMaxIterations(100) it works much better.. not perfect but at least it doesn't break the game.. it just makes me look amateurish, which I am so that's ok I guess.
The problem is that the higher I set the max iterations, the better the sticky corner problem is, but the worse the sticky ramp problem is. My assumption is that there was a fix that tried to resolve the settling physics issue that did something to the effect of "it's close enough to zero so lets just stop it and check again later".
Well, any help would be appreciated.
thanks in advance!
-nic
#12
We're having exactly the same problem with our arkanoid game. Quite randomly any ball can suddenly become "stuck" on the wall. I've been running multiple tests though and from what I can see it's not stuck inside the wall and there still only has one set of contact points colliding. I think this sounds exactly the same as what you're having with your sticky ramp issue. I'm using 1.7.4. I move the balls by using LinearVelocityPolar and checked those and they're constantly changing whilst the ball is stuck. I have't tried putting up the maxIterations yet (mines on 3) because I don't want it to kill the frame-rate too much.
I'm thinking if we try to put our heads together with this one we might be able to sort it out lol!
I'm using circle collision without suscribe at about 0.8. I've tried it without the gravity i have and it still does the problem. Do you know if yours is constantly colliding or is it just made to stop?
08/08/2008 (9:50 am)
Hi Nic,We're having exactly the same problem with our arkanoid game. Quite randomly any ball can suddenly become "stuck" on the wall. I've been running multiple tests though and from what I can see it's not stuck inside the wall and there still only has one set of contact points colliding. I think this sounds exactly the same as what you're having with your sticky ramp issue. I'm using 1.7.4. I move the balls by using LinearVelocityPolar and checked those and they're constantly changing whilst the ball is stuck. I have't tried putting up the maxIterations yet (mines on 3) because I don't want it to kill the frame-rate too much.
I'm thinking if we try to put our heads together with this one we might be able to sort it out lol!
I'm using circle collision without suscribe at about 0.8. I've tried it without the gravity i have and it still does the problem. Do you know if yours is constantly colliding or is it just made to stop?
#13
There are two problems with the collision engine currently:
1) if you have a circle come into contact with a corner by rolling, or passing closely to it.. it will stop instantly. After a short time it will move very slightly. Then in a smaller ammount of time it will move again.. and again.. until it finally breaks free. I have a video showing this on a very simple starcase.. it's very easy to reproduce and I have to believe it's a bug. It was declared fixed in 1.7.4, but it isnt, booo-hoo! (:cD)
2) sliding down/up, a curved or banked surface will often cause the sliding circle to be come stuck permanently!!!!!!. Unlike the "sticky corner" bug which will wright it'self (sort of) this will never move. My current solution is to cry, and restart my level. I can recreate this all day in my game "crackle pop". This is the issue I think that you are having.
08/09/2008 (11:26 pm)
Hi Adam, sorry for the late reply.. I read this as soon as you posted and haven't had a chance to get back to you. I will check on your question "Do you know if yours is constantly colliding or is it just made to stop?" and get back to you. As for the "max iterations" hack, that helps with (but does not fix) the sticky corners problem. However, it doesn't do much to help with the sticky ramp/curve problem.There are two problems with the collision engine currently:
1) if you have a circle come into contact with a corner by rolling, or passing closely to it.. it will stop instantly. After a short time it will move very slightly. Then in a smaller ammount of time it will move again.. and again.. until it finally breaks free. I have a video showing this on a very simple starcase.. it's very easy to reproduce and I have to believe it's a bug. It was declared fixed in 1.7.4, but it isnt, booo-hoo! (:cD)
2) sliding down/up, a curved or banked surface will often cause the sliding circle to be come stuck permanently!!!!!!. Unlike the "sticky corner" bug which will wright it'self (sort of) this will never move. My current solution is to cry, and restart my level. I can recreate this all day in my game "crackle pop". This is the issue I think that you are having.
#14
I checked on what parameters were being passed within the onCollision function and found that the %time variable was always exactly zero when it was stuck. At all other times it was a very slight positive number (0.000654 for example).
I then made up a very slight hack and made another function to move the ball according to where it was on the game screen by a few measurements away from the offending obstacle. This function was callled from the onCollision function then whenever the %time variable was equal exactly to zero. At all other times the function that I needed for other collisions was called.
I don't know if this helps you in any way, I hope it does coz i really like the look of your game, it'd be good to see it finished!
08/11/2008 (1:39 am)
Hi Nic, no problem at all! Shortly after I posted I think i've cracked my issue but hopefully it might help you too.I checked on what parameters were being passed within the onCollision function and found that the %time variable was always exactly zero when it was stuck. At all other times it was a very slight positive number (0.000654 for example).
I then made up a very slight hack and made another function to move the ball according to where it was on the game screen by a few measurements away from the offending obstacle. This function was callled from the onCollision function then whenever the %time variable was equal exactly to zero. At all other times the function that I needed for other collisions was called.
I don't know if this helps you in any way, I hope it does coz i really like the look of your game, it'd be good to see it finished!
#15
I will definately be trying that fix when I get home from work! I considered a similar fix, but "nudging" the player when it stalled against a wall using the getLinearVelocity function. However I didn't play with it too much because I knew that if I did something to make it naturally stop.. such as roll to a stop.. this function would star me "abouncin'". Your solution that nudges the "%time" variable in the oncollision callback seems like a much better approach. If it does start bouncin' on rolling to a stop, we can always put a small delay in the %time oncollision "zero" checker that might fix that.
Thanks for getting back to me on this.. it's been really rubbing me for a while!
-nic
08/11/2008 (9:21 am)
Wow Adam, good news! I will definately be trying that fix when I get home from work! I considered a similar fix, but "nudging" the player when it stalled against a wall using the getLinearVelocity function. However I didn't play with it too much because I knew that if I did something to make it naturally stop.. such as roll to a stop.. this function would star me "abouncin'". Your solution that nudges the "%time" variable in the oncollision callback seems like a much better approach. If it does start bouncin' on rolling to a stop, we can always put a small delay in the %time oncollision "zero" checker that might fix that.
Thanks for getting back to me on this.. it's been really rubbing me for a while!
-nic
Torque Owner Nic Biondi
Default Studio Name
note: pretend that last image tag is a closing tag