ebook img

Game Programming Tricks of the Trade PDF

1043 Pages·2002·14.133 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Game Programming Tricks of the Trade

Game Programming Tricks of the Trade This page intentionally left blank Game Programming Tricks of the Trade Lorenzo D. Phillips Jr., Editor André LaMothe, Series Editor © 2002 by Premier Press, a division of Course Technology. All rights reserved. No part of this book may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system without written permission from Premier Press, except for the inclusion of brief quotations in a review. Premier Press, Inc. is a registered trademark of Premier Press, Inc. The Premier Press logo and related trade dress are trademarks of Premier Press, Inc. and may not be used without written permission. All other trademarks are the property of their respective owners. Publisher:Stacy L. Hiquet Marketing Manager: Heather Hurley Managing Editor:Sandy Doell Acquisitions Editor:Emi Smith Project Editor:Argosy Publishing Editorial Assistants:Margaret Bauer and Elizabeth Barrett Marketing Coordinator:Kelly Poffenbarger Technical Reviewer:André LaMothe Interior Layout:Argosy Publishing Cover Design:Mike Tanamachi CD-ROM Producer:Carson McGuire All trademarks are the property of their respective owners. Important:Premier Press cannot provide software support. Please contact the appropriate software manufacturer’s technical support line or Web site for assistance. Premier Press and the author have attempted throughout this book to distinguish proprietary trade- marks from descriptive terms by following the capitalization style used by the manufacturer. Information contained in this book has been obtained by Premier Press from sources believed to be reliable. However, because of the possibility of human or mechanical error by our sources, Premier Press, or others, the Publisher does not guarantee the accuracy, adequacy, or completeness of any information and is not responsible for any errors or omissions or the results obtained from use of such information. Readers should be particularly aware of the fact that the Internet is an ever- changing entity. Some facts may have changed since this book went to press. ISBN: 1-931841-69-1 Library of Congress Catalog Card Number: 2001099848 Printed in the United States of America 02 03 04 05 BA 10 9 8 7 6 5 4 3 2 1 Premier Press, a division of Course Technology 2645 Erie Avenue, Suite 41 Cincinnati, Ohio 45208 I dedicate this book to Sayun, Lorenzo IV, Tylen, and to the rest of my other family and friends. —Lorenzo D. Phillips, Jr. Foreword I started programming games over 25 years ago, and although I have been on both sides of the business, that is, the development side and the business side, I can say wholeheartedly, I much prefer making games to selling them! The game business is like magic to me. Although, I am practically as old as Yoda compared to many of the new young game programmers, all these years have clarified in my mind that I sim- ply love making and playing games. Video games are the most impressive artistic accomplishments of our generation. They are the fusion of science, art, sound, music, and prose. And the cool thing has been watching them grow from nothing to photo-real simulations that have you blinking your eyes saying, “that looks real!” I remember the very first game that I played—Pong. Shortly after, I played Space War in an arcade in Oak Ridge Mall, San Jose, CA. I was amazed by these games. I couldn’t believe my eyes; it was like magic, but better, since it was real. It was real, and I could learn how to do it. So I decided that I would spend my life learning how to do it, and I have pretty much done that. In my travels, I have met the most interesting people you can imagine, from Bill Gates to Steve Wozniak. I had lunch with the guy who invented Defender, and sat in a dark room and talked about DOOM with John Carmack. I can say without a doubt there’s nothing in the world I would rather do. And now with the turn of the century behind us, it’s up to you, the next generation of game developers, to take games to the places that we all dream about. I admit I would much rather make games than write books, but writing books is much more constructive and more meaningful to me, personally, than writing games. However, I am eager to start creating games as I did in the ’80s and early ’90s. But, for now, I still have a few tricks up my sleeve, and this book is one of them. When I first came up with the idea for a compilation book, the first comment to me was “the Game Programming Gems series is doing well, and in fact, you are one of the co-authors!” True, but this book is completely different. Personally, I have never gotten that much out of books that have small 1- to 5-page articles. I believe that a compilation book needs to have coherent and complete chapters wherein explain a topic to a point that the reader really learns how to do it. So, my goal was to have a Foreword vii compilation book with hefty 20- to 50-page chapters that are complete, more in- depth, and written in tutorial style. Additionally, I wanted a cohesive look and feel to them. With all that said, this book hits the mark. It’s the first in our series of compilation books, but I think that it more than delivers its weight in Pentiums. There are some really interesting subjects covered in this book from advanced mathematics to scripting, as well as topics like OpenGL, 2D, Skyboxes, Optimizations techniques, Assembly Language, and so on. Each topic is a complete treatise on the subject, not just introductions or little blurbs that leave you wondering. Of course, the authors are to thank for the content, but Lorenzo Phillips, the man- aging editor of the book, is to thank for making this idea a reality. If you’re reading this book and have worked on any kind of engineering job in your life, you will appreciate the incredible complexity of getting people to do their jobs on time. Now, try getting 15 to 20 people to all do their jobs on time and do it with consis- tency—that’s a miracle. Lorenzo is really the person who I feel should get the most “props”—without his determination and hard work, this book would just be anoth- er idea and would never have come to fruition. Lastly, as someone with experience in the trenches, and now that I have your atten- tion, I would like to leave you with some real advice about making games—or mak- ing anything for that matter. This stuff is hard—really hard. If you are serious about it, then, as I have said many times, forget about having fun, forget about vacations, forget about that cute blonde next door—it’s not going to happen (especially the cute blonde). You simply don’t have time for anything, but work, work, and work. Talk is cheap; don’t waste your time on web boards describing your newest game, engine, technology, whatever—spend your time making it! Remember, the few short moments of free time we have fade away all too quickly, and reality sets in. All those things you wanted to do, thought you would do, never get done. So while you have the chance, do everything you can and finish it. Whatever it is. . . André LaMothe “Surrounded by 14 computers in his laboratory and one of them is getting impatient!” Acknowledgments Wow, my first book project is finally complete! There are so many people to thank that I hope I don’t forget anyone, but please know that if I forgot you, it was not intentional. First and foremost, I have to thank my mother, Novella Phillips, for her guidance, love, and support and for keeping me out of harm’s way all these years. I love you, Mom. I’d like to thank my wife, Sayun Phillips, for her love, her support, and for growing with me over the years. I thank you for making sure that I ate during those long stretches of no sleep and for the times when we just chilled out and played Tetris against each other. I love you, babe. I’d like to thank my sister, Sharnell Phillips, for being the greatest big sister a little brother could ever ask for. I must thank the little people in my life (that is, the kids), starting with Lorenzo IV and Tylen, my two sons, for their unconditional love, Jordan and Shane for the endless hours of game play on the PCs and consoles, and Tessa for all of the laughter she provides on a daily basis. To round out the family acknowledgements, I’d like to thank Joe and Kurt (my brothers-in-law), Su (my sister-in-law), and Myong (my mother-in-law), for being the best in-laws a man could hope for when two families are joined by marriage. I have to thank my man André LaMothe for getting me involved in the game indus- try in the way I have always envisioned, for introducing me to book writing, for picking me to grow businesses with, and for simply being a great friend. I’d like to thank Emi Smith and Morgan Halstead for putting up with me and my authors and for being such nice people to work with. Emi, you have also grown into a good friend, and I know I still owe you a glass of wine –SMILE-. I have to thank all of the authors because without them this book would not have been possible. Thanks to all of you for your hard work and dedication to make the project a reality. I hope the project has been enjoyable for each of you, and I would love to work with you all on future book projects. Finally, I would like to thank all of the gamers around the world for sharing my love and passion for creating and playing games. —Lorenzo D. Phillips Jr. About the Authors Lorenzo D. Phillips Jr. is a gamer at heart and is involved in game development in every aspect. He spends hours upon hours developing and writing games. He is the Founder and President of RenWare, Inc. and is the Chief Development Officer of Xtreme Games, LLC and Nurve Networks, LLC. He has 10+ years of experience in the Information Technology community. He has performed a wide range of duties that include software development, analysis and design, networking, database, qual- ity assurance, and most recently configuration management. He is formally educat- ed and holds an associate’s degree in Computer Science, a bachelor’s degree in Business and Information Systems, and a master’s degree in Computers and Information Systems. Kevin Hawkins is co-author of OpenGL Game Programming and a software engineer at Raydon Corporation in Daytona Beach, FL. He is working on his master’s degree in Software Engineering at Embry-Riddle University, where he obtained his bache- lor’s degree in Computer Science and played on the intercollegiate baseball team. Kevin is also the co-founder and CEO of www.gamedev.net, the leading online com- munity for game developers. When he’s not toying with the computer, he can be found playing guitar, reading, bodyboarding, and playing baseball. He was drafted by the Cleveland Indians in the 35th round of the 2002 Major League Baseball Amateur Draft. Ernest Pazera is a self-taught programmer, starting at age 13 with a TRS-80 includ- ing a tape deck. A month later, he was already writing video games. Before long Mr. Pazera couldn’t imagine himself doing anything but game programming. Mr. Pazera is one of the developers who helped create one of the most popular and respected game development sites on the Web: www.gamedev.net. He is the moder- ator of an isometric/hexagonal forum on the site and has extensive experience with game development. Wendy Jones is currently a game programmer with Humongous Entertainment in Seattle. She is currently focusing her professional attention on next-generation console projects, and her personal attention on her three children. In the past, she has done everything from tech support to web development to interface design in her eight short years in the computer industry.

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.