• Create Account

Football (soccer) physics

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

3 replies to this topic

#1Retro Owl  Members

172
Like
0Likes
Like

Posted 21 July 2014 - 12:16 PM

Hello!

I've been looking for a beginner's tutorial on football physics, but can't seem to find one.

I'm currently trying to find out how the ball slows down after it has been kicked (on the ground). I don't know how to implement the physics in my game.

So, let's say a player kicks the ball with a speed of 100 (just a variable here). How does the ball actually slow down? It's obviously not linear, as in the beginning the ball keeps its speed for quite long and then stops moving fairly fast. I've been reading articles about the physics side, but I can't think of a way to implement the actual slowing down in my game.

#2BeerNutts  Members

4288
Like
1Likes
Like

Posted 21 July 2014 - 12:34 PM

IMO, this is a great place for using a 2d physics library.  chipmunk and box2d  are 2 great examples.

Basically, what I would do in this case is, when the ball is kicked, if it's in the air, you provide some small amount of friction, as well as gravity.  The small friction is the air friction.  When the ball hits the ground, it should perform the typical bounce, but also there should be larger amount of friction when the ball is in contact with the ground.  Once the ball is just rolling, it will use the ground's friction to slow it to stop.

Good luck and have fun.

My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)

#3Flonk  Members

384
Like
4Likes
Like

Posted 21 July 2014 - 01:25 PM

Most of the slow down at high speeds comes with drag, which scales quadratically with speed. So just have a

new_speed = old_speed - old_speed^2 * coefficient

and tune the coefficient until it feels right.

#4Gian-Reto  Members

6701
Like
0Likes
Like

Posted 22 July 2014 - 02:57 AM

any chance to use a physics library in your game? I know, some people like to write their own physics stuff, and I know from my expierience that more ofen than not, in PhysX you have to fight the physics more than they help you, but for easy problems like a rolling ball and friction, at least PhysX is pretty good.

AFAIK PhysX and bullet Physics are free to use?

If you are more interested in coding it yourself, or you hate putting a big library in your game, ignore my whole comment

Edited by Gian-Reto, 22 July 2014 - 02:58 AM.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.