Golf Game
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
Tutorial on doing terrain modeling in XNA
This is probably the first thing you'll want to look at. It will help you get basic terrain modeling. Then you'll want to get the ball colliding with this terrain using proper physics. Then a little magic fairy dust and bam, you have golf :)
This is probably the first thing you'll want to look at. It will help you get basic terrain modeling. Then you'll want to get the ball colliding with this terrain using proper physics. Then a little magic fairy dust and bam, you have golf :)
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.
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.
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]
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]
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).
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).
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.
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.
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement