Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1324975 Posts in 59763 Topics- by 50983 Members - Latest Member: kleofasdanuta

December 14, 2017, 05:03:50 am

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Ball in Soccer Game
Pages: [1]
Print
Author Topic: Ball in Soccer Game  (Read 364 times)
Riso
TIGBaby
*


View Profile
« on: May 29, 2017, 02:24:45 am »

Hey guys Smiley

We are working on a soccer game made in Unity. However I am unsure how to approach Ball movement.
I want the game to be deterministic therefore i wont be using physic based logic.

My question is : How would you approach Ball movement (e.g.  passing ball from player to player, .. ) in a most versatile, efficient approach.

I thought about few ways how this can be done:

1: To existing player animations (run, pass, free kick,...) add another empty transform and animate it.  
   Then attach ball to this platform for  player who currently has ball.

However This can bring up quite few issues (for example, if we try to change animation sets, we need to add and animate empty transform all over again ).

2. Control the ball by script - this comes with cost of having it not look as smooth as in animation approach.

If you could share your ideas or experience from handling such issue that would be great Wink

Thanks a lot Smiley

« Last Edit: May 29, 2017, 02:32:33 am by Riso » Logged
Eigen
Level 10
*****


Brobdingnagian ding dong


View Profile WWW
« Reply #1 on: May 29, 2017, 05:27:47 am »

Is it 2D or 3D? I would approach it by working out the simulation first. The players are vectors and ball is just a position. Work out the math to move the ball between players, and only then render it (by positioning the ball entity according to your simulation). I think trying have the ball as physics object or whatever is not going to work properly. I mean it will work, but is not the best way to go.
Logged

missionctrl
Level 0
**



View Profile
« Reply #2 on: June 02, 2017, 07:30:05 am »

You're trying to avoid "physic based logic" but you don't really need to.  As the last post mentioned, the "physics" would consist of nothing but basic vector math operations and it will be 100% deterministic.

However, this is only for passing and shooting.  Are you looking for a solution for dribbling?  If so, then animations might be the best approach.  Use the basic vector math for when the ball is moving by itself.  And then when a player gets control of the ball, lock it to that player's position and use animations for the dribbling.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic