Torque 3D Game Development Cookbook

Over 80 practical recipes and hidden gems for getting the most out of the Torque 3D game engine

Torque 3D Game Development Cookbook

Cookbook
David Wyand

Over 80 practical recipes and hidden gems for getting the most out of the Torque 3D game engine
$10.00
$49.99
RRP $29.99
RRP $49.99
eBook
Print + eBook
$12.99 p/month

Get Access

Get Unlimited Access to every Packt eBook and Video course

Enjoy full and instant access to over 3000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

+ Collection
Free Sample

Book Details

ISBN 139781849693547
Paperback380 pages

About This Book

  • Clear step-by-step instruction and practical examples to advance your understanding of Torque 3D and all of its sub-systems
  • Explore essential topics such as graphics, sound, networking and user input
  • Helpful tips and techniques to increase the potential of your Torque 3D games

Who This Book Is For

The book is written for professional and indie game developers that have basic knowledge of TorqueScript, are acquainted with Torque 3D’s built-in tools, and wish to take their skills to the next level. Having gone through the comprehensive Torque 3D 1.2 FPS game tutorial on the GarageGames website (or its equivalent) is assumed.

Table of Contents

Chapter 1: TorqueScript: The Only Script You Need to Know
Introduction
Accessing delimited fields within a string
Iterating on words in a string list
Retrieving components of a variable using accessors
Iterating on objects in a SimSet or SimGroup collection
Getting a random object from a SimSet or SimGroup collection
Finding an object in a SimSet or SimGroup collection using its internal name
Executing a method on a SimSet or SimGroup collection
Creating a new SimObject instance
Creating a new internal name only SimObject instance
Creating a new Datablock object
Creating a new singleton
Extending a SimObject instance using the class property
Using a variable to access methods or properties of a SimObject instance
Using call() to call a variable method on a SimObject instance with arguments
Using call() to call a variable function with arguments
Using script arrays as dictionaries
Using ArrayObject and custom script sorting callbacks
Scheduling SimObject methods
Scheduling functions
Activating and deactivating a package
Chapter 2: Working with Your Editors
Introduction
Setting up fogging of the level
How to cover seams and texture changes using decals placed in the World Editor
Copying the transform of an object to another in the World Editor window
How to change the material of an object in the World Editor
Setting up a glow mask using the Material Editor window
Using a convex shape as a zone
Setting zone-specific ambient lighting
Grouping adjacent zones together
Chapter 3: Graphical User Interface
Introduction
Creating a password text edit box
Using pushDialog() and popDialog() and setting up the UI file to work with them
Displaying metrics (such as FPS) from the console
Displaying a list of all game objects
Displaying a level at the main menu
Dragging and dropping between two windows
Chapter 4: Camera and Mouse Controls
Introduction
Locking and hiding the mouse while the right mouse button is down
Clicking on an object in the scene (client-side)
Clicking on an object in the scene (server-side)
Picking up an item in the scene while the mouse is locked and hidden
Changing the camera's view and control mode
Giving the camera smooth movement
Having the camera follow a path
Chapter 5: Your Graphics Evolved
Introduction
Using the built-in video recording
Changing the material of a ShapeBase object using script
Building a custom material
Building a custom material using advanced lighting
Building a postFX
Chapter 6: Make That Sound Happen
Introduction
Playing a quick 2D or 3D sound on all clients
Using SFXEmitter to create networked sound effects
Playing a sound on a ShapeBase object
Playing music while a level is loading
How to have a background sound for a level
How to have music change according to the mood
Triggering an event during sound playback
Chapter 7: Game Objects
Introduction
Playing an animation sequence on a TSStatic class
Playing an animation sequence on a ShapeBase class
How to make it rain using a Precipitation object
Using the Lightning object to automatically create a thunderstorm
Using the TimeOfDay object to generate events
Chapter 8: Multiplayer Servers
Introduction
How to start a dedicated server
What ports are needed to be open or forwarded for a multiplayer server
Passing arbitrary parameters from the client to the server
How to become an admin on a server
Kicking and banning people from the server
Stopping a server from restarting when the last player leaves
Accessing the server connection from the client
How to access all client connections from the server
Broadcasting a message to all clients and having it displayed in the center of the screen
Chapter 9: Importance of Networking
Introduction
Sending a network event from the client to the server
Sending a network event from the server to the client
Connecting as a TCP client
Setting up a TCP server
Connecting as an HTTP client
Using an RSS feed for game news, message of the day, or other client messages
How to activate, deactivate, and use Telnet for console access
Chapter 10: Miscellaneous Gameplay Features
Introduction
How to have a sprinting player use up energy
Enabling and disabling air control
How to jump jet
Adjusting the fire spread of a weapon
Changing the number of shots fired from a weapon
Making a weapon use energy rather than ammo
Finding objects in range
Using the message producer/consumer system

