1. Trang chủ
  2. » Tất cả

Focus on Mod Programming In Quake III Arena

411 2 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Cấu trúc

  • CONTENTS

  • LETTER FROM THE SERIES EDITOR

  • INTRODUCTION

  • CHAPTER 1 INTRODUCTION TO PROGRAMMING MODS

    • What Is a Mod?

    • Why Create a Mod Instead of Just Writing a Game?

    • The Tools of the Trade

      • Using C

      • Using the VC++ Compiler

    • What Mods Are Currently Available?

      • Urban Terror

      • Rocket Arena Q3A

      • Quake III Fortress (Q3F)

      • Painkeep Arena

      • Rune Quake

    • Summary

  • CHAPTER 2 C PROGRAMMING IN QUAKE III

    • The History of Quake and Its Code

      • The Move from DOS to Win32

      • Hello Quake III, Goodbye DLL! (Sort Of)

    • Getting Set Up

      • Installing Q3 and the Source

      • The Source Directory

      • Using Visual C++

    • Building the Source

      • Compiling the Project

      • Loading Up Your Mod

    • Looking at the Quake III Code

      • On Your Marks, Get Set

      • The Q3 Source

      • Planning

    • A Simple Mod: The Homing Missile

      • I Think, Therefore I NextThink . . .

      • Entities: Building Blocks in Q3

      • Changing the Missile's Behavior

      • Smoothing the Missile

      • A Final Note

    • Summary

  • CHAPTER 3 MORE WEAPONRY WORK

    • Understanding Weapon Types

    • Modifying the Shotgun

      • Understanding the Top-Down Approach

      • Knowing the Shotgun Inside and Out

      • The Physics of Vectors

      • Intricacies of Damage

      • Adjusting the Shotgun's Accuracy

      • The Shotgun's Dirty Secret

      • Synchronicity in the Client Code

      • Adding Polish: Shooting While Moving

    • Modifying Grenades: The Cluster Grenade

      • Further g.weapon.c Detective Work

      • Why a Grenade Bounces (and Rockets Don't)

      • Using What You Know: think and nextthink

      • Making the Cluster Grenade Behave

    • A Further Adjusting Gravity Wells

      • Into the Vortex

      • Testing for Collision

      • Making Gravity Work for You

    • Summary

  • CHAPTER 4 MANIPULATING THE PLAYER

    • The Quake III Player and His World

      • Player Structure

      • The Guts of gclient_s

      • State of the Player

    • Changing the Player's Movement

      • Playing with ps.speed

      • Gravity Kills

      • The Case of the Missing client

      • Solving the Jumping Mystery

      • The Move to Pmove

      • Modifying Jump Velocity

    • Giving the Player a Jetpack

      • Creating a New pmove Flag

      • Defying Gravity

      • A Surprise Effect

      • Borrowing Code from PM_FlyMove

    • Implementing Locational Damage

      • Creating Hit Flags

      • The Bounding Box

      • Scanning Body Parts

      • My Feet Are . . . Where Now?

      • Switching Off the Hits

    • Summary

  • CHAPTER 5 QUAKE COMMUNICATION

    • The Client/Server Relationship

      • Leaving Peering in the Past

      • Lag in a Nutshell

      • The Quest for Low Latency

      • The Process of Updates

    • Bridging game, cgame, and ui

      • The Server Is God

      • The Main Event

      • Interfacing with the User

      • Modifying Variables on-the-Fly

    • The Quake Virtual Machine

      • Getting the Best of Both (Quake) Worlds

      • Build Your Own QVM

    • Summary

  • CHAPTER 6 CLIENT PROGRAMMING

    • Revisiting Weapons: Chain Lightning

      • Trace Your Path

      • Be Like Zeus

    • Creating Client Events

      • Enumerating an Event

      • The Communication of entityState_t

      • Chain Lightning Lives

    • Working with Shaders

      • A Shady Modification: Armor Regeneration

      • Making the Player Glow

      • Regenerating Armor

    • Adding New Icons and Sound Effects

      • Making It Count

      • Getting Up in the Player's Face

      • Cache Memory

    • Summary

  • CHAPTER 7 DEFEND THE FLAG

    • The Rules

      • What You Will Reuse

      • What You Will Create

    • Preparing Q3 for DTF

      • Your Journey Begins at gametype_t

      • itemType_t: Birth of the Sigil

      • Fleshing Out the Sigil

      • Bending the Rules with powerup_t

    • Tranforming Flags into Sigils

      • Every Item Is a gitem_t

      • Sigils Become New Items

      • Initializing Sigils for DTF

      • Warning Q3 about Sigils (Or Lack Thereof)

    • Creating the New Sigil Behavior

      • Getting Touchy-Feely with Touch_Item

      • Wiring Sigil-Touch for Touch_Item

      • Keeping Score with Sigil_Think

      • Keeping cgame in Check

    • Tricking Q3: Reusing Spawn Points

      • The Process of Spawning Level Entities

      • Jimmying Item Entities into a Map

      • Yanking Out CTF Flags

      • Creating a Third Sigil Spawn Point

      • Picking the Preferred Item

    • Summary

  • CHAPTER 8 WHERE TO GO NEXT

    • Deathmatch, CTF, and Other Game Types

      • Vanilla Deathmatch

      • Games Without Frontiers: CTF

      • A Class Act: Team Fortress

      • Squad Tactics: Counter-Strike

    • Structure of a Mod

      • The PK3 File: Unlocking Its Secrets

      • Art Is Life (and Death, in Q3)

      • Modeling Without a Runway

      • Brushing Up on Level Design

      • Creating Sound Effects Using Household Items

    • Summary

  • CHAPTER 9 UI PROGRAMMING

    • Basic UI Concepts

      • Controls: Nuts and Bolts of UI

      • Formatting Controls

      • Controls Have One Thing in menucommon_s

    • The Menu Framework

      • Breathing Life into a Menu

      • Tweaking Q3

      • Setting the Stage for a Menu

      • Pushing a Menu Will Only Make It Mad

    • Building a New UI Menu

      • Starting ui_tweaks.c

      • Defining the Menu Struct

      • Getting a Handle on Menu Events

      • Initializing the Menu Controls

      • The Cache and Push

      • Cleaning Up

    • Working with More Controls

      • menufield_s of Dreams

      • The menuslider_s Control: Great for Parties

      • Ultimate Power: menulist_s

    • Summary

  • CHAPTER 10 ENHANCING DTF

    • Adding Sigil Status to the HUD

      • Filling in the Missing Game Code

      • Making the Config String Work for You

      • Prepping cgame for the HUD Update

      • Parsing Out Config Strings in cgame

      • The Sigil Status HUD Comes to Life

    • Adding a Flag Locator

      • Getting to Know Cvars

      • Adding a Cvar for the Flag Locator

      • Adding the Flag-Locator Functions

      • The Quick-and-Dirty CG_DrawSigilLocationInfo

      • Sigil to Player: I'm Over Here!

    • Adding DTF to the UI

      • Specifying the Setup of DTF

      • Handling Two Different Spawning Styles

      • Making DTF Selectable

      • CTF Maps are OK in My Book

      • Adding DTF Options to the Game Server Menu

    • Summary

  • APPENDIX A: DEBUGGING YOUR MOD IN VISUAL STUDIO

  • APPENDIX B: RESOURCES

  • INDEX

    • A

    • B

    • C

    • D

    • E

    • F

    • G

    • H

    • I

    • J

    • K

    • L

    • M

    • N

    • O

    • P

    • Q

    • R

    • S

    • T

    • U

    • V

    • W

    • Z

Nội dung

Focus on Mod Programming for Quake III Arena This page intentionally left blank Focus on Mod Programming for Quake III Arena Shawn Holmes © 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 The Premier Press logo, top edge printing, 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 Series Editor: André LaMothe Project Editor: Estelle Manticas Editorial Assistant: Margaret Bauer Technical Reviewer: Robi Sen Technical Consultant: Jared Larson Copy Editor: Kate Welsh Interior Layout: Marian Hartsough Cover Design: Mike Tanamachi Indexer: Katherine Stimson Proofreader: Jennifer Davidson 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 trademarks 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-56-X Library of Congress Catalog Card Number: 2001099836 Printed in the United States of America 02 03 04 05 RI 10 Premier Press, a division of Course Technology 2645 Erie Avenue, Suite 41 Cincinnati, Ohio 45208 To Ariel and Hunter, who love to play games almost as much as their Dad And to Dave Kirsch, for inspiring me, and many others, to create Acknowledgements T his is my first book, and it was both challenging and a constant learning process from start to finish Because of the unusual circumstances that led to my becoming the author, I have many important people to thank; without them I surely wouldn’t have been able to pull this off The first of these people are Emi Smith and Estelle Manticas, two patient ladies who held my hand as I stumbled blindly Many of the tutorials in this book are based on the hard work of dedicated Quake III Arena fans, who took their own personal time to write up what they had discovered My thanks go to Chris Hilton, Karl Pauls, Arthur “Calrathan” Tomlin, and Ian “HypoThermia” Jefferies at Code3Arena for their extensive help and knowledge As well, thanks to my favorite 3D modeler and friend Dave Wolfe for his contribution in the modeling department My passion for C programming would not exist if it weren’t for the support of Dave Sausville, and so I have him to thank as well I need to thank Thaxton Beesely, too, for it was his laptop on which a great deal of this book was written Special thanks go to Robi Sen, my technical editor, for believing in me enough to get me on this project Jared Larsen provided detailed information on Q3’s code, shaders, and wrote the Flag Indicator & Dynamic Spawn generating functions (all after having just welcomed a baby!), so thanks very much to him Many thanks also to Andy Smith for providing introductory content in Chapter Also, special thanks to Anthony Jacques, for providing the source to his “Domination” mod for Q3, which formed the basis of the Defend the Flag modification, handled in the last section of this book Thanks also go to the team back at Breckenridge Communications, who dared me to write a book And finally, thanks especially to my wife, Julie, for her support and patience during this exciting and unpredictable project About the Author SHAWN HOLMES is a gaming addict, period Born in the recesses of the Great White North, Shawn grew up in the small town of Parksville, British Columbia, with dreams of one day becoming a professional video-game developer He first tinkered with an Apple computer back in 1985, and wrote his first game for a Computer Science project in 1990 Today, Shawn is Senior Programmer at Breckenridge Communications, an Internet-applications company in Denver, Colorado, and lives with his wife Julie and their two children, Ariel and Hunter He can be reached at sholmes@breckcomm.com Shawn has played a role in several game modifications; in 1997 he headed up The CTF Expansion Project to increase the number of quality CTF maps available for Quake In 1999, his Decay! mod for Heretic II was named “Mod of the Month” by an Australian gaming magazine, PC Powerplay As long as video and computer games exist, Shawn will continue to push his development experience to new levels in his quest to create the next exciting game Contents Letter from the Series Editor xiv Introduction xvii Introduction to Programming Mods CHAPTER What Is a Mod? Why Create a Mod Instead of Just Writing a Game? The Tools of the Trade Using C Using the VC++ Compiler What Mods Are Currently Available? Urban Terror Rocket Arena Q3A Quake III Fortress (Q3F) Painkeep Arena Rune Quake 11 Summary 12 C Programming in Quake III 13 CHAPTER The History of Quake and Its Code 15 The Move from DOS to Win32 16 Hello Quake III, Goodbye DLL! (Sort Of) 18 Getting Set Up 19 Installing Q3 and the Source 19 The Source Directory 21 Using Visual C++ 22 Contents ix Building the Source 25 Compiling the Project 27 Loading Up Your Mod 28 Looking at the Quake III Code 29 On Your Marks, Get Set 29 The Q3 Source 30 Planning 33 A Simple Mod:The Homing Missile 33 I Think,Therefore I NextThink 36 Entities: Building Blocks in Q3 37 Changing the Missile’s Behavior 38 Smoothing the Missile 47 A Final Note 48 Summary 48 More Weaponry Work 49 CHAPTER Understanding Weapon Types 50 Modifying the Shotgun 52 Understanding the Top-Down Approach 52 Knowing the Shotgun Inside and Out 53 The Physics of Vectors 55 Intricacies of Damage 56 Adjusting the Shotgun’s Accuracy 58 The Shotgun’s Dirty Secret 62 Synchronicity in the Client Code 66 Adding Polish: Shooting While Moving 68 Modifying Grenades:The Cluster Grenade 72 Further g.weapon.c Detective Work 73 Why a Grenade Bounces (and Rockets Don’t) 74 Using What You Know: think and nextthink 76 Making the Cluster Grenade Behave 78 .. .Focus on Mod Programming for Quake III Arena This page intentionally left blank Focus on Mod Programming for Quake III Arena Shawn Holmes © 2002 by Premier Press, a division of Course... are now What are we waiting for? Let’s go! CHAPTER Introduction to Programming Mods Introduction to Programming Mods C reating mods for Quake III is a challenging and rewarding experience It requires... of course) Focus on Mod Programming for Quake III Arena starts off by describing what mods are and giving you some history behind the Quake technology Shawn describes key programming concepts so

Ngày đăng: 17/04/2017, 08:37

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w