Home > Store

Core Techniques and Algorithms in Game Programming

Register your product to gain access to bonus material or receive a coupon.

Core Techniques and Algorithms in Game Programming

Premium Website

  • Sorry, this book is no longer in print.
Not for Sale


  • Copyright 2004
  • Edition: 1st
  • Premium Website
  • ISBN-10: 0-13-102009-9
  • ISBN-13: 978-0-13-102009-2

To even try to keep pace with the rapid evolution of game development, you need a strong foundation in core programming techniques-not a hefty volume on one narrow topic or one that devotes itself to API-specific implementations. Finally, there's a guide that delivers! As a professor at the Spanish university that offered that country's first master's degree in video game creation, author Daniel Sanchez-Crespo recognizes that there's a core programming curriculum every game designer should be well versed in-and he's outlined it in these pages! By focusing on time-tested coding techniques-and providing code samples that use C++, and the OpenGL and DirectX APIs-Daniel has produced a guide whose shelf life will extend long beyond the latest industry trend. Code design, data structures, design patterns, AI, scripting engines, 3D pipelines, texture mapping, and more: They're all covered here-in clear, coherent fashion and with a focus on the essentials that will have you referring back to this volume for years to come.



Author Bio - 354 kb - 0131020099a.pdf

Sample Content

Downloadable Sample Chapter

Sample Chapter - 604 kb - Chapter 7 - Action-Oriented AI

Table of Contents



1. A Chronology of Game Programming.

Phase I: Before Spacewar. Phase II: Spacewar to Atari. Phase III: Game Consoles and Personal Computers. Phase IV: Shakedown and Consolidation. Phase V: The Advent of the Game Engine. Phase VI: The Handheld Revolution. Phase VII: The Cellular Phenomenon. Phase VIII: Multiplayer Games. In Closing.

2. Game Architecture.

Real-Time Software. The Game Logic Section. The Presentation Section. The Programming Process. In Closing.

3. Data Structures and Algorithms.

Types, Structures, and Classes. Data Structures. The Standard Template Library. In Closing.

4. Design Patterns.

Design Patterns Defined. Some Useful Programming Patterns. Usability Patterns. In Closing.

5. User Input.

The Keyboard. Mouse. Joysticks. Hardware Abstraction. Force Feedback. In Closing.

6. Fundamental AI Technologies.

Context. Structure of an AI System. Specific Technologies. In Closing.

7. Action-Oriented AI.

On Action Games. Choreographed AIs. Object Tracking. Chasing. Evasion. Patrolling. Hiding and Taking Cover. Shooting. Putting It All Together. In Closing.

8. Tactical AI.

Tactical Thinking Explained. Military Analysis: Influence Maps. Representing Tactics. In Closing.

9. Scripting.

Building a Scripting Language. Embedded Languages. Socket-Based Scripting. In Closing.

10. Network Programming.

How the Internet Really Works. The Programmer's Perspective: Sockets. Clients. A Simple TCP Server. Multiclient Servers. UDP Servers. Preventing Socket Blocks. Designing Client-Server Games. Massively Multiplayer Games. In Closing.


11. 2D Game Programming.

On Older Hardware. Data Structures for 2D Games. Mapping Matrices. 2D Game Algorithms. Special Effects. In Closing.

12. 3D Pipeline Overview.

A First Look. Fundamental Data Types. Geometry Formats. A Generic Graphics Pipeline. In Closing.

13. Indoors Rendering.

General Analysis. Occluder-Based Algorithms. Binary Space Partition Algorithms. Portal Rendering. Hierarchical Occlusion Maps. Hybrid Approaches. Hardware-Assisted Occlusion Tests. In Closing.

14. Outdoors Algorithms.

Overview. Data Structures for Outdoors Rendering. Geomipmapping. ROAM. Chunked LODs. A GPU-Centric Approach. Outdoors Scene Graphs. In Closing.

15. Character Animation.

Analysis. Explicit Versus Implicit Methods. Explicit Animation Techniques. Implicit Animation Overview. Prop Handling. A Note on Vehicles. Limb Slicing. Facial Animation. Inverse Kinematics. Blending Forward and Inverse Kinematics. In Closing.

16. Cinematography.

First-Person Shooters. Handling Inertia. Flight Simulators and Quaternions. Third-Person Cameras. Cinematic Cameras: Camera Styles. Cinematic Cameras: Placement Algorithms. Agent-Based Approaches. In Closing.

17. Shading.

Real-World Illumination. Light Mapping. The BRDF. Nonphotorealistic Rendering. In Closing.

18. Texture Mapping.

Types of Textures. Tiling and Decals. Filtering. Mipmapping. Texture Optimization. Multipass Techniques. Multitexture. Texture Arithmetic and Combination. Detail Textures. Environment Mapping. Bump Mapping. Gloss Mapping. In Closing.

19. Particle Systems.

Anatomy of a Particle System. The Particle Data Structure. Some Notes on Architecture. Speed-Up Techniques. In Closing.

20. Organic Rendering.

Nature and Complexity. Trees. Grass. Clouds. Oceans. In Closing.

21. Procedural Techniques.

Procedural Manifesto. Renderman. Real-Time Shading Languages. Types of Shaders. Texture Mapping. Particle Systems. Animation. Special Effects. In Closing.

22. Geometrical Algorithms.

Point Inclusion Tests. Ray Intersection Tests. Moving Tests. Point Versus Triangle Set Collision (BSP-Based). Mesh Versus Mesh (Sweep and Prune Approach). Computing a Convex Hull. Triangle Reduction. In Closing.


Appendix A: Performance Tuning.

Analysis Techniques. Analysis Tools. General Optimization Techniques. Application. Efficient Data Transfer. Tuning the Geometry Pipeline. Tuning the Rasterizer Stage. Other Optimization Tools. In Closing.

Appendix B: OpenGL.

Philosophy. Basic Syntax. Immediate Mode Rendering. Transformations. Camera Model. Lighting. Texturing. Working in RGBA Mode. Display Lists. Vertex Arrays. OpenGL Extensions. Efficiency Considerations. Geometric Representation. In Closing.

Appendix C: Direct3D.

History. Booting Direct3D. Handling Geometry. Indexed Primitives. User Pointer Primitives. Efficient Geometry Delivery. Flexible Vertex Formats. Matrices, Cameras, and Transforms. Working with Texture Maps. Lighting. Render States. The Extension Library. Animation Helpers. In Closing.

Appendix D: Some Math Involved.

Distances. Trigonometry. Vector Math. Matrices.

Appendix E: Further Reading.

Part 1. Chronology Of Game Programming. Part 2. Game Architecture. Part 3. Data Structures and Algorithms. Part 4. Design Patterns. Part 5. User Input. Parts 6, 7I, and 8: Fundamental AI Technologies, Action-Oriented AI, and. Tactical AI. Part 9. Scripting. Part 10. Network Programming. Part 11. 2D Programming. Part 12. 3D Pipeline Overview. Part 13. Indoors Rendering. Part 14. Outdoors Algorithms. Part 15. Character Animation. Part 16. Inematography. Part 17. Shading. Part 18. Texture Mapping. Part 19. Particle Systems. Part 20. Organic Rendering. Part 21. Procedural Techniques. Part 22. Geometrical Algorithms. Appendix A: Performance Tuning. Appendix B: OpenGL. Appendix C: Direct3D. Appendix D: Some Math Involved.



Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information

To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.


Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.


If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information

Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.


This site is not directed to children under the age of 13.


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information

If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information

Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents

California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure

Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact

Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice

We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020