Unwanted force on supported object, when the base falls

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Unwanted force on supported object, when the base falls

Postby ravarcade » Sat Jul 25, 2015 4:47 pm

Two objects: ball and flipper. Ball lay on flipper. When flipper fall. Ball jump. See video:
https://www.youtube.com/watch?v=CAnXihyENz8

Background. I try to replace in Future Pinball old newton lib v 1.53 with new one (v. 3.13). On old libs somthing like that never happend. With new lib to happend 2 of 3 times (random).
I double checked:
- main program don't add any additional force on ball.
- ball moves in same diraction as normal vector of contact.
- change of SolveModel will only change level of that additional force but will not remove it.

What is source of that additional force and how to debug/remove this?
ravarcade
 
Posts: 8
Joined: Sat Jul 18, 2015 11:52 am

Re: Unwanted force on supported object, when the base falls

Postby Julio Jerez » Sat Jul 25, 2015 6:09 pm

future pinball was using the direct solve of 1.53 which is disable in 3.xx

however there is a even better solve in 3.14 that will solve those bugs.
it will be best if you move to 3.14, there is a solver mode that you can use for the flipper that produce very realistic result.
3.14 and 3.13 and almost identical, so you only have to link the code. (make a backup)

then once you have it working let me know to tell you how to set the flipper and all the joint in the game. then let us talk about any problem.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Unwanted force on supported object, when the base falls

Postby ravarcade » Sun Jul 26, 2015 5:13 am

Thank for help.

I builded new dlls from 3.14 sources and use this new version.
With new version i hit another problem.
I get assert error in line 108 in dgBilateralContraint.cpp in method
void dgBilateralConstraint::SetPivotAndPinDir(const dgVector &pivot, const dgVector &pinDirection);

FP calls NewtonConstraintCreateSlider in plunger construction and this function leads to assert-error described above. So i have to replace it with somthing elese.

When i remove problematic plunger v 3.14 works same as v 3.13 with filppers.
ravarcade
 
Posts: 8
Joined: Sat Jul 18, 2015 11:52 am

Re: Unwanted force on supported object, when the base falls

Postby Julio Jerez » Sun Jul 26, 2015 9:06 am

ok, now you nee to change the build in constraints to the joint library, there build in joint are in their way to be deprecated. there is a lot of functionality that they do no support

I is a simple change, just find the equivalent joint in the joint library and use that instead.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Unwanted force on supported object, when the base falls

Postby ravarcade » Sun Jul 26, 2015 1:05 pm

I'm lost :(
I don't have access to FP source. All i have is my own "man-in-the-middle" between FP and newton.dll.
Right now is use newton.dll from current newton-physics-lib (v 3.13/ v 3.14).
For FP everything is like in old newton.dll v 1.53. My conde just use newer function from newer lib and fill gaps if new functions uses different params or different callback schema.

So if to use lib v 3.14 i can convert calls from NewtonConstraintCreateSlider to NewtonConstraintCreateUserJoint and make it work. Everything is from project "newton".
But if i have to replace whole interface and use things from other parts. It is too much.

I don't see way to use "dJointLibrary" with own set dlls and things from "newton.h". (or i'm wrong?)

In short. I have to stay with function/interface from "newton.h".
ravarcade
 
Posts: 8
Joined: Sat Jul 18, 2015 11:52 am

Re: Unwanted force on supported object, when the base falls

Postby Julio Jerez » Sun Jul 26, 2015 2:43 pm

Oh I see, I added some features to newton 3.13 and 3.14 that were no carried over to the build in joints. These why you see the asserts. It is not much work to bring them upto date.

Here my question, do you have an SDK, how are you changing the dll only, do have to have a way of linking the new newton.lib
I support to still have 3.13, if so can you set the continue collision for the Ball?

also for the estrange force, I do not know what could be I can take a look if I can run the demo.

Bascially the change needed are:
1-for 3.14 I can bring the joint up-to-date, no a problem
2-in your side see if you can se Continue collision for the ball only.
3-once I get 3.14 set up the strong joints, so the flipper is very strong all the tome.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Unwanted force on supported object, when the base falls

Postby ravarcade » Sun Jul 26, 2015 3:45 pm

I work like this:
1. I force FP to load my own dll (DLL Injection)
2. FP loads newton.dll (V 1.53).
3. With MS-detuours i intercept all (~80) functions called from FP to old newton.dll.
So all calls from FP to old-newton.dll are calls to my own dll.
4. My-own.dll is linked with newton.lib version v3.13 (or 3.14, simple switch) and load curret newton.dll (v.313)
5. ~70 functions are more/less same in both libs. Also i grab from that functions additional info.
6. With other functions i have to moddify data (for example different collision callbacks, switche body0, body1 order in callback).
For now i use not moddifed newton.dll (both v 1.53 and 3.13).

If you need i can send Visual Studio project. For big picture: I have made mod of FP: BAM. At start it was to make a lot of change in 3D graphics: head tracking + semi VR rendering + better quality rendering (like per pixel lighting), stereo 3D. Project site: http://www.ravarcade.pl . Now i try to improve physics and this is plugin for BAM.

----
I try to set continue collisions:
NewtonBodySetContinuousCollisionMode(ballBodyPtr, 1);
But it not solves "fippers problems" and few time when ball moves very fast it gives div-by-zero error in function
dgUnsigned32 NewtonUserJoint::JacobianDerivative (dgContraintDescritor& params) in NewtonClass.cpp
ravarcade
 
Posts: 8
Joined: Sat Jul 18, 2015 11:52 am

Re: Unwanted force on supported object, when the base falls

Postby Julio Jerez » Sun Jul 26, 2015 4:02 pm

Ok send me the project, let me see what I can do.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Unwanted force on supported object, when the base falls

Postby ravarcade » Sun Jul 26, 2015 5:17 pm

Project with my "man-in-the-middle" / plugin.dll:
http://www.ravarcade.pl/debug/NewtonTweak.zip
All thing between FP and newton.dll are processed in NewtonDetours.cpp.
right now i have 3 versions of "newton.h": newton_153.h, newton_313.h and newton_314.h
here are also 2x2 versions of "newton.lib", for debug build: newton_d313.lib and newton_d314.lib

To run FP with it you need:
FP: http://members.iinet.net.au/~cleathley/downloads/FuturePinballSetup_v1.9.1.20101231.exe
Install it in default "c:\games\Future Pinball". This is important.

BAM: http://www.ravarcade.pl/debug/BAM.zip
extract this zip to "c:\games\Future Pinball" dir. So "BAM" will be new dir in this folder and
"c:'\games\Future Pinball\BAM\FPLoader.exe" will be path to run FP with BAM

BAM is quite complicated in use so i set it all to work out-of-box. Just run FPLoader.exe from BAM dir (it will load FP), CTRL-N to open new table, F5 to start

Possible quircks:
- some AV programs detect virus in FPLoader.exe (it inject BAM.dll into FP so it works like a virus, but it not do anything else)
- sometimes FP must be run as admin

One more thing: logs
http://www.ravarcade.pl/debug/logs.zip
I have capture how FP initialize/create all objects (exept ball) and few frames when ball "fly up" when i release shift key and filpper goes down.
This may be better explanation what is called from FP and what funtions/callbacks are used.

----------------------

I know that my code is not clean and easy to read. If you will not want to wast time on it i will not be surprised.
If you will have any questions, i will be able to answer it tomorrow (it is almost midnight in Poland now).
Anyway thanks for help.
ravarcade
 
Posts: 8
Joined: Sat Jul 18, 2015 11:52 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron