• Advertisement
Sign in to follow this  

How to touch ball exactly in vollayball game

This topic is 980 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In a vollayball game dev, for touch ball exactly, I calc the ball path, and the position of the animation which will touch ball with hand, but for the timer system error, it will always little distance between ball and hand.

 

Is anyone know how to solve this problem.

 

DOA vollayball game is the peffect example. but sadly I dont know how it do it ..

 

Thanks for anyone's help!!

 

I attach a picture, flag 1 is the ball, 2 is hand, and 3 is the perfect touch position.Now it is has little distance between hand and ball.

Share this post


Link to post
Share on other sites
Advertisement


In a vollayball game dev, for touch ball exactly, I calc the ball path, and the position of the animation which will touch ball with hand, but for the timer system error, it will always little distance between ball and hand.
How did you inferred this is a time related problem?

 

BTW, none of the two positions look right to me. Would you rephrase?

Share this post


Link to post
Share on other sites

 


In a vollayball game dev, for touch ball exactly, I calc the ball path, and the position of the animation which will touch ball with hand, but for the timer system error, it will always little distance between ball and hand.
How did you inferred this is a time related problem?

 

BTW, none of the two positions look right to me. Would you rephrase?

 

1. I calc where to catch the ball when ball fly, and calc the time that perfectly touch ball.

2. I print play animation time and touch ball time

3. I found for the system timer, there are 0.03 to 0.06 second error.

 

I apologize for my poor english. hope you can know what I say. Orz

Thanks for your reply.

Share this post


Link to post
Share on other sites

I think you'd need to use IK to position the hands on the ball.

I also think this way, but I don't use it before, and have no good idea to use it.

Can you give me more detail guide?

Share this post


Link to post
Share on other sites

 

I think you'd need to use IK to position the hands on the ball.

I also think this way, but I don't use it before, and have no good idea to use it.

Can you give me more detail guide?

 

 

 

Not really as I only ever did it once a long time ago.  

You'd need to look up an IK algorithm yourself (there are several).  

But basically it would allow you to move the wrist / hand bone to any position you want while the arm moved naturally behind it.

Share this post


Link to post
Share on other sites

 

 

I think you'd need to use IK to position the hands on the ball.

I also think this way, but I don't use it before, and have no good idea to use it.

Can you give me more detail guide?

 

 

 

Not really as I only ever did it once a long time ago.  

You'd need to look up an IK algorithm yourself (there are several).  

But basically it would allow you to move the wrist / hand bone to any position you want while the arm moved naturally behind it.

 

Thanks

Share this post


Link to post
Share on other sites

"Normal" animation is done with Forward Kinematics.  It involves directly rotating bones in order down the chain to get the rotations you want for you animations.  But, this is only generally good for animations that you know beforehand.  For this application, you need Inverse Kinematics(IK) because you don't know where the ball is going to be and what direction it is in.  IK works by tryinug to force the last bone(the hands in this case) into a certain position and rotation, and the moving backwards up the chain(in this case, up to the shoulder probably) and rotating those bones into the best position possible, without breaking rules, which include rotating the wrong way, or maybe too distant.  IK is typically done in a loop of sorts, iterating the best possible positions until you get the best one.  Of course you have to limit it to only a couple of cycles for speed.  You also have to consider the distance, as IK can't(shouldn't) break the bone structure and the hand can only go so far from the shoulder.  But then the algorithm would get as close as possible within the amount of cycles alloted.

 

So for the volleyball, you need to calculate the the trajectory of the ball.  Where is it going, and how soon will it be there?  Will the character be there on time?  This will help determine whether you want a regular dig or a full-on dive, and how fast they need to move, as in will it be a quick run or a relaxed walk(maybe keeping the face expression smiling on one, and exaggerated on the other).  You will need to know at that point the optimum position and rotation of the hands for when they contact the ball.  This will be calculated based on where they intend the ball to go(or maybe slightly random if they have no chance of getting there with time for control and are doing it in deperation).  Then you calculate the IK based on that position while moving them and animating them into position.

 

What game engine(if any) are you using?  Some of them include IK in some form as part of the package.  And others may not include it but have it implemented by a 3rd party.  I would look into that as IK tends to be somewhat complicated and at the least a time stealer to implement.  I can confirm that Unity 5 and Unreal Engine 4 both have IK implemented and is generally easy to use.

Share this post


Link to post
Share on other sites

"Normal" animation is done with Forward Kinematics.  It involves directly rotating bones in order down the chain to get the rotations you want for you animations.  But, this is only generally good for animations that you know beforehand.  For this application, you need Inverse Kinematics(IK) because you don't know where the ball is going to be and what direction it is in.  IK works by tryinug to force the last bone(the hands in this case) into a certain position and rotation, and the moving backwards up the chain(in this case, up to the shoulder probably) and rotating those bones into the best position possible, without breaking rules, which include rotating the wrong way, or maybe too distant.  IK is typically done in a loop of sorts, iterating the best possible positions until you get the best one.  Of course you have to limit it to only a couple of cycles for speed.  You also have to consider the distance, as IK can't(shouldn't) break the bone structure and the hand can only go so far from the shoulder.  But then the algorithm would get as close as possible within the amount of cycles alloted.

 

So for the volleyball, you need to calculate the the trajectory of the ball.  Where is it going, and how soon will it be there?  Will the character be there on time?  This will help determine whether you want a regular dig or a full-on dive, and how fast they need to move, as in will it be a quick run or a relaxed walk(maybe keeping the face expression smiling on one, and exaggerated on the other).  You will need to know at that point the optimum position and rotation of the hands for when they contact the ball.  This will be calculated based on where they intend the ball to go(or maybe slightly random if they have no chance of getting there with time for control and are doing it in deperation).  Then you calculate the IK based on that position while moving them and animating them into position.

 

What game engine(if any) are you using?  Some of them include IK in some form as part of the package.  And others may not include it but have it implemented by a 3rd party.  I would look into that as IK tends to be somewhat complicated and at the least a time stealer to implement.  I can confirm that Unity 5 and Unreal Engine 4 both have IK implemented and is generally easy to use.

I use Unity5, and I found ik of Unity5 self and FinalIK.

Share this post


Link to post
Share on other sites

I don't own FinalIK myself, but if Unity's IK doesn't do it, I highly recommend it anyway.  I've seen videos of it in action, and it does far more than Unity's IK does.  Now that I know you are using Unity 5, I know that even if you have the free version, all of the IK functions are available to you.  Therefore, I recommend you try it like that first, as I think Unity's IK should be enough for this.  If not, than I'm sure FinalIK will make it work so you would purchse that.  In any case, you won't have to calculate any of it yourself except the trajectory of the ball so you know what angle and what position to put the hands in, and whether the player should dive, walk, or run to the position, or simply watch the other player do it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement