万本电子书0元读

万本电子书0元读

顶部广告

Torque 3D Game Development Cookbook电子书

售       价:¥

1人正在读 | 0人评论 9.8

作       者:David Wyand

出  版  社:Packt Publishing

出版时间:2013-01-25

字       数:340.1万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Cookbook; packed with recipes to help you create amazing 3D games with Torque. The recipes provide clear step-by-step instruction and practical examples to advance your understanding of Torque 3D and all of its subsystems. 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.
目录展开

Torque 3D Game Development Cookbook

Table of Contents

Torque 3D Game Development Cookbook

Credits

About the Author

About the Reviewers

www.PacktPub.com

Support files, eBooks, discount offers and more

Why Subscribe?

Free Access for Packt account holders

Preface

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the color images of this book

Downloading the example code

Errata

Piracy

Questions

1. TorqueScript: The Only Script You Need to Know

Introduction

Accessing delimited fields within a string

Getting ready

How to do it...

How it works...

There's more...

Skipping spaces (only tab and new line delimiters)

Skipping spaces and tabs (only new line delimiters)

See also

Iterating on words in a string list

Getting ready

How to do it...

How it works...

There's more...

See also

Retrieving components of a variable using accessors

Getting ready

How to do it...

How it works...

There's more...

See also

Iterating on objects in a SimSet or SimGroup collection

Getting ready

How to do it...

How it works...

There's more...

See also

Getting a random object from a SimSet or SimGroup collection

Getting ready

How to do it...

How it works...

See also

Finding an object in a SimSet or SimGroup collection using its internal name

Getting ready

How to do it...

How it works...

There's more...

Including children SimSet and SimGroup collections in the search

Using the special -> operator

Using the special --> operator

See also

Executing a method on a SimSet or SimGroup collection

Getting ready

How to do it...

How it works...

There's more...

See also

Creating a new SimObject instance

How to do it...

How it works...

There's more...

Creating a new SimObject instance with a globally unique name

Creating a new SimObject instance with defined properties

Creating a new SimObject instance based on another SimObject instance

See also

Creating a new internal name only SimObject instance

How to do it...

How it works...

There's more...

See also

Creating a new Datablock object

How to do it...

How it works...

There's more...

Creating a new Datablock object based on another Datablock object

Limited total number of Datablocks

The datablock keyword should only be used on the server

Datablock properties should be considered static

See also

Creating a new singleton

How to do it...

How it works...

See also

Extending a SimObject instance using the class property

Getting ready

How to do it...

How it works...

There's more...

Working with a class namespace after object creation

Extending even further with the superClass property

Understanding the namespace hierarchy

Limitations of the class property

See also

Using a variable to access methods or properties of a SimObject instance

Getting ready

How to do it...

How it works...

See also

Using call() to call a variable method on a SimObject instance with arguments

Getting ready

How to do it...

How it works...

There's more...

See also

Using call() to call a variable function with arguments

Getting ready

How to do it...

How it works...

There's more...

See also

Using script arrays as dictionaries

Getting ready

How to do it...

How it works...

See also

Using ArrayObject and custom script sorting callbacks

Getting ready

How to do it...

How it works...

See also

Scheduling SimObject methods

Getting ready

How to do it...

How it works...

There's more...

See also

Scheduling functions

Getting ready

How to do it...

How it works...

There's more...

See also

Activating and deactivating a package

Getting ready

How to do it...

How it works...

There's more...

2. Working with Your Editors

Introduction

Setting up fogging of the level

Getting ready

How to do it...

How it works...

There's more...

Fog and the ScatterSky class

How to cover seams and texture changes using decals placed in the World Editor

Getting ready

How to do it...

How it works...

There's more...

Working with decal instances

TSStatic shapes and decalType property

Copying the transform of an object to another in the World Editor window

Getting ready

How to do it...

How it works...

There's more...

Copying only position (or rotation, or scale) of an object

Nudging the selected object

Rotating an object using degrees

Manipulating more than one object

How to change the material of an object in the World Editor

Getting ready

How to do it...

How it works...

There's more...

Modifying materials that do not start with base_

Skinning multiple materials at once

Setting up a glow mask using the Material Editor window

Getting ready

