Double-Fine-Game-Club / bad-golf-community-edition

A community developed version of Patrick Hackett's Bad Golf Amnesia Fortnight pitch!
Other
52 stars 38 forks source link

Golf Simulation #22

Open Cheeseness opened 10 years ago

Cheeseness commented 10 years ago

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.

Vaakapallo commented 10 years ago

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.

Cheeseness commented 10 years ago

Great! :D

The-Mad-Pirate commented 10 years ago

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.

Cheeseness commented 10 years ago

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

The-Mad-Pirate commented 10 years ago

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).

Cheeseness commented 10 years ago

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.

The-Mad-Pirate commented 10 years ago

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

Vaakapallo commented 10 years ago

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.

Vaakapallo commented 10 years ago

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.

Cheeseness commented 10 years ago

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

pdxaaron commented 10 years ago

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.

Vaakapallo commented 10 years ago

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

Cheeseness commented 10 years ago

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

Cheeseness commented 10 years ago

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

Vaakapallo commented 10 years ago

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.

The-Mad-Pirate commented 10 years ago

Regardin golf ball "Out Of World" issue , my suggestion is :

Cheeseness commented 10 years ago

@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.