crowd, different animation on right and left turn
#1
Question 
Hi,

I'm working on crowd simulation of skiers along a slope. The final aim is to have skiers, following a spline (and bound on surface), and having different animation wether they turn right or left.
I could already detect what direction particles turn via a property test (spinZ) connected to the actor node (and only to this node, it didn't work in main event, particles seem not to have any spin).
Now my actor has a color change depending on its spin.
But I need to extend this to an "actor animation" node depending the direction of turn.

Naively I thought I could add an actor animation node after actor output, but it doesnt work.
I tried to use Custom Properties and get the values in the main event but it didn't work either.

Any idea? Thx

Screenshot and max file provided


Attached Files Thumbnail(s)
   

.max   TyFlowSkieurs.max (Size: 868 KB / Downloads: 262)
.max   TyFlowSkieurs_2017.max (Size: 872 KB / Downloads: 233)
  Reply
#2
I've updated the max files because There was a noise float in the birth rate which does not work anymore when file is re-opened.
  Reply
#3
As you can see on this new capture, it displays 2 different spin datas. The one above is the particle spin, and the other one is the actor spin.
You can notice that particle spin sticks to 0 while actor spin seems good : spinZ has positive value when turning left and negative when turning right.
I tried to add a spin node by travel direction but it gives me incorrect values.
How can I copy the actor spin to particle spin data or collect the correct data, or can I use actor spinZ to send to next event to change the actor animation by spin value?

Thx


Attached Files Thumbnail(s)
   
  Reply
#4
I could enter the events with an other graph configuration. As you can see the property test works. But for some reason the "actor animation" node still does not work.
With this graph if I put the node in event_009 it plays the animation, but it does not in any other event, so it won't play after a property test.
Is it a kind of bug or something I miss?
I really really need help  Huh


Attached Files Thumbnail(s)
   
  Reply
#5
Actor animation must be set on the actor root particle, not its rig particles. From your screenshot it seems that you send out the root particles from the Actor operator, so you're then trying to apply the animation to the rig particles which won't work.

If you want to trigger an animation in the root, by some event that happens in a rig particle, you can use an Actor Collect operator to get the actor parent/root....and immediately send it to an event where the new animation happens (set the 'collect' setting to 'collect actor (parent)' and the 'test TRUE" setting to "collected particles"). Basically that tells the rig particle "grab my actor parent and send it to another event"....from there you set the new animation on it in the other event.
  Reply
#6
Thank you, it works... on most particles... but some particles have weird behaviors, jittering, or as if some particles don't blend the animations.

The capture is a mix between 2 frames. The surrounded particle "jumps" from "Left Anim" to "Front Anim" in 1 frame while other particles just do a perfect blend.

I feel I'm so close to have the result I'd like.


Attached Files Thumbnail(s)
   
  Reply
#7
If you upload the file I can take a look at it when I get the chance.
  Reply
#8
Thank you very much. I've exagerated a bit the attraction value in the path follow to make the unwanted behavior more noticeable.


Attached Files
.max   TyFlowSkieurs_v1.11.max (Size: 1.25 MB / Downloads: 240)
  Reply
#9
Hey Tjommas,

So I looked at your file.

Firstly, the jittering is caused by the fact that skiiers are allowed to move between events immediately, as soon as their spin crosses a certain threshold. This means that if the spin values waver over the threshold, the skiiers will jump between events quickly. A simple solution to this is just to prevent skiiers from immediately switching between events as soon as they change their direction. So in your Property Tests, instead of "Continuous", set their timing to "Event Age" with a range of something like 5-1000...that means they cannot switch to another event until they've stayed in the current event for at least 5 frames...which completely gets rid of any jitter.

As for the animation blending issue, that's caused by a different thing....basically because your blend is set to 20 frames, there are times when skiiers won't be finished blending between animation A and B before they've been told to start playing animation C (ie, they moved through events so quickly that the first blend hasn't finished before the next one is set to begin)....which is causing the animation to jump because the blend isn't designed to work between 3 or more animation clips...but that's what is required in your setup. This is technically a bug in tyFlow that I will have to find a solution to. I will hopefully have this resolved in the next build, which I hope to post sometime this weekend.
  Reply
#10
Ah great! Big Grin The jittering is solved indeed. I'm waiting for the next release then.
Many thanks. You're the best!
  Reply
#11
Next build got delayed a bit but it's almost ready.

As you can see here...silky smooth. Couple of extra tips to smooth out the file you sent: further Turbosmooth the hill geometry, turn 'rotation' bind off in all the Object Bind operators, and reduce the Rotation operator interpolation (try 0.5).

http://www.tysonibele.com/Junk/skiPreview.mp4
  Reply
#12
wow good job Big Grin
  Reply
#13
Thank you very much Tyson, I'm working back a bit on the skiiers. Seems good (and funny) so far. I'll post a result when it's done Smile
  Reply
#14
Hi Tyson!
I'm close to finnish but I have a couple of questions:

1- Can I tell tyflow not to render the bones of my skiiers? and keep render other hierarchical objects (helmet, goggles, skis...) ... Edit : OK I could do this with a transparent material but I still have some shadows  Angry

2- Since skinned mesh are not treated like other meshes, it won't inherit its material, and therefore, I can't randomize the material of my skiiers by particleID... Is there a simple method ?

Thanks a lot... a video soon if I can solve this.
  Reply
#15
OK I got it... a simple Material ID (random) connected to the actor output, and a material (with randomization by mat ID) applied to the tyflow skinned mesh.

Then, I could get it done Smile I'm satisfied with the result



There are 3 kinds of skiiers (bad,medium and good skilled), the animations could be even better. Also, skiiers could be converted to ragdolls when they collide one to an another. But I'm stopping there because I won't have time to do more research and it would be useless for my purpose.

And I'm glad to share my work (textures, helmet and goggles not included).


Attached Files
.zip   TyFlowSkieurs_v1.20b.max.zip (Size: 7.73 MB / Downloads: 303)
  Reply
#16
Quote:Can I tell tyflow not to render the bones of my skiiers? and keep render other hierarchical objects

Yes, you can filter them into another non-renderable event. Do this by setting appropriate properties on them that you use to filter them later using the tyActor Properties window, or if they are actual max bones, there is a specific Property Test available to test for them that you can use.

Quote: Since skinned mesh are not treated like other meshes, it won't inherit its material, and therefore, I can't randomize the material of my skiiers by particleID... Is there a simple method ?

Future tyFlow versions will have an improved workflow for this. In the meantime you have to duplicate your actor and do it all manually, then import multiple actors into your flow.
  Reply
#17
(12-11-2019, 06:40 AM)tyFlow Wrote: In the meantime you have to duplicate your actor and do it all manually, then import multiple actors into your flow.

As you can see in the video, it worked without doing that, just with a simple material ID (random) connected to the actor node output and I used a vraymultisubtex map filtered by material ID  Smile
  Reply


Forum Jump: