Objects suddenly bounce off?

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: Objects suddenly bounce off?

Postby Marc » Wed Nov 18, 2009 2:29 pm

I use spheres of radius 0.9 in z direction (up) and 0.3 in x and y direction (parallel to ground plane). That creates the bouncing you have seen yourself.

When I change the x and y radius to 1, the problem seems to vanish - or at least happens so much less that I haven't noticed anymore during my 5 min testing. So it's somehow related to the distorted shape of the sphere I use.

I leave the online version unchanged until you are done examining. So it's still 0.3 for radius x and y.
Millenium Project Enterprises - Hobbyist Gamedev Group http://www.mpe-online.org
Walkover is now on Steam => http://store.steampowered.com/app/348700/
User avatar
Marc
 
Posts: 281
Joined: Sun Mar 14, 2004 4:07 pm
Location: Germany

Re: Objects suddenly bounce off?

Postby Julio Jerez » Wed Nov 18, 2009 2:57 pm

I was suspeting that it make me the the is a bug in the code that rotate the contact normal when teh shape have a high aspect ratio.
anyway I will check there. Thank you.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Objects suddenly bounce off?

Postby Julio Jerez » Thu Nov 19, 2009 9:13 am

http://www.confrontation-unlimited.net/ ... Window.zip
that file did not do anythong

Did you change teh code, when I selet teh unit is does not move now. It was doing it yesterday?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Objects suddenly bounce off?

Postby Marc » Thu Nov 19, 2009 11:54 am

No, I haven't changed the live system.

I just tried your julio account and empire xxcx and there I can see the effect as well in the upper left edge of your base field. Just connect and you'll see them bouncing.

When you extract those files in the zip file, make sure you start the gam with cu.cmd from the bin folder instead of update.exe. update.exe will revert the changes.
Millenium Project Enterprises - Hobbyist Gamedev Group http://www.mpe-online.org
Walkover is now on Steam => http://store.steampowered.com/app/348700/
User avatar
Marc
 
Posts: 281
Joined: Sun Mar 14, 2004 4:07 pm
Location: Germany

Re: Objects suddenly bounce off?

Postby Julio Jerez » Thu Nov 19, 2009 12:17 pm

Ah I forget tha to move is right click

"When you extract those files in the zip file, make sure you start the gam with cu.cmd"
how do I do that?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Objects suddenly bounce off?

Postby Julio Jerez » Thu Nov 19, 2009 12:54 pm

Ok I cna launch fo rthe debugger now
the very first problkem is that you are still using matrices with negative determinant


newton.dll!dgBody::SetMatrix(const dgMatrix & matrix={...}) Line 171 + 0x4c bytes C++
newton.dll!dgBody::SetMatrixIgnoreSleep(const dgMatrix & matrix={...}) Line 213 C++
newton.dll!NewtonBodySetMatrix(const NewtonBody * bodyPtr=0x108b5020, const float * matrixPtr=0x010744e4) Line 4976 C++
[External Code]
newton.dll!dgBody::SetMatrixIgnoreSleep(const dgMatrix & matrix={...}) Line 213 C++
newton.dll!NewtonBodySetMatrix(const NewtonBody * bodyPtr=0x108b5020, const float * matrixPtr=0x010744e4) Line 4976 C++
[External Code]
> client.exe!RegionDataResCU::HeightfieldInitNewton() Line 2169 C++
client.exe!RegionDataResCU::Unserialize(MUnserializeBuffer& b = {...}) Line 231 C++


the hiegh field thsi cause very bad side effects.

you need to add a code to detern whe you are doin that and fix it first
here is my debug code to check it out

