Quickest way to test some joint configurations

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Quickest way to test some joint configurations

Postby walaber » Sun Jun 17, 2018 1:00 am

Hello all, long time no post!

I'm back making indie (physics) games, using Unity lately as I've grown very familiar and fast with it.

Anyway I'd like to look into using Newton for my future physics games, but it looks like the Unity plugin will need some work to be ready for real use, both in supporting all of the newton features, and also in getting set up properly for multiplatform support (I will need to support Mac, PC, Android, iOS, and potentially consoles).

Before I start spending time on either updating the plugin or making my own, I want to test out some different joint configurations and things in Newton.

what's the fastest day to do that these days? should I just use the demo application that comes with the SDK and create some new custom demo scenes in there? Or is there an engine out there right now that has Unity 3.14 support built-in that I can use to mock up some tests?
Independent game developer of (mostly) physics-based games. Creator of "JellyCar" and lead designer of "Where's My Water?"
User avatar
walaber
Moderator
Moderator
 
Posts: 393
Joined: Wed Mar 17, 2004 3:40 am
Location: California, USA

Re: Quickest way to test some joint configurations

Postby Julio Jerez » Mon Jun 18, 2018 3:04 pm

the best way to check functionality is trying the demos in the SDK and if you think off some functionality you want in the plugin you can request it here or you can add it make a pull request.

On the multiple platforms thing, I am not committed to do that myself these days, is too much work for not reward. I know there are few games that run on Mac and consoles as recent as last year
https://www.youtube.com/watch?v=FOT_SpgANk8
https://store.playstation.com/en-us/pro ... MAGAME2015


the site were you are downloading newton from is from is also console developer that compile Newton to both PS4 and XBoxOne, but I can't do that since I can't afford any of the licenses cost that is required for making the SDK a legal third party library, and even if I did, it does not mean I will get it.
Having said that, I know for a fact that Newton compile out of the box is all these platforms, by simply setting the right define and linking to the platform systems library, it just that I can't distribute projects that link to those libraries.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Quickest way to test some joint configurations

Postby walaber » Wed Jun 20, 2018 10:16 am

Thanks Julio. I'll look closely at the demos and see if I can learn what I need there.

As you can probably guess from my other video, I'm working on a simple powered ragdoll game. I don't need fancy self-balancing or anything for this game, but I do need really solid joints that can simulate a human well.

The game works by providing the physics with goal poses for the ragdoll, and the joints simply try to match that pose, given their limited strength. Ideally the joints also have rotational limits as well. I do the standard thing of turning the joints "limp" on a crash.

Is there a current, ready-to-use joint that I should use for this purpose? Or should I be making a custom joint?

I know there are some powered ragdoll systems in development right now, how ready are those for my use case?

In my current implementation I've had a lot of trouble with twisting tricks, I've had to cheat and use my own torque forces to get the character twisting, and I've struggled a lot with the behavior. This is the best I've got it to work, but in practice there were lots of other attempts at this same trick that show the problems with the physics.
https://twitter.com/walaber/status/896853837868179456
Independent game developer of (mostly) physics-based games. Creator of "JellyCar" and lead designer of "Where's My Water?"
User avatar
walaber
Moderator
Moderator
 
Posts: 393
Joined: Wed Mar 17, 2004 3:40 am
Location: California, USA

Re: Quickest way to test some joint configurations

Postby Julio Jerez » Thu Jun 21, 2018 2:05 pm

walaber wrote:I don't need fancy self-balancing or anything for this game, but I do need really solid joints that can simulate a human well.
The game works by providing the physics with goal poses for the ragdoll, and the joints simply try to match that pose, given their limited strength. Ideally the joints also have rotational limits as well. I do the standard thing of turning the joints "limp" on a crash.
In my current implementation I've had a lot of trouble with twisting tricks, I've had to cheat and use my own torque forces to get the character twisting, and I've struggled a lot with the behavior.


That's what the inverse dynamics solver does Walaber, is long to explain but once you get it, start to to make sense to you. All I am going to say is that you can't see the scope of the problem complexity because there are emergence behaviors that comes out of the physics simulation that you are not aware of but that are very real, they are real because you experience them in reality.
One such behavior is conservation of angular momentum of the whole system when in mid air.
I am not a gymnast and I have never done any kind of stunts, but what I know about physics allow me to understand why a gymnast can do tricks in mid air by contorting his body and changing his mass distribution.
what happens is that when the contraction changes the mass distribution, this means the inertia changes, and because angular momentum should be preserved, this means that the angular velocity of some bodies part must change is such way to preserve angular momentum.

The newton engine been an acceleration based engine is develop based of the preservation of the total instantaneous momentum, this is why is can generate those behaviors, at least in principle.
Some engines can't do that because they focus more on speed so there use position correction to hide errors from the user, but the effect is that you get stuff that moves but is not really physics simulation.
I am not about to give a lecture about these thing anymore, the general public do not really care,
is only when some user sees these weird thing that they reluctantly try Newton and even them their first thought is to go back to what the were using, but I am ok with that.

