logo资料库

Unreal Engine 4.X By Example.pdf

第1页 / 共614页
第2页 / 共614页
第3页 / 共614页
第4页 / 共614页
第5页 / 共614页
第6页 / 共614页
第7页 / 共614页
第8页 / 共614页
资料共614页,剩余部分请下载后查看
Unreal Engine 4.X By Example
Credits
About the Author
About the Reviewer
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Introduction to Unreal Engine 4
Navigating this book
Game Projects you say?
Installing Unreal Engine 4
Creating your first project!
Navigating the Unreal Engine UI
Creating a basic actor
Objects, Actors, Pawns, and Characters
Adding components to your Actor
The component hierarchy
Modifying components
3D transformation and axis
Adding the Unreal factor
Pre-Built projects as a learning resource
Summary
2. Blueprints and Barrels – Your First Game
Creating your first Blueprint
The Blueprint window
Working with Blueprints
Blueprint elements
Graphs
Functions
Macros
Variables
Event dispatchers
Modifying the Hello Sphere Blueprint
Working with Blueprint graphs
Compiling Blueprints
Using Blueprint variables
Utilizing the Blueprint palette
Blueprint meta-data and string manipulation
Creating the Barrel Hopper project!
Creating our Character
Bringing our character to life
Giving our character a mesh
Creating the character's camera
Game modes and how to make them
Creating and receiving input events
Creating the input Events
Receiving input events
Tweaking the character movement component
Building the level!
Camera tips and tricks
Camera settings
Controlling the camera
Creating the level
Blocking geometry
Geometry Brushes and how to use them
Placing the geometry
Converting a geometry Brush to a static mesh
Applying materials to geometry brushes
Level building and trigonometry!
Getting our barrels rolling
Applying physics to objects
Barrel spawners and Blueprint timers
Creating Blueprint variables
Event tick
Branch nodes
Trigger volumes and destroying Actors
Debugging our Blueprints
Masking our destruction with particles
Respawning the player
Delay nodes
Player controllers
Hit Events
Summary
3. Advanced Blueprint, Animation, and Sound
Cleaning up shop
Logic flow
Using a sequence
Creating custom cameras
Where do we spawn the camera?
Spawning the camera object
Setting the Target View
Respawning the player with a Blueprint function
Creating the Blueprint function
Animation with UE4
Animation Conventions
Animation Blueprints
Importing and exporting animation assets
Creating your first animation Blueprint
Navigating animation Blueprints
The toolbar
Populating the Animation graph
Working with state machines
State nodes
Transition Rules
Playing animations from within states
Finishing our state machine
The Animation Blueprint Event graph
Getting our character running
Working with Blendspaces
Creating the running Blendspace
Utilizing the running Blendspace
Creating your first sound scape
Importing sounds and sound cues
Working with sound cues
Sound modification
Playing sounds via animation notifications
Working with animation assets
Notifies
Curves
Additive layers
Statistics bar
Placing the animation notifies
Finishing our soundscape
Exploding barrels
Players death rattle
Looping level sound
Adding the finishing touches to Barrel Hopper
Ragdolls and Event dispatchers
Creating a basic HUD
Making the HUD object
Drawing the in game HUD
Making the font
Parsing information to and setting the HUD
An end goal for the player, the chapter, and the project
Summary
4. Unreal Engine, C++, and You
UE and C++
Why use C++
Polymorphism, virtual inheritance and templates
Hello World for C++
Exploring your first code class
Accommodating for the Unreal Build Tool
Pre-Compile macros and you
Breaking down the rest of the header file
The default constructor and include list
Virtual functions and calling the parent
Adding components and object creators
Construction helpers and object finders
Building the code
Adding Fire Particles and Hot Compilation
Setting the sphere on fire
Hot Compilation
Hello world text and receiving events through delegates
Adding the 3D text
Delegates and Events
Polishing the sphere
Changing materials via C++
Extending C++ into Blueprint
Extending a class with no macro specifier support
Extending a class with macro specifier support
Defining a class with macro specifiers
Working with code created components
Blueprint native events and you!
Overriding a BlueprintNativeEvent
Summary
5. Upgrade Activated – Making Bounty Dash with C++
Creating a C++ character
Create the C++ project
The UE4 object hierarchy
Creating the Character
What we have been given
What we are going to need
BountyDashCharacter's members
BountyDashCharacters methods
Constructing the Character
Borrowing from the old to make the new
Assigning Blueprints in code with generated classes
Setting up the components
Assuming default control
Writing the begin Play function
Getting In-Editor objects using the Game World
Sorting TArrays with Lambdas
Setting up inputs in C++
Binding actions
How our Character is going to Tick
Compile time
Creating the C++ world objects
Converting BSP brushes to a static mesh
Smoke and mirrors with C++ objects
Modifying the BountyDashGameMode
BountyDashGameMode class definition
BountyDashGameMode function definitions
Getting our game mode via Template functions
Coding the floor
Floor class definition
Floor function definitions
AFloor::AFloor() constructor
AFloor::Tick()
Placing the Floor in the level!
Creating the obstacles
Spawning actors from C++!
Obstacle Spawner class definition
Obstacle Spawner function definitions
Getting information from components in C++
Ensuring the Obstacle Spawner works
Minting the coin object
Coin class definition
Coin function definitons
Making the coin Blueprint!
Making it rain coins, creating the coin spawner
Coin Spawner class Definition
Coin Spawner function definitions
Testing what we have so far!
Creating the interactions between the world objects
Pushing the Character
ABountyDashCharacter Collision functions
Pushing the character back
Picking up coins
Coin collision
Summary
6. Power Ups for Your Character, Power Ups for the User
Cleaning up shop and object hierarchies
BountyDashObject
Modifying existing objects
Creating a Plug-in with C++
Modules and code files
The anatomy of a plugin
Describing a plugin
PowerUpPlugin.uplugin
Working with our first plugin module
PowerUpPlugin.Build.cs
Declaring the PowerUpPlugin code module
Adding the PowerUp object
Using our plugin in engine
Creating the BountyDashPowerUp object
Incorporating power-ups into Bounty Dash
Modifying the Coin Spawner
Build, run, and test!
Colliding with power ups
Powering up the character
Reducing the game speed
Making the coin magnet
How to create, load and smash Destructible Meshes
Creating HUDs using C++
ABountyDashHUD
Getting information from our objects
Setting the HUD class in the game mode
Implementing a custom DrawHUD function
Completing the Bounty Dash game loop!
The beginning of the end and pausing the game
Pausing the Game
Restarting the game
Drawing the game over text
Finishing the wall of death and polishing the project
Making the wall of death
Making the new floor mesh
ADestroyedFloorPiece
Modifying the AFloor object
Bells, whistles and explosions
Playing sound from C++
Playing particles from C++
Getting the character to run
The last bit of concealer
Summary
7. Boss Mode Activated – Unreal Robots
Setting up the project
The first-person character
Importing what we need
Beginning the FPC
Establishing a FPC aim/movement
Defining the FPC constructor
Defining the FPC move and aim functions
Creating the input bindings
Binding the inputs
Abstracting a BM character into Blueprint
Setting a Blueprint object as the default pawn in a C++ game mode
Testing what we have!
Adding a custom HUD and drawing a cross hair
BMHUD class definition
Defining the BMHUD
Creating the projectile
Defining the Projectile
Initializing the Projectile
Colliding with the Projectile
Subclass templates and firing the projectile
Modifying BMCharacter accommodate for the projectile
Creating the FPProjectile Blueprint
Modifying FPCharacter
Unreal Robots
AI breakdown
Preparing your project for AI intergration
Creating the AI character base class
Creating your first AI controller
Behavior tree breakdown and logic flow
What are blackboards?
Creating a basic behavior tree and black-board!
Setting up the blackboard
The behavior tree Editor
Setting up the behavior Tree
Creating a custom task via blueprint
Creating a custom decorator using blueprint
Creating a custom service using C++
Defining the BMArgoCheck class
Advanced collision in UE4
Defining the service tick
Adding the C++ service to the BossBT
Integrating the AI Character
Creating a custom object collision channel
Modifying the level to support AI
What is a navigation mesh
Adjusting the NavMesh generation settings
Placing a NavMesh in the scene
Placing the AI in the level and testing
Summary
8. Advanced AI and Unreal Rendering
Expanded AI and tracking projectiles
Tracking projectiles and you
Creating the line trace
Preparing the projectile
Creating the custom channel and testing the tracking!
Expanded AI
Damage in UE4
Boss state and enums in blackboard!
Interpreting our C++ enum in Blackboard
Modifying the BossBT to support Boss States
Debugging BossBT to check Blackboard values
Upgrading the ABMIController
Tracking to the player
Testing what we have so far
Arming the boss
Adding the Turret boss state
The Final Behaviour State
BMRandomMoveTo
Finishing the BossBT
AI Complete
Rendering in UE4
UE4 Materials
What are materials
Physically Based Rendering
The Material editor
The Toolbar
The Viewport
The Graph and Base material node
The Details panel
The stats panel
The Palette
Starting the Boss outer material
Your first material expression and color channels
Applying a Normal Map and the texture viewer
Emissive color and masks
Adding more detail and advanced material use
Texture UV's and adding normals
Functions of time within materials and pulsing glow
Making the Boss inner material
Setting up what we know
Masking values based on UV
Applying the material to the Boss
Summary
9. Creating a Networked Shooter
Creating the project
Adding a marketplace package
Network multiplayer theory
Networking patterns
Peer to Peer (P2P)
Client/server
UE4 Networking
Dedicated or listen servers
UE4 replication
Network role
Remote Procedure Calls (RPCs)
Types of RPC
Defining RPCs
Net ownership, player controllers and game modes
Starting the networked First Person Shooter
Preparing the NS project
Making a networked player character
NSCharacter visual and audio assets
Player states and networking
Finishing the Player class definition
Writing the ANSCharacter RPCs
Defining the ANSCharacter functions
Dynamic materials and material parameters
Getting the player to shoot… online
Taking damage and UE4 timers
Cleaning up shop
Preparing the ANSCharacter blueprint
Preparing the third-person Mesh
Creating the force feedback asset
Custom collision channel
Highlighting the VectorParameter that drives team color
Making the fire montage assets
Tying it all together
Testing the multiplayer with a PIE session!
Spawn points and spawning the players
Defining the ANSSpawnPoint class
ANSSpawnPoint function definitions
Game modes and servers
Game mode class definition
Construction the Game mode and Finding Spawn points
Ending the Game and ticking the game mode
Connecting players
Spawning the players
Respawning the player
Preparing our game map
Testing our game functionality
Drawing the HUD and preparing the lobby
Creating the GameState
Drawing in the HUD
Testing our Game
Summary
10. Goodbyes and Thank yous
Packaging a project
Build Targets
Build configuration
Compiler specific building to configuration
Packaging NS
Testing the NS package
Creating the listen server instance
Console commands
Connecting to the local host
Profiling using the console commands
Console visualizations
Wrapping up the NS project
What we have learned so far
The Editors
Blueprints
Unreal animation
C++
Artificial Intelligence
Unreal Rendering
Unreal networking!
Summary
Index
Unreal Engine 4.X By Example
Table of Contents Unreal Engine 4.X By Example Credits About the Author About the Reviewer www.PacktPub.com eBooks, discount offers, and more Why subscribe? Preface What this book covers What you need for this book Who this book is for Conventions Reader feedback Customer support Downloading the example code Downloading the color images of this book Errata Piracy Questions 1. Introduction to Unreal Engine 4 Navigating this book Game Projects you say? Installing Unreal Engine 4 Creating your first project! Navigating the Unreal Engine UI Creating a basic actor Objects, Actors, Pawns, and Characters Adding components to your Actor The component hierarchy Modifying components 3D transformation and axis Adding the Unreal factor Pre-Built projects as a learning resource Summary 2. Blueprints and Barrels – Your First Game Creating your first Blueprint The Blueprint window Working with Blueprints Blueprint elements
Graphs Functions Macros Variables Event dispatchers Modifying the Hello Sphere Blueprint Working with Blueprint graphs Compiling Blueprints Using Blueprint variables Utilizing the Blueprint palette Blueprint meta-data and string manipulation Creating the Barrel Hopper project! Creating our Character Bringing our character to life Giving our character a mesh Creating the character’s camera Game modes and how to make them Creating and receiving input events Creating the input Events Receiving input events Tweaking the character movement component Building the level! Camera tips and tricks Camera settings Controlling the camera Creating the level Blocking geometry Geometry Brushes and how to use them Placing the geometry Converting a geometry Brush to a static mesh Applying materials to geometry brushes Level building and trigonometry! Getting our barrels rolling Applying physics to objects Barrel spawners and Blueprint timers Creating Blueprint variables Event tick Branch nodes Trigger volumes and destroying Actors Debugging our Blueprints Masking our destruction with particles Respawning the player Delay nodes Player controllers Hit Events Summary
3. Advanced Blueprint, Animation, and Sound Cleaning up shop Logic flow Using a sequence Creating custom cameras Where do we spawn the camera? Spawning the camera object Setting the Target View Respawning the player with a Blueprint function Creating the Blueprint function Animation with UE4 Animation Conventions Animation Blueprints Importing and exporting animation assets Creating your first animation Blueprint Navigating animation Blueprints The toolbar Populating the Animation graph Working with state machines State nodes Transition Rules Playing animations from within states Finishing our state machine The Animation Blueprint Event graph Getting our character running Working with Blendspaces Creating the running Blendspace Utilizing the running Blendspace Creating your first sound scape Importing sounds and sound cues Working with sound cues Sound modification Playing sounds via animation notifications Working with animation assets Notifies Curves Additive layers Statistics bar Placing the animation notifies Finishing our soundscape Exploding barrels Players death rattle Looping level sound Adding the finishing touches to Barrel Hopper Ragdolls and Event dispatchers Creating a basic HUD
Making the HUD object Drawing the in game HUD Making the font Parsing information to and setting the HUD An end goal for the player, the chapter, and the project Summary 4. Unreal Engine, C++, and You UE and C++ Why use C++ Polymorphism, virtual inheritance and templates Hello World for C++ Exploring your first code class Accommodating for the Unreal Build Tool Pre-Compile macros and you Breaking down the rest of the header file The default constructor and include list Virtual functions and calling the parent Adding components and object creators Construction helpers and object finders Building the code Adding Fire Particles and Hot Compilation Setting the sphere on fire Hot Compilation Hello world text and receiving events through delegates Adding the 3D text Delegates and Events Polishing the sphere Changing materials via C++ Extending C++ into Blueprint Extending a class with no macro specifier support Extending a class with macro specifier support Defining a class with macro specifiers Working with code created components Blueprint native events and you! Overriding a BlueprintNativeEvent Summary 5. Upgrade Activated – Making Bounty Dash with C++ Creating a C++ character Create the C++ project The UE4 object hierarchy Creating the Character What we have been given What we are going to need BountyDashCharacter’s members
BountyDashCharacters methods Constructing the Character Borrowing from the old to make the new Assigning Blueprints in code with generated classes Setting up the components Assuming default control Writing the begin Play function Getting In-Editor objects using the Game World Sorting TArrays with Lambdas Setting up inputs in C++ Binding actions How our Character is going to Tick Compile time Creating the C++ world objects Converting BSP brushes to a static mesh Smoke and mirrors with C++ objects Modifying the BountyDashGameMode BountyDashGameMode class definition BountyDashGameMode function definitions Getting our game mode via Template functions
 Coding the floor Floor class definition Floor function definitions AFloor::AFloor() constructor AFloor::Tick() Placing the Floor in the level! Creating the obstacles Spawning actors from C++! Obstacle Spawner class definition Obstacle Spawner function definitions Getting information from components in C++ Ensuring the Obstacle Spawner works Minting the coin object Coin class definition Coin function definitons Making the coin Blueprint! Making it rain coins, creating the coin spawner Coin Spawner class Definition Coin Spawner function definitions Testing what we have so far! Creating the interactions between the world objects Pushing the Character ABountyDashCharacter Collision functions Pushing the character back Picking up coins Coin collision
Summary 6. Power Ups for Your Character, Power Ups for the User Cleaning up shop and object hierarchies BountyDashObject Modifying existing objects Creating a Plug-in with C++ Modules and code files The anatomy of a plugin Describing a plugin PowerUpPlugin.uplugin Working with our first plugin module PowerUpPlugin.Build.cs Declaring the PowerUpPlugin code module Adding the PowerUp object Using our plugin in engine Creating the BountyDashPowerUp object Incorporating power-ups into Bounty Dash Modifying the Coin Spawner Build, run, and test! Colliding with power ups Powering up the character Reducing the game speed Making the coin magnet How to create, load and smash Destructible Meshes Creating HUDs using C++ ABountyDashHUD Getting information from our objects Setting the HUD class in the game mode Implementing a custom DrawHUD function Completing the Bounty Dash game loop! The beginning of the end and pausing the game Pausing the Game Restarting the game Drawing the game over text Finishing the wall of death and polishing the project Making the wall of death Making the new floor mesh ADestroyedFloorPiece Modifying the AFloor object Bells, whistles and explosions Playing sound from C++ Playing particles from C++ Getting the character to run The last bit of concealer Summary
分享到:
收藏