What You Will Learn

  • Game data manipulation and event scheduling using TorqueScript
  • Work with and display Torque 3D’s built-in metrics to expose your game’s performance characteristics
  • Improve your game’s frame rate through proper zone and portal set up
  • Learn hidden TorqueScript secrets to ease game development
  • Set up standard RPG mouse controls and object manipulation
  • Learn to create a drag-and-drop inventory front end
  • Go beyond the standard FPS weapon set-up to make each weapon unique
  • Refine the look of your game using various object animation capabilities and damage states
  • Work with multiplayer servers and pass game specific data to and from the client
  • Have your game communicate with various third party online services

In Detail

Torque 3D is a popular game engine that supports you in every step along the way to making your game a reality. Even with all of the power and tools that Torque 3D provides, finishing a high quality 3D game requires time and knowledge.

"Torque 3D Game Development Cookbook" is a practical guide that takes you through each of the major steps on the journey to creating your game, while learning a few tricks along the way.

The recipes in this book start off with learning some of the finer points about TorqueScript. The book then moves on to each of Torque 3D’s subsystems and ends with a variety of game play recipes.

The various topics covered include activating level-specific game code and scheduling game events, dragging and dropping items between windows to work with an in-game inventory system, and covering the seams between objects with well placed decals. Some of the advanced topics include writing custom shaders and postFX, using zones to improve rendering performance, and enhancing your game’s ambience through sound.

Once you are done with Torque 3D Game Development Cookbook you’ll be on your way to creating amazing 3D games and gain expert knowledge of Torque 3D.

Authors

Table of Contents

Chapter 1: TorqueScript: The Only Script You Need to Know
Introduction
Accessing delimited fields within a string
Iterating on words in a string list
Retrieving components of a variable using accessors
Iterating on objects in a SimSet or SimGroup collection
Getting a random object from a SimSet or SimGroup collection
Finding an object in a SimSet or SimGroup collection using its internal name
Executing a method on a SimSet or SimGroup collection
Creating a new SimObject instance
Creating a new internal name only SimObject instance
Creating a new Datablock object
Creating a new singleton
Extending a SimObject instance using the class property
Using a variable to access methods or properties of a SimObject instance
Using call() to call a variable method on a SimObject instance with arguments
Using call() to call a variable function with arguments
Using script arrays as dictionaries
Using ArrayObject and custom script sorting callbacks
Scheduling SimObject methods
Scheduling functions
Activating and deactivating a package
Chapter 2: Working with Your Editors
Introduction
Setting up fogging of the level
How to cover seams and texture changes using decals placed in the World Editor
Copying the transform of an object to another in the World Editor window
How to change the material of an object in the World Editor
Setting up a glow mask using the Material Editor window
Using a convex shape as a zone
Setting zone-specific ambient lighting
Grouping adjacent zones together
Chapter 3: Graphical User Interface
Introduction
Creating a password text edit box
Using pushDialog() and popDialog() and setting up the UI file to work with them
Displaying metrics (such as FPS) from the console
Displaying a list of all game objects
Displaying a level at the main menu
Dragging and dropping between two windows
Chapter 4: Camera and Mouse Controls
Introduction
Locking and hiding the mouse while the right mouse button is down
Clicking on an object in the scene (client-side)
Clicking on an object in the scene (server-side)
Picking up an item in the scene while the mouse is locked and hidden
Changing the camera's view and control mode
Giving the camera smooth movement
Having the camera follow a path
Chapter 5: Your Graphics Evolved
Introduction
Using the built-in video recording
Changing the material of a ShapeBase object using script
Building a custom material
Building a custom material using advanced lighting
Building a postFX
Chapter 6: Make That Sound Happen
Introduction
Playing a quick 2D or 3D sound on all clients
Using SFXEmitter to create networked sound effects
Playing a sound on a ShapeBase object
Playing music while a level is loading
How to have a background sound for a level
How to have music change according to the mood
Triggering an event during sound playback
Chapter 7: Game Objects
Introduction
Playing an animation sequence on a TSStatic class
Playing an animation sequence on a ShapeBase class
How to make it rain using a Precipitation object
Using the Lightning object to automatically create a thunderstorm
Using the TimeOfDay object to generate events
Chapter 8: Multiplayer Servers
Introduction
How to start a dedicated server
What ports are needed to be open or forwarded for a multiplayer server
Passing arbitrary parameters from the client to the server
How to become an admin on a server
Kicking and banning people from the server
Stopping a server from restarting when the last player leaves
Accessing the server connection from the client
How to access all client connections from the server
Broadcasting a message to all clients and having it displayed in the center of the screen
Chapter 9: Importance of Networking
Introduction
Sending a network event from the client to the server
Sending a network event from the server to the client
Connecting as a TCP client
Setting up a TCP server
Connecting as an HTTP client
Using an RSS feed for game news, message of the day, or other client messages
How to activate, deactivate, and use Telnet for console access
Chapter 10: Miscellaneous Gameplay Features
Introduction
How to have a sprinting player use up energy
Enabling and disabling air control
How to jump jet
Adjusting the fire spread of a weapon
Changing the number of shots fired from a weapon
Making a weapon use energy rather than ammo
Finding objects in range
Using the message producer/consumer system

Book Details

ISBN 139781849693547
Paperback380 pages
Read More