Sign in to follow this  
LYDgames

Golf Game

Recommended Posts

LYDgames    122
Hi everyone, I want to program a golf game but have no idea where to start, which engine to use. etc. I want to just make a one or two hole game, but be able to have certain clubs perform differently, give bonuses, etc. I would also like a power and accuracy bar as well. Any help would be appreciated.' Lyd

Share this post


Link to post
Share on other sites
Hmm I'd work on getting the ball mechanics going first. You can do a top-down golf game easily enough with a bitmap representing the terrain type (fairway, rough, bunker, green, etc., and making the assumption that the course is flat). Moving to 3D shouldn't be too tricky after that, then add slopes and whatnot.

Note that doing just one or two holes is just as complicated as doing 10 or 100000, it would just take more time. [EDIT: Since the course is just data, not the golf game engine, after all]

I'm sure you will be able to look up about golf ball physics on the net, but you can start simply by assuming the ball just moves under gravity with no air resistance, then add air resistance, spin, friction when hitting the terrain, etc.

It's not an easy game to do for a beginner though.

Share this post


Link to post
Share on other sites
ukdeveloper    264
Golf's a complicated game, when you really consider it.

How realistic do you want it? You're going to have to watch for things like swing angle and speed of the club, wind speed and direction, any changes in the ball's movement like falling through tree branches, and most of what Paradigm Shifter said. Bear in mind things like the type of ground (rough, fairway, green etc.).

I don't want to sound patronising, but why not go out and play a real round of golf? Pay close attention to everything that happens during the game. The speed of the club and the angle at which it hits the ball, and everything else I mentioned.

Good luck [smile]

Share this post


Link to post
Share on other sites
Programming golf games is hard. Playing golf well is even harder :)

If your focus is on golf physics, stick with a top down view (scale the ball sprite to represent height above the ground, or do an isometric view). Start off with all-flat terrain. Check out golf games from years ago such as golf on the game boy or the sega master system for example. Even later golf games on the megadrive (genesis in america?) assumed the terrain was flat except on the green (PGA golf for example).

If you are already familiar with mechanics (such as movement of a particle down a slope), you can probably cope with sloped terrain. You can then just grab a 3d engine for rendering but modelling the course is going to be a big job too.

Good luck anyway. I worked on a golf game for the PS1 (just a conversion of the PC version), it sucked big time. It was like resident evil does golf, all pre-rendered graphics (they were nice though).

Share this post


Link to post
Share on other sites
dave    2187
Quote:
Original post by ukdeveloper
Golf's a complicated game, when you really consider it.

How realistic do you want it? You're going to have to watch for things like swing angle and speed of the club, wind speed and direction, any changes in the ball's movement like falling through tree branches, and most of what Paradigm Shifter said. Bear in mind things like the type of ground (rough, fairway, green etc.).

I don't want to sound patronising, but why not go out and play a real round of golf? Pay close attention to everything that happens during the game. The speed of the club and the angle at which it hits the ball, and everything else I mentioned.

Good luck [smile]


The angle of approach is largely irrelevent in games, as is club head speed. most golf games implement a power bar approach of some sort and keep the swing looking the same regardless of how you time the shot. The swing animation only changes per-club.

Share this post


Link to post
Share on other sites
Well the animation has little to do with the underlying mechanics. In the game I worked on, I think we had a fixed angle for each of the clubs (although I think this may have changed if you hit low [resulted in a steeper angle] or high [shallower angle] on the ball), but we did just scale the initial velocity based on the power bar. I think that over powering added on a random factor to the accuracy [i.e. hit location on the ball] as well.

I was always fascinated by how the ball seemed to skirt the edge of the hole (the classic "ooohh" moment in putting), but in reality that is dead easy, just apply a force towards the middle of the hole once you get within a certain distance.

Share this post


Link to post
Share on other sites
Jettoz    288
Just a small suggestion, make a simple 2D golf game to get the hang of some things and than make a 3D version after words. I'm not sure if you're new to programming/game programming but since your thread is in the beginner section I'm going to assume that you're new. Start simple before going onto something more complex, it will make it a lot easier in the long run.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this