GL Golf


What Went Right

NeHe and Cocoa

Learning OpenGL and Cocoa in three months is no easy task! The first step was reading my uDevGames 2002 prize, ‘Building Cocoa Applications.’ This is a great book; after reading about 200 pages and building the project with the book, I had a solid understanding of what Objective-C was, and the incredible powers of object oriented programming.

Next was learning OpenGL, which seemed twice as intimidating and complex. Actually, it turned out to be the best thing to happen to this project. Using the tutorials from NeHe, I was able to learn the basics of OpenGL in only a few days. OpenGL allowed me to get a visual start to GL Golf very quickly. Using a height map made in Photoshop, I could create decent quality levels very fast.

A Good Math Background

Having already completed trigonometry and algebra three, along with taking calculus, helped tremendously. When you go down to each line of code, everything is just a bunch of numbers, and most are very simple, but some of them are complex enough to give you a headache. After digging through about 10 different collision detection tutorials, I found one that made sense. After a few weeks of coding, I had collision detection and response implemented, but as I found out later on several occasions, the tutorials had some very big errors. For example, it gave the incorrect equation for finding where a ray and triangle intersect, which caused the detection not to work at all. So to make a long story short, keep taking higher-level math courses, because that’s what programming is all about.

iChat and iDevGames.com

Without the help of the iDevGames community there is no way I would have finished this game. Whether it was something as simple as asking how to convert a char array to NSString, or asking how to get smooth shading implemented, someone was always there. Thanks to everyone that helped!

What Went Wrong

My Stupidity

Often programmers do something wrong, but it still works anyway. This happened to me, and it was such a big mistake that it cost me an 80 percent slowdown. Luckily it was something as simple as calling GL_Begin(TRIANGLES) about 4,000 times each frame, when I really only needed it about 10 times. This alone multiplied my frames per second by five, making the game playable on almost all Macs.

Lack of Motivation

This is the biggest problem plaguing independent programmers today, and I’m no exception. If I programmed 20 hours a week every week of the contest, there’s no doubt in my mind that my game would have been twice as good. I had spurts of time where I programmed 20 hours in two days, and then times where it took me three weeks to get 20 hours of work in. I don’t know any good ways to fix this; you just have to do it, and when you see new results the urge to program will come back.

The Forum

I spent way too much time reading the forums while developing GL Golf. This was both a good and a bad thing. While I received much needed help from forum members, I also drained lots of time there. For some reason I would check the forums as often as I compiled my game, which ate up valuable developing time.

Tools

My primary IDE for GL Golf was Project Builder, with a little help from METAL Basic. I used METAL to reformat my Meshworks animated models to a nice useable text file. I used Meshworks to make the golf club (which will be changed shortly), and Photoshop 7 to do all the other graphic work. I also used Photoshop to make the levels. While it was hard to actually make a hole, one could be created in 10-20 minutes. My development system was a Quicksilver 733MHz G4 with a Geforce2 MX card. This was a good machine to use, because it was an average system, which kept my system requirments low.

Summary

Overall GL Golf was a great experience, and the uDevGames 2003 Contest made it all the better. I now have the knowledge to program a high quality 3D game, and I plan on doing so for the next uDevGames contest. I plan on continuing development on GL Golf, and within the next few months I hope to have a shareware version finished. I am already looking forward to uDevGames 2004, so get ready for another great game!

  • Genre:
  • Developer:
  • Url:
  • Team size: 1
  • Released date:
  • Project length:
  • Development hardware:
  • Critical applications:

Filed Under: , , , , ,

Recent Forum Threads

About iDevGames

Since 1998, iDevGames has been educating, supporting and enhancing the community of game developers that produce video games for the Apple Mac and iPhone platforms. Get the latest game development news by subscribing to our news feed.