Beta 1.1 Collision / Physics bug
by John Klimek · in Torque Game Builder · 02/21/2006 (4:48 pm) · 5 replies
I've noticed that when you run the game in windowed mode and move the window, the physics/collision stuff starts going crazy.
Here are code snippets:
So we spawn the bottom wall using Environment::DrawLandscape() and then we spawn an object using ShootProjectile(). If the game window is NOT touched everything is fine. However if you move the window (the longer you hold the mouse button on the game window title bar) the more of an effect it has on the physics. What seems to happen most of the time is that the sprite (the one that is bouncing) gains a TON of upward force for no apparanty reason.
This seems to be a HUGE bug and will cause even bigger problems if used with networking.
I'm really looking to making a T2D game but can't unless a bug like this gets fixed =(
Here are code snippets:
// Bouncy Material. (this is from the physics demo tutorial)
datablock t2dCollisionMaterialDatablock(bouncyMaterial)
{
friction = 0;
restitution = 1.0;
relaxation = 0.5;
density = 0.01;
forceScale = 1;
damping = 0;
};
function ShootProjectile()
{
$sprite = new t2dStaticSprite() { sceneGraph = t2dScene; };
$sprite.setImageMap(ggLogoImageMap);
$sprite.setSize("5 5");
$sprite.setPosition("0 0");
$sprite.setCollisionActive( true, true );
$sprite.setCollisionPhysics( true, true );
$sprite.setCollisionMasks( BIT(0), BIT(0) );
$sprite.setImpulseForcePolar(180, 50);
$sprite.setCollisionMaterial( bouncyMaterial );
$sprite.setCollisionResponse(RIGID);
}
function Environment::DrawLandscape()
{
$terrain = new t2dStaticSprite() { sceneGraph = t2dScene; };
$terrain.setPosition( "0 33" );
$terrain.setSize( "100 2" );
$terrain.setImageMap( tileMapImageMap );
$terrain.setCollisionActive( true, true );
$terrain.setImmovable();
$terrain.setCollisionMasks( BIT(0), BIT(0) );
$terrain.setCollisionPhysics( true, true );
}
// This line is run inside game.cs:
t2dScene.setConstantForce(0, 10); // to simulate gravitySo we spawn the bottom wall using Environment::DrawLandscape() and then we spawn an object using ShootProjectile(). If the game window is NOT touched everything is fine. However if you move the window (the longer you hold the mouse button on the game window title bar) the more of an effect it has on the physics. What seems to happen most of the time is that the sprite (the one that is bouncing) gains a TON of upward force for no apparanty reason.
This seems to be a HUGE bug and will cause even bigger problems if used with networking.
I'm really looking to making a T2D game but can't unless a bug like this gets fixed =(
About the author
Recent Threads
#2
Thanks, we already have this as an issue in our database (Issue #1039) as reported here. Unfortunately, this kind of problem takes a little more time as it is a core TGE problem and so we can't change it directly in the TGB codebase. It will get resolved though.
- Melv.
02/23/2006 (10:56 pm)
John,Thanks, we already have this as an issue in our database (Issue #1039) as reported here. Unfortunately, this kind of problem takes a little more time as it is a core TGE problem and so we can't change it directly in the TGB codebase. It will get resolved though.
- Melv.
#3
If I force full-screen mode, will that solve the problem? Suppose the user alt-tabs (or ctrl-esc) out of the game? Will the physics go crazy? Will it cause the multiplayer game to go out of sync?
Also, any idea when this bug will get fixed? (are we talking days, weeks, months?)
Thanks Melv!
02/24/2006 (5:12 am)
Are there any workarounds for that bug? I'm creating a multiplayer game that involves physics and of course collisions.If I force full-screen mode, will that solve the problem? Suppose the user alt-tabs (or ctrl-esc) out of the game? Will the physics go crazy? Will it cause the multiplayer game to go out of sync?
Also, any idea when this bug will get fixed? (are we talking days, weeks, months?)
Thanks Melv!
#4
Please bump this thread if I don't get back to you soon! ;)
- Melv.
02/24/2006 (6:39 am)
When I get home tonight I'll bump this issue. The issue-database mentions a previous fix but there are issues with using it. I'm not sure of the details here but I will at least try to see if there's a temporary fix people could use in the meantime.Please bump this thread if I don't get back to you soon! ;)
- Melv.
#5
05/03/2006 (7:58 am)
Has this bug been fixed?
Torque Owner Michael Woerister