What I can do to get you start if you are interested, is that I can make a new demo in the SDK, and try to recreate a simple version of that man jumping down the trampoline so that you can see how things are set up using the global inverse dynamics system, them you can go on from there.

The the twist effect you are concern about should emerge from mere fact that the character trying to reach the specified pose, at least it should show sign of the effect and of course you can always enhanced it, but it should be a physics consequence.
There is difference between exaggeration an get some style and make it up because the toll you are using is inadequate. Most people always make that false equivalence and always conclude
that if they all has limits then speed is the only thing that counts.

One a basic demos is set up can see how things are setup and you can present repro cases for future bug or features. The engine should be able to map to the Physics every thing you have to the physics.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Quickest way to test some joint configurations

Postby JoeJ » Thu Jun 21, 2018 4:20 pm

walaber wrote:Is there a current, ready-to-use joint that I should use for this purpose? Or should I be making a custom joint?


You could also try my custom joint in the 'JoesJonitTest.cpp' demo.
I've used the joint for this walking ragdoll https://www.youtube.com/watch?v=ULRnlAbtL3s,
and made some changes recently so it supports motor and limits at the same time, and to be compatible with Julios inverse dynamics (not implemented yet).
Unfortunately not much time to continue on this for another year... :(

To understand the limits, you need to display them in demo sandbox, there is an option for it.

As is, you drive it by setting a relative rotation target between the two bodies that it will reach in the next timestep. You need to do this for each joint, while Julios system will make things easier because you control whole chains of bodies with effectors.
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Quickest way to test some joint configurations

Postby walaber » Fri Jun 22, 2018 10:09 am

Thanks for the replies Julio and JoeJ.

This is exactly what I'm looking for, and why I'm back looking into Newton, because I think it will probably work better for my use case than the other engines.

I'll start by looking at the JoesJ test demo, it sounds like a great starting point.
Independent game developer of (mostly) physics-based games. Creator of "JellyCar" and lead designer of "Where's My Water?"
User avatar
walaber
Moderator
Moderator
 
Posts: 393
Joined: Wed Mar 17, 2004 3:40 am
Location: California, USA

Re: Quickest way to test some joint configurations

Postby Julio Jerez » Fri Jun 22, 2018 4:09 pm

Oh now I see what you mean by testing joint,
In the SDK there is a simple demo for almost every joint in the joint library,

I was wondering when you keep asking the same question, and the answer seem to be that you could no see the simple test because I has the comment out because if was running a experiment.

I enabled them again, the demo is Standard Joint.
Also there is a the Joe's test which is probably more inline with what you are doing mow.

Most users are happy to use the joint from the standard library and subclass from them.
Advanced users like Joe and You(as I remember) you can make their own joints to get what they
wand from the engine, so maybe for you Joes demos is what you are looking forward.

I still advice you to check out the six axis manipulator and the hexapod, because what I mention before is a far superior way to do what you want.
This a feature unique to newton, I am try to get people to use it much the same way ten year ago we came of with custom joint interface.
before that not engine has that kind of support.

if you sync, you should be able to test Joes and the standard joints, also the six axis and the hexapod.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Quickest way to test some joint configurations

Postby JoeJ » Fri Jun 22, 2018 5:24 pm

Julio Jerez wrote:I am try to get people to use it much the same way ten year ago we came of with custom joint interface.


Just to let you know, i'll probably wait until you have a 3DOF joint like mine ready before i continue with the ragdoll. My stuff seems so broken i have to start some things from scratch, and i should not do this just to replace many things with your work later on.

My biggest doubt was that i need to control the COM, not end effectors. But this is no problem: I could simply exclude the feet bodies from inverse dynamics and handle them on my own, if this becomes an issue. :)

Unfortunately i'm not in a hurry - still lost in geometry processing stuff - but just to remind you know there are already some people waiting for this revolution... :mrgreen:
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Quickest way to test some joint configurations

Postby Julio Jerez » Fri Jun 22, 2018 6:45 pm

JoeJ wrote:My biggest doubt was that i need to control the COM, not end effectors. But this is no problem: I could simply exclude the feet bodies from inverse dynamics and handle them on my own, if this becomes an issue. :)

you are still thinking the old school my friend, I never gave any though to the COM.

Maybe what we should do is a demo that shows how to control those kind of things before with move to the more complex stuff. maybe a simple version of the 1986 famous luxo example.
https://www.youtube.com/watch?v=D4NPQ8mfKU0&t=66s

that will be simple enough to gain knowledge for the more complex. the I can show how to do center of mass control with effectors.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Quickest way to test some joint configurations

Postby JoeJ » Sat Jun 23, 2018 1:57 am

Julio Jerez wrote:Maybe what we should do is a demo that shows how to control those kind of things before with move to the more complex stuff. maybe a simple version of the 1986 famous luxo example.
https://www.youtube.com/watch?v=D4NPQ8mfKU0&t=66s


Yep, good idea, i've similar thoughts. The complexity of human body really holds me back (first you wanna work with a flexible hierarchy data structure, at some point you think ah it *, just hardcode that damn many bones, but this bites you later and you regret it. Back and forth. Next time i'll start with a one legged thing exactly like this.
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 22 guests

cron