How to do it...

How it works...

There's more...

Effect of alpha threshold on glow

Using more than one material

Using a convex shape as a zone

Getting ready

How to do it...

How it works...

There's more...

Quickly zoning a level

Game engine performance considerations

See also

Setting zone-specific ambient lighting

Getting ready

How to do it...

How it works...

See also

Grouping adjacent zones together

Getting ready

How to do it...

How it works...

See also

3. Graphical User Interface

Introduction

Creating a password text edit box

Getting ready

How to do it...

How it works...

There's more...

Using pushDialog() and popDialog() and setting up the UI file to work with them

Getting ready

How to do it...

How it works...

There's more...

Executing the .gui file of the dialog box

Standard dialog box callbacks

Making a non-modal dialog box

Difference between pushDialog() and setContent()

Using a different root control for the dialog box

Displaying metrics (such as FPS) from the console

Getting ready

How to do it...

How it works...

There's more...

A list of all standard metrics

Creating game-specific metrics

Displaying a list of all game objects

Getting ready

How to do it...

How it works...

Displaying a level at the main menu

Getting ready

How to do it...

How it works...

There's more...

Making the main menu level more interesting

Performance considerations

Dragging and dropping between two windows

Getting ready

How to do it…

How it works...

There's more...

Dialog boxes and the drag-and-drop operation

How to use the inventory and paper doll windows in a game

How to pass along game play information with the dragged controls

4. Camera and Mouse Controls

Introduction

Locking and hiding the mouse while the right mouse button is down

Getting ready

How to do it...

How it works...

There's more...

Clicking on an object in the scene (client-side)

Getting ready

How to do it...

How it works...

There's more...

Collision mesh required

Client-side-only limitations

Single-player games

Type masks

See also


Clicking on an object in the scene (server-side)

Getting ready

How to do it...

How it works...

There's more...

Collision mesh required

See also

Picking up an item in the scene while the mouse is locked and hidden

Getting ready

How to do it...

How it works...

There's more...

See also

Changing the camera's view and control mode

Getting ready

How to do it...

How it works...

See also

Giving the camera smooth movement

Getting ready

How to do it...

How it works...

There's more...

Camera speed boost and brakes using triggers

Smooth camera rotation

Having the camera follow a path

Getting ready

How to do it...

How it works...

There's more...

Maximum size of node list

Manually stopping and changing direction

Node callback

5. Your Graphics Evolved

Introduction

Using the built-in video recording

Getting ready

How to do it...

How it works...

There's more...

Playing back Theora videos on Windows

Record to individual PNG frames

Changing the material of a ShapeBase object using script

Getting ready

How to do it...

How it works...

There's more...

The setSkinName() method needs to be called on the server

Multiplayer considerations

Player class considerations

See also

Building a custom material

Getting ready

How to do it...

How it works...

There's more...

Using named render targets as sampler data sources

Single pass only

Passing defines to the shader compiler using ShaderData

Working with a custom GFXStateBlockData class

See also

Building a custom material using advanced lighting

Getting ready

How to do it...

How it works...

There's more...

See also

Building a postFX

Getting ready

How to do it...

How it works...

There's more...

Dynamically changing a postFX's texture

Defining shader macros

Chaining multiple postFX together

See also

6. Make That Sound Happen

Introduction

Playing a quick 2D or 3D sound on all clients

Getting ready

How to do it...

How it works...

There's more...

Limitations of ServerPlay2D

Limitations of ServerPlay3D

Local client sound playing equivalent

See also

Using SFXEmitter to create networked sound effects

Getting ready

How to do it...

How it works...

There's more...

Dynamically creating the sound source

Using a mono sound source

Sounds not fading with distance

See also

Playing a sound on a ShapeBase object

Getting ready

How to do it...

How it works...

See also

Playing music while a level is loading

Getting ready

How to do it...

How it works...

How to have a background sound for a level

Getting ready

How to do it...

How it works...

How to have music change according to the mood

Getting ready

How to do it…

How it works...

There's more...

SFXState activations are reference counted

Having more than one active SFXState instance

Triggering an event during sound playback

Getting ready

How to do it...

How it works...

There's more...

Only on client

Markers on an SFXEmitter class