Code: Select all
void dgBody::SetMatrix(const dgMatrix& matrix)
{
   m_matrix = matrix;

#ifdef _DEBUG
   for (int i = 0; i < 4; i ++) {
      for (int j = 0; j < 4; j ++) {
         _ASSERTE (dgCheckFloat(m_matrix[i][j]));
      }
   }

   int j0 = 1;
   int j1 = 2;
   for (int i = 0; i < 3; i ++) {
      _ASSERTE (m_matrix[i][3] == 0.0f);
      _ASSERTE (dgAbsf ((m_matrix[i] % m_matrix[i]) - 1.0f) < 1.0e-5f);
      dgVector tmp (m_matrix[j0] * m_matrix[j1]);
      _ASSERTE (dgAbsf ((tmp % m_matrix[i]) - 1.0f) < 1.0e-5f);
      j0 = j1;
      j1 = i;
   }
#endif


The transform matrices can not have negativbe determinant or scale
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Objects suddenly bounce off?

Postby Marc » Thu Nov 19, 2009 2:59 pm

Ah yes, I remember. I asked you about that before and you said that's bad but it worked at that time and I completely forgot. Sorry.

I'll correct that and see if it corrects the bouncing and report back. Thx. :)
Millenium Project Enterprises - Hobbyist Gamedev Group http://www.mpe-online.org
Walkover is now on Steam => http://store.steampowered.com/app/348700/
User avatar
Marc
 
Posts: 281
Joined: Sun Mar 14, 2004 4:07 pm
Location: Germany

Re: Objects suddenly bounce off?

Postby Julio Jerez » Thu Nov 19, 2009 3:47 pm

I do not know if it will fix the bounce bug but this is very bad.
for example the quaternion rotation of an antisymtic matrix do not have a unit magnitud.
plus this is the matrix of hightmap,

this is triggering a whole bunch of assert when running the debug version and do no let me get to the part wher eteh code bopduce happens,
we need thoso problem solved before going forward.
it should be very eassy to have then fix.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Objects suddenly bounce off?

Postby Marc » Thu Nov 19, 2009 5:31 pm

Ok, the determinant of the matrix should be 1 now => http://www.confrontation-unlimited.net/temp/CU1.zip Just unzip it in the bin dir.

You have to add the following lines to localdata\user.cfg to have windowed mode now: If maximized is 1, it's the whole screen, if it's 0, the following coordinates are used to place the window.

Code: Select all
[window]
maximized=0
x=0
y=0
xd=1024
yd=768


... and it didn't fix the bouncing :(
Millenium Project Enterprises - Hobbyist Gamedev Group http://www.mpe-online.org
Walkover is now on Steam => http://store.steampowered.com/app/348700/
User avatar
Marc
 
Posts: 281
Joined: Sun Mar 14, 2004 4:07 pm
Location: Germany

Re: Objects suddenly bounce off?

Postby Julio Jerez » Fri Nov 20, 2009 9:34 am

When I unpack the cui.zip file in teh bin fordel the game does noes work.
It hang for a long time and if I click outside teh widow it crashes.
I run update and it works,
then I try unpacking teh new exe and it di dteh same as before.

for Vusal studion I get Netwon update but is neve does any visual updates.


can you just put the fiexd version with in teh automatic update and I just run update?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Objects suddenly bounce off?

Postby Marc » Fri Nov 20, 2009 11:53 am

Strange. Anyways, I did that. Try update.exe and see if it works now.
Millenium Project Enterprises - Hobbyist Gamedev Group http://www.mpe-online.org
Walkover is now on Steam => http://store.steampowered.com/app/348700/
User avatar
Marc
 
Posts: 281
Joined: Sun Mar 14, 2004 4:07 pm
Location: Germany

Re: Objects suddenly bounce off?

Postby Julio Jerez » Fri Nov 20, 2009 12:38 pm

there is a problem still when I ru the Client.exe updated form Visual studio, it hangs connection to the region.

but if I run Update.exe then it runs but then it replaces the Newton DLL and do not let me debug it.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Objects suddenly bounce off?

Postby Julio Jerez » Fri Nov 20, 2009 12:44 pm

Oh I see I crahse when I use the New DLL, I think
I send you a link with the New DLL maybe you need to link to the New DLL bacause does not runs with this new version, but it is not crashing it simple hangs and if I alt tap then it crashes.

Oh I just realiased why it may not be working the serialization of some collison is differnet in version 2.11
if you are loading serialized data it need to be re saved again with these versions.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Objects suddenly bounce off?

Postby Marc » Fri Nov 20, 2009 12:59 pm

I'm not using serialization of collisions in the liefe version yet. It's still with the opcode backend.
Millenium Project Enterprises - Hobbyist Gamedev Group http://www.mpe-online.org
Walkover is now on Steam => http://store.steampowered.com/app/348700/
User avatar
Marc
 
Posts: 281
Joined: Sun Mar 14, 2004 4:07 pm
Location: Germany

Re: Objects suddenly bounce off?

Postby Marc » Fri Nov 20, 2009 1:00 pm

I'll link against the new version. I'll report back when I'm done.
Millenium Project Enterprises - Hobbyist Gamedev Group http://www.mpe-online.org
Walkover is now on Steam => http://store.steampowered.com/app/348700/
User avatar
Marc
 
Posts: 281
Joined: Sun Mar 14, 2004 4:07 pm
Location: Germany

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest