You are previewing Panda3D 1.6 Game Engine.
O'Reilly logo
Panda3D 1.6 Game Engine

Book Description

This is the A-Z of Panda3D for developers who have never used the engine before. Step-by-step, it takes you from first principles to ultimately creating a marketable game. You’ll learn through first-hand experience and clear explanations.

  • The first and only guide to building a finished game using Panda3D

  • Learn about tasks that can be used to handle changes over time

  • Respond to events like keyboard key presses, mouse clicks, and more

  • Take advantage of Panda3D's built-in shaders and filters to decorate objects with gloss, glow, and bump effects

  • Follow a step-by-step, tutorial-focused process that matches the development process of the game with plenty of screenshots and thoroughly explained code for easy pick up

  • In Detail

    Panda3D is a game engine, a framework for 3D rendering and game development for Python and C++ programs. It includes graphics, audio, I/O, collision detection, and other abilities relevant to the creation of 3D games. Also, Panda3D is Open Source and free for any purpose, including commercial ventures. This book will enable you to create finished, marketable computer games using Panda3D and other entirely open-source tools and then sell those games without paying a cent for licensing.

    Panda3D 1.6 Game Engine Beginner's Guide follows a logical progression from a zero start through the game development process all the way to a finished, packaged installer. Packed with examples and detailed tutorials in every section, it teaches the reader through first-hand experience. These tutorials are followed by explanations that describe what happened in the tutorial and why.

    You will start by setting up a workspace, and then move on to the basics of starting up Panda3D. From there, you will begin adding objects like a level and a character to the world inside Panda3D. Then the book will teach you to put the game's player in control by adding change over time and response to user input. Then you will learn how to make it possible for objects in the world to interact with each other by using collision detection and beautify your game with Panda3D's built-in filters, shaders, and texturing. Finally, you will add an interface, audio, and package it all up for the customer.

    This is a simple but detailed guide to using Panda3D, which will take you from a blank text file all the way through the Python programming process to a finished game with a single level, including such topics as handling tasks over time, event handling and response, collision set up and detection, audio, and more.

    Table of Contents

    1. Panda3D 1.6 Game Engine Beginner's Guide
      1. Panda3D 1.6 Game Engine Beginner's Guide
      2. Credits
      3. About the Author
      4. About the Reviewers
      5. www.PacktPub.com
        1. Support files, eBooks, discount offers, and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
      6. Preface
        1. Who this book is for
        2. What this book covers
        3. What you need for this book
        4. Conventions
        5. Time for action - heading
          1. What just happened?
          2. Pop quiz - heading
          3. Have a go hero - heading
        6. Reader feedback
        7. Customer support
          1. Errata
          2. Piracy
          3. Questions
      7. 1. Installing Panda3D and Preparing a Workspace
        1. Getting started with Panda3D installation packages
        2. Time for action - downloading and installing Panda3D
          1. What just happened?
        3. Switching to an advanced text editor
        4. Time for action - downloading and installing Notepad++
          1. What just happened?
        5. Installing the game content
        6. Time for action - demoing Suicide Jockeys
          1. What just happened?
        7. Installing optional tools
          1. Blender and Chicken
          2. Spacescape
          3. Explosion Texture Generator
        8. Summary
      8. 2. Creating the Universe: Loading Terrain
        1. Notepad++
        2. Setting up a new file in Notepad++
        3. Time for action - setting up a new file in Notepad++
          1. What just happened?
        4. Importing Panda3D components
        5. Time for action - importing DirectStart
          1. What just happened?
        6. Creating a World Object
        7. Time for action - creating a World Object
          1. What just happened?
        8. Loading the terrain
        9. Time for action - loading the terrain
          1. What just happened?
        10. Loading files into Panda3D
          1. The model path
          2. Eggs
          3. Bams
          4. Pop quiz - starting Panda3D and loading models
        11. NodePaths and nodes
        12. Time for action - introducing NodePaths and nodes
          1. What just happened?
          2. Manipulating NodePaths
        13. Time for action - manipulating NodePaths
          1. What just happened?
          2. Have a go hero - more NodePath manipulation
        14. The Scene Graph
        15. Time for action - understanding parent child inheritance
          1. What just happened?
        16. Time for action - explaining relative coordinate systems
          1. What just happened?
          2. Have a go hero - parenting and relative coordinate systems
        17. Loading a file multiple times
        18. Render attributes
        19. Time for action - demonstrating render attributes
          1. What just happened?
          2. Pop quiz - using NodePaths and understanding Scene Graph inheritance
          3. Have a go hero - render attributes
        20. Summary
      9. 3. Managing Tasks Over Time
        1. The task manager
        2. Time for action - printing the task list from the task manager
          1. What just happened?
          2. Avoiding multiple task managers
          3. Adding tasks to the task manager
        3. Time for action - creating a task and adding it to the task manager
          1. What just happened?
        4. Time for action - looking at task statistics
          1. What just happened?
          2. Adding a delay to tasks
        5. Time for action - using doMethodLater
          1. What just happened?
          2. Pop quiz - the task manager
        6. Using delta time
        7. Time for action - using delta time
          1. What just happened?
          2. Pop quiz - delta time
        8. Over viewing task return options
          1. About the None type object
        9. Time for action - exploring task return options
          1. What just happened?
          2. Pop quiz - task return options
          3. Have a go hero - creating more tasks
        10. Prioritizing tasks
        11. Removing tasks from the task manager
        12. Time for action - removing tasks by name
          1. What just happened?
        13. Dissecting task objects
        14. Summary
      10. 4. Taking Control: Events and User Input
        1. Working with events
        2. Time for action - registering and responding to events
          1. What just happened?
          2. Pop quiz - working with events
        3. Using keyboard events
          1. Using a key map
        4. Time for action - creating and using a key map
          1. What just happened?
          2. Pop quiz - using keyboard input
        5. Implementing advanced cycle controls
        6. Time for action - implementing acceleration
          1. What just happened?
        7. Time for action - implementing throttle control
          1. What just happened?
        8. Time for action - implementing turning
          1. What just happened?
        9. Utilizing mouse input and creating camera control
        10. Time for action - tying the camera to the cycle
          1. What just happened?
          2. Reacting to mouse movement
        11. Time for action - turning the camera with the mouse position
          1. What just happened?
          2. Pop quiz - utilizing mouse input
          3. Have a go hero - creating more tasks
        12. Ending event response
        13. Summary
      11. 5. Handling Large Programs with Custom Classes
        1. Importing custom classes
        2. Time for action - making and importing a custom class
          1. What just happened?
          2. Pop quiz - importing custom classes
        3. Adding NodePath functionality to a custom class
        4. Time for action - defining the Cycle class
          1. What just happened?
          2. Simulating drift
        5. Time for action - simulating drift
          1. What just happened?
          2. Pop quiz - using custom classes with NodePaths
        6. Accessing classes from within another class
        7. Time for action - adding an input manager
          1. What just happened?
          2. Have a go hero - Adding AI to the cycle
          3. Pop quiz - accessing custom classes from other custom classes
        8. Summary
      12. 6. The World in Action: Handling Collisions
        1. Collision basics: Our first collision system
        2. Time for action - creating a simple collision detection system
          1. What just happened?
          2. Pop quiz - regarding basic collision detection
        3. Creating inter-cycle collisions
        4. Time for action - inter-cycle collisions
          1. What just happened?
          2. Pop quiz - understanding handlers that generate events
          3. Have a go hero - using collision events
        5. Using BitMasks to organize collisions
        6. Time for action - implementing BitMasks
          1. What just happened?
        7. Time for action - setting a range of bits with BitMask.range
          1. What just happened?
          2. Pop quiz - understanding BitMasks
        8. Using Python tags to get colliding objects
        9. Time for action - setting and getting PythonTags
          1. What just happened?
          2. Have a go hero - gaining experience with BitMasks and PythonTags
          3. Pop quiz - using Python Tags
        10. Setting up ground collision
        11. Time for action - creating a ground collision system
          1. What just happened?
          2. Pop quiz - complex collision detection
        12. Overview of additional collision solids and handlers
          1. Collision solids
          2. Collision handlers
        13. Summary
      13. 7. Making it Fancy: Lighting, Textures, Filters, and Shaders
        1. Adding lighting
        2. Time for action - adding lights to the game
          1. What just happened?
          2. Types of lights
          3. Have a go hero - adding more lights to the scene
          4. Pop quiz - using lights
        3. Applying textures to models
        4. Time for action - creating a bam writer
          1. What just happened?
          2. Have a go hero - loading the bam file
          3. Texture stages
        5. Time for action - using TextureStages
          1. What just happened?
          2. Have a go hero - apply textures
          3. Pop quiz - understanding textures and TextureStages
        6. Creating filters
        7. Time for action - adding a bloom filter
          1. What just happened?
        8. Using a sky sphere
        9. Time for action - adding a sky sphere
          1. What just happened?
          2. Pop quiz - setting up a sky sphere
        10. Summary
      14. 8. GUI Goodness: All About the Graphic User Interface
        1. Creating a menu system
          1. About DirectGUI
        2. Time for action - creating a menu system
          1. What just happened?
          2. Pop quiz - understanding DirectGUI
          3. Have a go hero - performing additional actions with new menus
        3. Putting menus to use
        4. Time for action - using menus
          1. What just happened?
        5. In-game HUD
        6. Time for action - creating a basic HUD
          1. What just happened?
          2. Pop quiz - creating a Heads Up Display
          3. Have-a-go hero proper order of images
        7. Summary
      15. 9. Animating in Panda3D
        1. Actors and Animations
        2. Time for action - loading Actors and Animations
          1. What just happened?
          2. Pop quiz - animation basics
        3. Controlling animations
          1. Have a go hero - basic animation controls
        4. Animation blending
        5. Time for action - blending two animations
          1. What just happened?
        6. Creating and using Actor subparts
        7. Time for action - playing animations on subparts
          1. What just happened?
          2. Pop quiz - advanced animation
        8. Exposing joints
        9. Time for action - animating our cycles
          1. What just happened?
        10. Summary
      16. 10. Creating Weaponry: Using Mouse Picking and Intervals
        1. Using mouse picking
        2. Time for action - setting up mouse aim
          1. What just happened?
          2. Pop quiz - mouse picking
        3. Understanding Intervals, Sequences, and Parallels
          1. Sequences and Parallels
        4. Creating machine guns
        5. Time for action - using Intervals in Sequences and Parallels
          1. What just happened?
        6. Time for action - adding collision detection to the MachineGun
          1. What just happened?
        7. Implementing the main cannon
        8. Time for action - creating the main cannon
          1. What just happened?
        9. Adding weapon information to the HUD
        10. Time for action - adding a new HUD section
          1. What just happened?
        11. Handling damage response
        12. Time for action - finalizing weapons with damage response
          1. What just happened?
          2. Pop quiz - Intervals
        13. Summary
      17. 11. What's that Noise? Using Sound
        1. Editing Config.prc
        2. Time for action - selecting an audio library
          1. What just happened?
        3. Adding music
          1. AudioSound objects
          2. AudioManager objects
        4. Time for action - creating background music
          1. What just happened?
          2. Pop quiz - making music
        5. Adding sound effects
        6. Time for action - generating 3D audio with Audio3DManager
          1. What just happened?
        7. About sound intervals
          1. Pop quiz - sounding off
        8. Summary
      18. 12. Finishing Touches: Getting the Game Ready for the Customer
        1. Collecting garbage
        2. Time for action - collecting garbage from the Explosion classes
          1. What just happened?
        3. Time for action - collecting garbage from the Gun classes
          1. What just happened?
        4. Time for action - collecting garbage from the Cycle class
          1. What just happened?
        5. Time for action - collecting garbage from the Track class
          1. What just happened?
          2. Pop quiz - garbage collection
        6. Creating a preloader
        7. Time for action - creating a preloader to load models
          1. What just happened?
        8. File handling
        9. Time for action - reading data from a file
          1. What just happened?
        10. Customizing the mouse cursor
        11. Time for action - customizing the mouse cursor
          1. What just happened?
          2. Have a go hero - the end of the race
          3. Pop quiz - using a custom mouse cursor
        12. Creating an Installer
        13. Time for action - packing a Panda3D game
          1. What just happened?
          2. Have a go hero - improving load times
          3. Pop quiz - building an installer
        14. Summary
      19. A. Creating a Sky Sphere with Spacescape
        1. Learning Spacescape basics
        2. Time for action - getting started with Spacescape
          1. What just happened?
        3. Blending layers
        4. Time for action - blending layers to create nebulas
          1. What just happened?
        5. Using point stars and billboard stars
        6. Time for action - populating the sky with stars
          1. What just happened?
        7. Creating a sky sphere from a skybox made with Spacescape
        8. Time for action - populating the sky with stars
          1. What just happened?
        9. Time for action - creating the sky sphere in Panda3D
          1. What just happened?
        10. Summary
      20. B. Using Egg-Texture-Cards and ExploTexGen
        1. Using ExploTexGen
        2. Time for action - reading the ExploTexGen documentation
          1. What just happened?
        3. Time for action - designing an explosion
          1. What just happened?
        4. Creating flipbook animations with egg-texture-cards
        5. Time for action - using egg-texture-cards
          1. What just happened?
        6. Additional egg-texture-card options
        7. Summary
      21. C. Pop quiz - Answers
        1. Chapter 2: Creating the Universe: Loading Terrain
          1. Starting Panda3D and loading models
          2. Using NodePath and understanding scene graph inheritance
        2. Chapter 3: Managing Tasks Over Time
          1. The task manager
          2. Delta time
          3. Delta time Task return options
        3. Chapter 4: Taking Control: Events and User Input
          1. Working with events
          2. Using keyboard input
          3. Utilizing mouse input
        4. Chapter 5: Handling Large Programs with Custom Classes
          1. Importing custom classes
          2. Accessing custom classes from other classes
        5. Chapter 6: The World in Action: Handling Collisions
          1. Regarding basic collision detection
          2. Understanding handlers that generate events
          3. Understanding BitMasks
          4. Using Python tags
          5. Complex collision detection
        6. Chapter 7: Making it Fancy: Lighting, Textures, Filters, and Shaders
          1. Using lights
          2. Understanding textures and TextureStages
          3. Setting up a sky sphere
        7. Chapter 8: GUI Goodness: All About the Graphic User Interface
          1. Understanding DirectGUI
          2. Creating a Heads Up Display
        8. Chapter 9: Animating in Panda3D
          1. Animation basics
          2. Advanced animation
        9. Chapter 10: Creating Weaponry: Using Mouse Picking and Intervals
          1. Mouse picking
          2. Intervals
        10. Chapter 11: What's that Noise? Using Sound
          1. Making music
          2. Sounding off
        11. Chapter 12: Finishing Touches: Getting the Game Ready for the Customer
          1. Garbage collection
          2. Using a custom mouse cursor
          3. Building an installer