Unreal Engine 4.x Scripting with C++ Cookbook - Second Edition

More Information
Learn
  • Create C++ classes and structs that integrate well with UE4 and the Blueprints editor
  • Discover how to work with various APIs that Unreal Engine already contains
  • Utilize advanced concepts such as events, delegates, and interfaces in your UE4 projects
  • Build user interfaces using Canvas and UMG through C++
  • Extend the Unreal Editor by creating custom windows and editors
  • Implement AI tasks and services using C++, Blackboard, and Behavior Trees
  • Write C++ code with networking in mind and replicate properties and functions
About

Unreal Engine 4 (UE4) is a popular and award-winning game engine that powers some of the most popular games. A truly powerful tool for game development, there has never been a better time to use it for both commercial and independent projects. With more than 100 recipes, this book shows how to unleash the power of C++ while developing games with Unreal Engine.

This book takes you on a journey to jumpstart your C++ and UE4 development skills. You will start off by setting up UE4 for C++ development and learn how to work with Visual Studio, a popular code editor. You will learn how to create C++ classes and structs the Unreal way. This will be followed by exploring memory management, smart pointers, and debugging your code. You will then learn how to make your own Actors and Components through code and how to handle input and collision events. You will also get exposure to many elements of game development including creating user interfaces, artificial intelligence, and writing code with networked play in mind. You will also learn how to add on to the Unreal Editor itself.

With a range of task-oriented recipes, this book provides actionable information about writing code for games with UE4 using C++. By the end of the book, you will be empowered to become a top-notch developer with UE4 using C++ as your scripting language!

Features
  • Build captivating multiplayer games using Unreal Engine and C++
  • Incorporate existing C++ libraries into your game to add extra functionality such as hardware integration
  • Practical solutions for memory management, error handling, inputs, and collision for your game codebase
Page Count 708
Course Length 21 hours 14 minutes
ISBN 9781789809503
Date Of Publication 29 Mar 2019
Introduction
Technical requirements
Unmanaged memory – using malloc( ) / free( )
Unmanaged memory – using new/delete
Managed memory – using NewObject< > and ConstructObject< >
Managed memory – de-allocating memory
Managed memory – smart pointers (TSharedPtr, TWeakPtr, TAutoPtr) to track an object
Using TScopedPointer to track an object
Unreal's garbage collection system and UPROPERTY( )
Forcing garbage collection
Breakpoints and stepping through code
Finding bugs and using call stacks
Using the profiler to identify hot spots
Introduction
Technical requirements
Axis Mappings – keyboard, mouse, and gamepad directional input for an FPS character
Axis Mappings – normalized input
Action Mappings – one-button responses for an FPS character
Adding Axis and Action Mappings from C++
Mouse UI input handling
UMG keyboard UI shortcut keys
Collision – letting objects pass through one another using Ignore
Collision – picking up objects using Overlap
Collision – preventing interpenetration using Block
Introduction
Technical requirements
Core/Logging API – defining a custom log category
Core/Logging API – FMessageLog to write messages to the Message Log
Core/Math API – rotation using FRotator
Core/Math API – rotation using FQuat
API – rotation using FRotationMatrix to have one object face another
GameplayAbilities API – triggering an actor's gameplay abilities with game controls
GameplayAbilities API - Implementing stats with UAttributeSet
GameplayAbilities API – implementing buffs with GameplayEffect
GameplayTasks API – making things happen with GameplayTasks
HTTP API – downloading webpages using web requests
HTTP API – displaying downloaded progress 

Authors

John P. Doran

John P. Doran is a passionate and seasoned technical game designer, software engineer, and author based in Peoria, Illinois.

For over a decade, John has gained extensive hands-on expertise in game development, working in a variety of roles, ranging from game designer to lead UI programmer. Additionally, John has worked in game development education teaching in Singapore, South Korea, and the United States. To date, he has authored over 10 books pertaining to game development.

John is currently an instructor in residence at Bradley University. Prior to his present ventures, he was an award-winning videographer.

William Sherif

William Sherif is a C++ programmer with more than eight years' experience in the programming world, ranging from game programming to web programming. He also worked as a university course instructor (sessional) for seven years. Additionally, he released several apps on the iTunes store, including Strum and MARSHALL OF THE ELITE SQUADRON. In the past, he has won acclaim for delivering course material in an easy-to-understand manner.

Stephen Whittle

Stephen Whittle is a game developer and educator with nearly 10 years' development experience, most of which has been done using the Unreal Engine. He is a community contributor to the engine, having features or bug fixes included in almost every major version of the engine since its public release.