Golf Simulation #22

Open
opened this issue Feb 12, 2014 · 17 comments

Projects
None yet
4 participants
Contributor

Cheeseness commented Feb 12, 2014

 The titular aspect of the game (golf, not bad) has been highlighted as important by Patrick. His suggestions are to aim for a simplified, predictable golf simulation similar to Mario Golf on the Nintendo 64. Ball ballistics/collision physics Driver swing mechanic Putt swing mechanic Aiming controls (rotate around the ball) Club variations? (multiply power based on club type?)

Contributor

Vaakapallo commented Feb 13, 2014

 I'll start testing some very simple ways to move a ball around. First step is being able to hop the ball forwards when close to it. I'm not sure I can pull off all the things listed here, so anyone is free to play around with this as well.
Contributor Author

Cheeseness commented Feb 14, 2014

 Great! :D

 A very important aspect of golf physics is related to the golf ball's surface , you know that little dimples the ball has, At high speed Navier-Stokes equations ( http://en.wikipedia.org/wiki/Navier%E2%80%93Stokes_equations ) indicate there should be small turbullence vortex forming around that dimples ( http://www.sigmarockets.com/blog/wp-content/uploads/2011/06/golf_ball_drag.1.jpg ) in a way mixed turbulence works as a separation layer between the golf ball and the more stable laminar flow. This is done for various reasons , 1 ) it makes drag harder to decrease a ball's speed and 2) turbulence air flow creates a higher pressure difference , making a golf ball more likely to stay longer on fly.
Contributor Author

Cheeseness commented Feb 15, 2014

 We're not aiming for a hugely realistic sim. An approximation that's solid, predictable and fun is enough :)

 A think an issue with physics simulation is wind conditions ( mostly direction and speed ) , since a particle simulation is out of the question ( too espensive for a realtime simulation).
Contributor Author

Cheeseness commented Feb 15, 2014

 I think that wind simulation would start to move us too far towards realism. We're aiming for something that's too fast paced for dynamics like wind to be anything other than cumbersome.

 LOL! I know , it's just the physiscist in me who gets excited.
Contributor

Vaakapallo commented Feb 16, 2014

 Okay, you can now rotate around a ball, determine the hitting force by pressing up. Then send the ball flying with Space. It flies straight forward in an arc. the force determines the distance and height of the arc. There's a really ugly Gui Box showing you the power of the swing. That's not all though. When you do that, you warp back to your cart and you can drive around while the ball flies. Then by hitting "E" you can go back to swinging mode and hit it again. Then you are back to the cart etc.
Contributor

Vaakapallo commented Feb 16, 2014

 Now you can only change to ball swinging mode when you are close enough to the ball. There's an ugly GUI box to tell you when that is.

Vaakapallo referenced this issue Feb 16, 2014

Merged

Ball hitting mode #51

Contributor Author

Cheeseness commented Feb 17, 2014

 Awesome! I'm looking forward to testing this out :D

pdxaaron commented Feb 17, 2014

 Vaakapallo, this is awesome. I've been working on this, but was trying to use a raycast to determine where the ball was struck to apply torque as well... Everything I try in unity seems easy, but I end up down this crazy rabbithole of a learning curve, and by the time I have something functional, it's been done bigger and better already... Anyhow, would you mind if I ran with this test and tried changing the swing mechanic a bit? My thought was have the character model stationary to the left of the ball, rotation left and right around the ball's axis when aiming, then on mouse down, you would build up the force from pulling the mouse down, then adding to the force and also creating torque to the ball when pushing the mouse forward. I think it would allow for a fast swing which is what we are looking for instead of the 3 click golf swing.
Contributor

Vaakapallo commented Feb 17, 2014

 I wouldn't mind at all. That sounds great.
Contributor Author

Cheeseness commented Feb 17, 2014

 then on mouse down, you would build up the force from pulling the mouse down, then adding to the force and also creating torque to the ball when pushing the mouse forward. This is similar to how we do things in Neverputt, although we don't model torque (and moving the mouse forward has no impact). I'm interested to see what you come up with :D
Contributor Author

Cheeseness commented Feb 19, 2014

 @pdxaaron, @Vaakapallo Were you able to make any forward progress on this front?

Open

Contributor

Vaakapallo commented Feb 21, 2014

 Nope, no yet, I ended up integrating this to the driving sim #78 . Though that should be compatible with completely changing the way the golfing mode works.

This was referenced Feb 21, 2014

Open

Merged

Merged

Fixed ball simulation in level_full and added @MaritalWheat's power bar. #101

 Regardin golf ball "Out Of World" issue , my suggestion is : there might be a way to avoid the ball issue by using non renderable copy of terrain geometry and use it as a ball collision detection so if the ball collides with this underground geometry is simply move up back again you might avoid performance penalties by using occlusion culling though another less expensive solution would be to enclose all the terrain only geometry inside a box collider and respawn the ball accordingly then.

Merged

Merged

Merged

Closed

Open

olldray referenced this issue Feb 28, 2014

Closed

prevent ball falling through world #165

Contributor Author

Cheeseness commented Feb 28, 2014

 @olldray has suggested that the current issue with the ball sometimes falling through the terrain may be the result of the ball being parented to the buggy (re-parenting the ball to the scene apparently resolves the issue) and that Unity is constantly working out the relative movement between cart and ball, and cart movement across terrain causes the ball to jiggle through the terrain. This is consistent with the symptoms we've seen. I think we should look at what options are available to us once we get the currently outstanding networking branches merged back in.

Closed