Start work on full body inverse kinematic animation system

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Start work on full body inverse kinematic animation system

Postby Julio Jerez » Tue Dec 25, 2018 6:29 pm

I am opening this thread to talk about the teh next generation of player controller.
Basically this will be a full body ineverkinematic controller tah will wiork with an blend animation tree system.
I am interested in people option since this is alway an artea were people have more experience than with normakl rigid body dynamics. so it will be good if the interected people voice their recommendation.
My goal is to make it as end user agnostic as possible. bu that si no always and option

The thionk I am looking for are stuff like
how the APi should look like,
what feactures are expected.
would be capable of producing preceducal aniamtions.
or anything you thonmk is relevant

Joe, if you are reading this, you will probably be disappointed, thinking I caved.
but don't be, I have the solve r fully implemented already, but going to the full inverse dynamics will be the next step.
having an animation system is not a bad idea for every day stuff, even stff like an articulation can use animated part, plus many robotic system do Ik to get position and them conver to inverse dynamics.

anyway I start this and let us see hwo far we get the next four days of the Christmas break.
I start by adding the loader and a model that Dave provide.
Julio Jerez
Moderator
Moderator
 
Posts: 10585
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Start work on full body inverse kinematic animation syst

Postby JoeJ » Wed Dec 26, 2018 3:44 am

No disappointment here :)

But i have no real experience with animation in games (more from offline animation work).
When needed, i only ever made simple import of data and playback, no blending.
So i have nothing to add and hoping on others...

Otherwise (assuming many others here are small one man teams with no budget for character animation as well, haha), you can just add more comments to your code, e.g. explaining the purpose of each class for noobs if you go the OOP way for the API.

Just one thing, offtopic: Likely we get to the point here where a lot of quaternion conversations become necessary. Most users use xyzw i guess, but you use wxyz. The advantage of the former is easy casting to the vector part without a need to shuffle the data. So if you ever considered to change this, maybe better now than later.
User avatar
JoeJ
 
Posts: 1135
Joined: Tue Dec 21, 2010 6:18 pm

Re: Start work on full body inverse kinematic animation syst

Postby Julio Jerez » Wed Dec 26, 2018 12:42 pm

Is the what being like that a problem?
I wrote like that because that's how you find the in most text books, but yes I can make that change.
All it takes is change the order of the q to be
q1, q2, q3, q0
And if I am do doing any nasty copy or casting it should work.

Any way, Joe, yesterday I committed the final optimizations to the parallel solver.
Is now literally over 50% faster, white being more accurate and stable and now handle the joints, so all in all the entire engine is multicore now.

Most important it is still deterministic but I am not guratiing that, since there are other parts of the engine that lose determinism when multithreaded.

Anyway, I made a new final YouTube video to show the difference.
Unless there is a bug there will be not more changes to teh solver.
Julio Jerez
Moderator
Moderator
 
Posts: 10585
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Start work on full body inverse kinematic animation syst

Postby JoeJ » Wed Dec 26, 2018 2:21 pm

Julio Jerez wrote:All it takes is change the order of the q to be
q1, q2, q3, q0


Ha, yes. Because you have no [] operator i guess this seems all you'd have to change, and you can keep your constructor in the order you are used to :)

This would be very nice, because i do the shuffling each time i exchange data with newton. Pretty sure that's the case for almost all users. I know the academic order is yours, but really every quat lib i have ever seen uses xyzw. Minor advantage with SIMD aligned axis / angle conversion in any case and when working with key frame data the shuffling would sum up.

Julio Jerez wrote:Anyway, I made a new final YouTube video to show the difference.

Forgot the link?
User avatar
JoeJ
 
Posts: 1135
Joined: Tue Dec 21, 2010 6:18 pm

Re: Start work on full body inverse kinematic animation syst

Postby Julio Jerez » Wed Dec 26, 2018 3:10 pm

Julio Jerez
Moderator
Moderator
 
Posts: 10585
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Start work on full body inverse kinematic animation syst

Postby JoshKlint » Wed Dec 26, 2018 3:57 pm

Julio Jerez wrote:https://www.youtube.com/watch?v=6BnFIyZsa1g&feature=youtu.be

That is impressive. Our new engine runs Newton on a separate thread so anything less than 16 milliseconds processing time will render at 60 hz.
JoshKlint
 
Posts: 36
Joined: Sun Dec 10, 2017 8:03 pm

Re: Start work on full body inverse kinematic animation syst

Postby Julio Jerez » Wed Dec 26, 2018 5:04 pm

you should get used to the idea of running the update at two sub steps like I said of that other thread.
The engine is fast enough that it will still run sufficiently fast for must demanding games.
That youtube video is running two sub steps, which is an effective 120 fps and that demo is far more complex than you will ever find in any game.

Doing this two sub step is much better than doing on your side because there are few common things that are shared across steps.
In fact I can make a case that running a 60 with 2 sub step provide a far most stable simulation and on average smoother frame rate because it smooth out the time variation caused by stiffness in the system.
That is one for the reasons the car suspension was vibrating, you set an ultra stiff spring value of 2000 kg/s^2 which lead to some source of resonance problem with the high frequency of that spring combined low sampling rate, this is not me saying this this a real problem with periodic system and sampling rate.

The reason you did not see those issues before was because the solver we not acurate enough to recrate those effect, but as the solver tend to be more accurate, those problems start to show up and need to be solve with the tool or numerical analysis, not with hacks.
These are the rules of the laws of numerical integrations and I am not going back to cover for those hacks.
Newton 3.14 has zero baby sitting protections anymore: not more damping, capping of angular velocity, joint projection or ray cast car on the engine side. all that stuff is gone and is the user responsibility to deal with that by using the method provided with the engine.
This is why Dave joint has the projection, and it was also on the older car model but the new one does not and will not have it. Instead there will be few vehicle models the user can chose from.
Julio Jerez
Moderator
Moderator
 
Posts: 10585
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Start work on full body inverse kinematic animation syst

Postby JoeJ » Wed Dec 26, 2018 5:51 pm

Yeah :mrgreen:

On ancient i7 930, after launching the demo i get those peaks:

1 thread: 200 ms
4 threads: 100 ms
8 threads: 70 ms

Speed up of 3 with 4 cores is pretty good i would say :D :D
(I get very close to 4 with my GI stuff, but i have almost no sync there.)

While playing (pulling out a body) i get up to 20ms, and you have 15 in a similar situation. Try harder to sell me a new system, Intel and AMD, maybe after another decade... haha 8)

You forgot to add AnimatedPlayerController files to github, i had to comment those out to compile.
User avatar
JoeJ
 
Posts: 1135
Joined: Tue Dec 21, 2010 6:18 pm

Re: Start work on full body inverse kinematic animation syst

Postby Julio Jerez » Fri Dec 28, 2018 4:52 pm

no, joe, no, never go against the way of progress.

there are tweaks that can be made to show dramatic performance that can only be acchived with many cores.
Dave Gravel is experimenting with some on the solver, basically he relax the strict condition that for a body to go to rest which is when velocity and the acceleration is below some threshold, in his test he made it so that only the velocity is below that threshold which means a body can potentially go to sleep in some unstable equilibrium.
Then when jacking up the thread count to 14 on a 8 core hyperthreaded AMD, see the results.
https://www.youtube.com/watch?v=nsEv_ZQH_6Y

I did not want to show this, because is not an official endorsed policy of the engine, but look a the results. It does not breaks the engine in anyway because in CPU that solver only works for island larger than 64 joints. The reason I do not make it official is because I am planning to go GPU and there it will need do the calculation for all cases and will make up for the convergence with brute force flops operations and memory bandwith that the CPUs does not have.
Julio Jerez
Moderator
Moderator
 
Posts: 10585
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Start work on full body inverse kinematic animation syst

Postby JoeJ » Fri Dec 28, 2018 5:19 pm

Impressive! :shock: Why not expose it only for CPU?

However, if i have to go with 'progress', i would better invest in one of those RTX GPUs for what i'm doing ;)
But at the moment reducing compile times would be the only reason to update CPU maybe.
User avatar
JoeJ
 
Posts: 1135
Joined: Tue Dec 21, 2010 6:18 pm

Re: Start work on full body inverse kinematic animation syst

Postby Julio Jerez » Tue Jan 01, 2019 9:14 pm

if you saw that was impressive, check this out, is almost like redefining the laws of physics, :o :shock: :twisted: :D
but with all real physics, no cheats
https://www.youtube.com/watch?v=_OWTJx7 ... m-comments

is a long video go to 18, or somewhere around 10 so that you can see silos full of stuff,
Dave is a brave man, I would never do anything like that fearing it would not work but here we are. :mrgreen:

Joe for what I can hear, those RTX gpu, are optimized for BVH queries for ray cast, that mean they can probably be use for solving analytical base contact point calculation. so that's one step forward in the direction for having full GPU physics, As it stands now collision would be hardest part to do in GPU if and when we get there.
Julio Jerez
Moderator
Moderator
 
Posts: 10585
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Start work on full body inverse kinematic animation syst

Postby JoshKlint » Wed Jan 02, 2019 2:08 pm

What do we set to make it that fast? Newton isn't anywhere near that fast on my machine.
JoshKlint
 
Posts: 36
Joined: Sun Dec 10, 2017 8:03 pm

Re: Start work on full body inverse kinematic animation syst

Postby Julio Jerez » Wed Jan 02, 2019 2:54 pm

Now that we support plugin Dave and any user is free to relax some of the more rigorouss criteria of the core solvers.
Plus he has an 8 core 16 thread amd cpu, that helps.

The point Josh is that, that kind of stuff, having many stack boxes means nothing to a legitimate developer that need to met a deadline, the only people that find that stuff important are the engine appraisal that lurk in forums telling anyone who did some actual work what he shoulded use instead.

In my opinion, the engine now is more than adequate to met the physics demand of the most demanding games out there. And speed at any cost is not something I will ever endorse.

At some point for newton 3.15 or newton 4.0
We will make a gpu base solver that will do both rigid bodies and particle base soft and fluids.
And that will justify the gpu because of the volume of data.
Julio Jerez
Moderator
Moderator
 
Posts: 10585
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Start work on full body inverse kinematic animation syst

Postby Dave Gravel » Wed Jan 02, 2019 3:21 pm

The most big difference is maybe the thread count.
I use the mode Async for update newton in stress time it seen to give better result.

This video here use the normal newton plugin solver:
https://www.youtube.com/watch?v=3bZi3rwcA7k
You can see what is my newton options setup for the scene.

Edited:
Download link update 6 + gamepad.
Here my demo executable:
https://www.mediafire.com/file/i6o2p24d ... o_FIX6.zip
You need a video card compatible with last GL version.
Last edited by Dave Gravel on Sun Jan 06, 2019 7:32 am, edited 9 times in total.
You search a nice physics solution, if you can read this message you're at the good place :wink:
OrionX3D Projects & Demos:
https://www.facebook.com/dave.gravel1
http://orionx3d.googlepages.com/
https://www.youtube.com/user/EvadLevarg/videos
User avatar
Dave Gravel
 
Posts: 613
Joined: Sat Apr 01, 2006 9:31 pm
Location: Quebec in Canada.

Re: Start work on full body inverse kinematic animation syst

Postby JoeJ » Wed Jan 02, 2019 5:16 pm

Julio Jerez wrote:Dave is a brave man, I would never do anything like that fearing it would not work but here we are.


Haha, i would not dare to do this too :) Looots of bodies :shock:


Julio Jerez wrote:Joe for what I can hear, those RTX gpu, are optimized for BVH queries for ray cast, that mean they can problem be use for solving analytical base contact point calculation. so that's one step forward in the direction for having full GPU physics, As it stands now collision would be hardest part to do in GPU if and when we get there.


I'll send you API docs by PM. (Registration on some MS site was necessary to get it)
BVH is currently blackboxed, but if you only need to trace rays it might work.
I don't know if you could intersect a box against the BVH, but i guess not.

I do a lot of wining and warfare about such restrictions in this forum:[/url]https://forum.beyond3d.com/posts/2053654/[url]
Finally a guy responded who has implemented GPU generated command buffers extension.
If they add the ability to generate barriers, we can do full work generation on GPU! :o
I hope thy consider this. If so, you might prefer Vulkan over DX12 if you want to do coll. det. on GPU.
User avatar
JoeJ
 
Posts: 1135
Joined: Tue Dec 21, 2010 6:18 pm

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron