Book Image

Panda3D 1.7 Game Developer's Cookbook

Book Image

Panda3D 1.7 Game Developer's Cookbook

Overview of this book

Table of Contents (20 chapters)
Panda3D 1.7 Game Developer's Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

Panda3D is a free and open source game engine. It has been used successfully by hobbyists as well as big studios to create games ranging from quick prototypes to full-scale commercial MMOs. Panda3D makes it easy to use models, textures, and sounds to create impressive interactive experiences. With this book, you too will be able to leverage the full power of the Panda3D engine.

Panda3D 1.7 Game Developer's Cookbook will supply you with a set of step-by-step instructions to guide you to usable results quickly. Enabling physics, working with shader effects, and using Panda3D's networking features are only a few of the things you will learn from this book.

This book will take you through all the topics involved in developing games with Panda3D. After a quick sweep through setting up a basic scene, Panda3D 1.7 Game Developer's Cookbook will bring up topics like render-to-texture effects and performance profiling.

Focused recipes will get you closer to your game development goals step-by-step. This book covers advanced topics of game development with the industry-scale Panda3D engine. With every article you will be able to add more features and you will be guided from getting user input from gamepads and shader effects to user interfaces, adding physics, and using the engine's networking capabilities. Using these features, you will also get in touch with other languages and technologies like C++, the Cg shading language, or the Twisted server framework.

Panda3D 1.7 Game Developer's Cookbook provides a great reference for your Panda3D game development needs and helps you to deliver impressive results more quickly and with great ease.

What this book covers

Chapter 1, Setting Up Panda3D and Configuring Development Tools: Get set for working with Panda3D. Install and configure the engine as well as the development tools used throughout the book.

Chapter 2, Creating and Building Scenes: Learn about the scene management of Panda3D. This chapter will show you how to load models, animations, and terrain, and how to place them in a 3D world. You will learn how to work with virtual cameras and how to make them follow an object.

Chapter 3, Controlling the Renderer: This chapter shows, how to set attributes for controlling how a single model or an entire scene should be displayed on the screen. Work with color channels and alpha masks. Create a splitscreen mode and learn how to render on multiple displays.

Chapter 4, Scene Effects and Shaders: Lights, shadows, and particles are some of this chapter's topics. Apply shader effects to models. Take control of the advanced shader generator system of Panda3D and learn how to implement your own custom shader generator.

Chapter 5, Post-Processing and Screen Space Effects: Learn how to add polish and professional looks to your games using post-processing techniques like color grading or depth of field. This chapter also provides an implementation of a deferred rendering pipeline.

Chapter 6, 2D Elements and User Interfaces: Panda3D can also be used for 2D rendering. This chapter focuses on loading and displaying images and on how to use the GUI libraries of Panda3D.

Chapter 7, Application Control: Gain insight on Panda3D’s messaging and task systems. Learn how to use messages for inter-object communication. Elegantly handle code that is run on every frame using tasks.

Chapter 8, Collision Detection and Physics: Physics and proper collision handling are important parts of a game. Panda3D gives you powerful programming libraries for controlling physics and collisions like PhysX or ODE that will be presented in this chapter.

Chapter 9, Networking: This chapter is dedicated to sending and receiving data over networks with Panda3D. Learn how to download data, synchronize game objects, and how to post high scores to a remote server.

Chapter 10, Debugging and Performance: Find performance issues and bugs in your Panda3D based games. Use the tools provided by Panda3D and the included Python runtime for fixing these problems.

Chapter 11, Input Handling: Game controllers, a keyboard, and a mouse or even the network—many input measures can be used for providing interactive experiences with Panda3D. This chapter will show you how to transparently handle input from various devices in an elegant, easy, and reusable way.

Chapter 12, Packaging and Distribution: Learn how to package your game code and assets and make them ready for redistribution. Find out how to use set-up and use the browser plugin for a seamless and nearly installation-free end-user experience.

Chapter 13, Connecting Panda3D with Content Creation Tools: Export model files from Blender and preview them with the tools provided by the engine. Learn how to write a data converter for Panda3D's model format and how to compress model data to more space-saving formats.

What you need for this book

Apart from Panda3D and the tools that come included with it, the following software is used in this book:

  • NetBeans 6.8

  • Visual Studio 2008

  • Blender

All these tools and programs are either free software or provide free versions that can be downloaded and used without any further costs. Refer to the chapters discussing these programs for instructions on how to obtain copies and how to install them.

Who this book is for

If you are a developer with experience in Python, Panda3D, and optionally C++ and shading languages and you are looking for quick and easy method to integrate solutions to common game development problems with Panda3D, this book is for you.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "Save it as PandaSettings.vsprops in a directory of your choice."

A block of code is set as follows:

from direct.showbase.ShowBase import ShowBase

class Application(ShowBase):
    def __init__(self):
        ShowBase.__init__(self)

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

from direct.showbase.ShowBase import ShowBase

class Application(ShowBase):
    def __init__(self):
        ShowBase.__init__(self)

Any command-line input or output is written as follows:

pzip -9 model.egg

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "If you can’t find it this way, click View | Property Manager in the main menu".

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail .

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.