Game Development Community

1.1.2 Physics/Collision bug

by Oliver Rendelmann - DerR · in Torque Game Builder · 09/29/2006 (12:36 am) · 12 replies

Hiya guys,

just played around with the miniplatformer game on the new version and I must say the collisions are a lot more stable. Though I experienced the player getting stuck in the ceiling and in the floor.. was unable to get him out of there again without restarting the level. Other than that, awesome.. glad you guys are fixing the collision and physics stuff now. :)

#1
10/04/2006 (2:31 pm)
Anyone know what changed with the physics in 1.1.2??
My platformergame is totally messed up now!

All characters gets stuck or fly around! Somethings seriously wrong in this version :(
Anyone have a quick fix?
#2
10/04/2006 (2:33 pm)
A lot of the clamping stuff was fixed, so if you were using workarounds, they might need to be straightened out. Shouldn't be too bad ;)
#3
10/04/2006 (2:51 pm)
I used some code from the miniplatformer tutorial but now even when the characters are not colliding with anything, the motion is jerky and unstable...

Im using a timer to control the speed of the characters, so it has nothing to do with my FPS, and its above 200!
I just can't understand why it behaves so dramatically different? I mean, objects are sliding up and down walls again, with or without the fix and 1 jump out of 3 makes the character get stuck in the ground...
Worst update ever :(
#4
10/04/2006 (3:03 pm)
As a general rule for software development, never carelessly upgrade your core technology just because a newer version came out. That is the road to pain. When you do upgrade the core technology, always expect lots of stuff to break. Lots of stuff doesn't always break, but expect it to and you'll never be let down. This concludes our bit'o wisdom for the day.
#5
10/04/2006 (4:07 pm)
While Ben's post is a bit tongue-in-cheek, he's got a solid point: We do our best to keep releases as stable as possible against previous versions, but in some cases it simply doesn't work out. We are constantly growing our regression test suites, but with such incredible flexibility that TorqueScript offers as well as the engine itself, it can be very difficult to catch absolutely everything.
#6
10/05/2006 (10:09 pm)
@Andre: Can you check the following things?

1) You are using the OSX code?
2) Your character only gets stuck when you're holding left or right (releasing the arrows [even right before contact] and falling straight down results in not getting stuck)?

I'm currently working through a similar issue with 1.1.2. It's getting chronicled in this thread.
#8
10/05/2006 (10:31 pm)
Right, but the problem that I'm experiencing occurs only when you hold down left or right in the miniPlatformerTutorial code (ie set horizontal velocity using "%this.setLinearVelocityX(%this.runSpeed);" every scene update). It's very weird and has to do with the way things collide (as things move properly and collide as expected when I don't hold down left or right).
#9
10/05/2006 (11:37 pm)
Further testing has revealed that it is not the buttons presses but the non-zero value of linearVelocityX that can freeze a player to the t2dTileLayer upon contact.

Script Code: MiniPlatformerTutorial
TGB Version: Mac OSX 1.1.2 (modified to include t2dTextObject and the modifications required for VMPlayer 1.0, neither of which touch the t2dSceneObject code).
#10
10/06/2006 (11:37 am)
I have reportd that bug in the past. And they said it went into a private bug reports page.

Here it the original page I posted it on:

http://www.garagegames.com/mg/forums/result.thread.php?qt=51408
#11
10/09/2006 (6:23 pm)
@Azmodeus: The problem may be related to that in some esoteric way but the issue [getting stuck on the floor or ceiling when using the MiniPlatformerTutorial] can be 'fixed' as layed out in this thread.

The thing is that we shouldn't have to rely on this kind of hack to fix the issue. I haven't tested it yet but I suspect that sloped surfaces/platforms will break similarly (as the fixes mentioned above only affect perfectly horizontal platforms).

It really does seem like there's an issue with the solver. Maybe CLAMP collision response has something to do with it... not really sure. What I do know is that TGB 1.1.2 does not like non-parallel-line, non-perpendicular collisions [at least] when the Collision Response is set to CLAMP. In other words, if the collision is not between two parallel lines and the collision does not occur at 90 degrees then bad stuff happens.

This explains why everything worked fine when I would jump around and let go of movement keys (which modify horizontal linear velocity and thus the collision vector) right before landing [colliding].

Though the mixing of 'shutting off gravity' could potentially mix things up a bit...

Perhaps when a single vertex of a polygon bumps into a line (when not a perfectly perpendicular collision - we're talking collision vector here) then slight burrowing occurs, stopping the object from further movement. It's as if the solver is missing something in this case... could be as simple as a ">=" instead of just a ">" somewhere. (?) Thoughts?
#12
10/09/2006 (9:04 pm)
The problem is not about a single vertex bumping into a line. The problem (at least the one I was having) is instead related to a wall climbing fix that was introduced to the MiniPlatformerTutorial.

Read about what's going on here.