Problem with looped sounds

See also

7. Game Objects

Introduction

Playing an animation sequence on a TSStatic class

Getting ready

How to do it...

How it works...

There's more...

See also

Playing an animation sequence on a ShapeBase class

Getting ready

How to do it...

How it works...

There's more...

Pausing an animation sequence playback

Jumping to a location in timeline of an animation sequence

Changing playback direction and speed of a sequence

See also

How to make it rain using a Precipitation object

Getting ready

How to do it...

How it works...

There's more...

Sprite sheet for drops and splashes

Using a shader for drops and splashes

Precipitation at a fixed location

Modifying precipitation over time

Global control of Precipitation drop density

See also

Using the Lightning object to automatically create a thunderstorm

Getting ready

How to do it...

How it works...

There's more...

Striking a player or vehicle

Manual lightning strikes

See also

Using the TimeOfDay object to generate events

Getting ready

How to do it...

How it works...

There's more...

Setting up the ScatterSky class for night

Manually modifying the time of day

See also

8. Multiplayer Servers

Introduction

How to start a dedicated server

Getting ready

How to do it...

How it works...

There's more...

The -game parameter

The -level parameter

Shutting down a dedicated server

See also

What ports are needed to be open or forwarded for a multiplayer server

How to do it...

How it works...

There's more...

Changing the port used by the game server

Master server considerations

Playing over a LAN

Passing arbitrary parameters from the client to the server

Getting ready

How to do it...

How it works...

How to become an admin on a server

Getting ready

How to do it...

How it works...

There's more...

Different types of administrators

Administrator password is server wide

Kicking and banning people from the server

Getting ready

How to do it...

How it works...

There's more...

Kicking or banning a player by name

Remotely kicking or banning a player

See also

Stopping a server from restarting when the last player leaves

Getting ready

How to do it...

How it works...

See also

Accessing the server connection from the client

How to do it...

See also

How to access all client connections from the server

How to do it...

How it works...

See also

Broadcasting a message to all clients and having it displayed in the center of the screen

How to do it...

How it works...

There's more...

Manually clearing the center print message

Individual client version of center print

9. Importance of Networking

Introduction

Sending a network event from the client to the server

Getting ready

How to do it...

How it works...

There's more...

Packed network strings

Packed empty strings

Packed network integers

Handling floating point numbers

See also

Sending a network event from the server to the client

Getting ready

How to do it...

How it works...

There's more...

See also

Connecting as a TCP client

Getting ready

How to do it...

How it works...

There's more...

Sending data to a server

Connecting and disconnecting

Success callbacks

Failure callbacks

See also

Setting up a TCP server

Getting ready

How to do it...

How it works...

There's more...

Handling more than one connection

Dropping a connection

See also

Connecting as an HTTP client

Getting ready

How to do it...

How it works...

There's more...

Separating the HTTP header and body

Processing an XML response

See also

Using an RSS feed for game news, message of the day, or other client messages

Getting ready

How to do it...

How it works...

See also

How to activate, deactivate, and use Telnet for console access

Getting ready

How to do it...

How it works...

There's more...

Disabling remote console access once it has been enabled

Telnet is not secure

10. Miscellaneous Gameplay Features

Introduction

How to have a sprinting player use up energy

How to do it...

How it works...

There's more...

Balance energy drain versus recharge rate

Modifying other sprint limitations

Disabling sprint

Enabling and disabling air control

How to do it...

How it works...

How to jump jet

Getting ready

How to do it...

How it works...

There's more...

Jump jet animation sequence

Disabling jump jetting

More control over the jump jet

See also

Adjusting the fire spread of a weapon

How to do it...

How it works...

Changing the number of shots fired from a weapon

How to do it...

How it works...

See also

Making a weapon use energy rather than ammo

Getting ready

How to do it...

How it works...

See also

Finding objects in range

How to do it...

How it works...

There's more...

Obtaining the distance to a found object

Obtaining the distance to the closest point to a found object

Searching for all objects of a particular type

A very quick search test

Performing a ray cast search of the scene graph

See also

Using the message producer/consumer system

Getting ready

How to do it...

How it works...

There's more...

Removing a listener from all event messages

Peeking into an EventManager instance

Index

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部