Unreal Engine 4 Scripting with C++ Cookbook [全彩]

所需积分/C币:50 2018-06-27 10:52:24 6.89MB PDF
收藏 收藏 2

Unreal Engine 4 (UE4) is a complete suite of game development tools made by game developers, for game developers. With more than 100 practical recipes, this book is a guide showcasing techniques to use the power of C++ scripting while developing games with UE4. It will start with adding and editing
Unreal Engine 4 Scripting with C++ Cookbook Copyright c 2016 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system or transmitted in any form or by any means without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: October 2016 Production reference: 1171016 Published by Packt Publishing Ltd Livery Place 35 Livery Street Birmingham B3 2PB, UK SBN978-1-785885549 www.packtpub.com Credits Authors Project Coordinator William sherif Ulhas hambali Stephen whittle Proofreader Reviewer Safis editing John doran Indexer Commissioning editor Hemangini Bari Amarabha banerjee Graphics Acquisition Editor Jason monteiro meet thal Sa Content Development Editor Production coordinator Prashanth g Melwyn Dsa Technical Editor Cover Work Sunith Shetty Melwyn ds Copy Editor Sonia mathur About the authors William Sherif is a C++ programmer with more than eight years of 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 is a game developer and educator with nearly 10 years of development experience, most of which has been done using Unreal Engine. He is a community contributor to the engine, with features or bug fixes included in almost every major version of the engine since its public release Id like to thank God; my partner, Nichelle; and my family and colleagues for their constant support while I wrote this book. Epic Games, in particular Mike Fricker and Alex paschall, have also provided invaluable assistance About the reviewer John doran is a technical game designer who has been creating games for over 10 years He has worked on an assortment of games in teams from just himself to over 70 in student mod, and professional projects in different roles from game designer to lead ul programmer. He previously worked at LucasArts on Star Wars 1313 as a game designer. He later graduated from DigiPen Institute of Technology in Redmond, WA, with a bachelor of science in game design In addition to working at digiPen Game Studios John is currently a part of DigiPen 's research and development branch in Singapore. He is also the lead instructor of the DigiPen-Ubisoft campus game programming program, instructing graduate-level students in an intensive, advanced game-programming curriculum. He also tutors and assists students on various subjects, including C, C++, Unreal, Unity, and game design He has authored Unity 5x Game Development Blueprints, Unreal Engine game Development Cookbook, Building an FPS Game in Unity, Unity Game Development Blueprints, Getting Started with UDK, UDK Game Development, Mastering UDK Game Development, and coauthored UdK iOS Game Development Beginner's Guide, all by Packt Publishing. You can findmoreabouthimathttp://johnpdoran.com www.packtpub.com eBooks discount offers and more Did you know that Packt offers e Book versions of every book published, with PDF and e Pub filesavailableYoucanupgradetotheebookversionatwww.PacktPub.comandasaprint book customer, you are entitled to a discount on the eBook copy. Get in touch with us at customercare@packtpub com for more details. Atwww.Packtpub.comyoucanalsoreadacollectionoffreetechnicalarticlessignupfor a range of free newsletters and receive exclusive discounts and offers on packt books and Books https://www.packtpub.com/mapt Get the most in-demand software skills with Mapt. mapt gives you full access to all Packt books and video courses, as well as industry-leading tools to help you plan your personal development and advance your career Why subscribe? Fully searchable across every book published by Packt opy and paste, print, and bookmark content b on demand and accessible via a web browser Table of contents Preface Chapter 1: UE4 Development Tools Introduction Installing visual studio Creating and building your first C++ project in visual Studio 12248 Changing the code font and color in Visual Studio Extension changing the color theme in visual Studio Formatting your code(autocomplete settings in Visual Studio 15 Shortcut keys in Visual Studio Extended mouse usage in visual Studio 19 UE4-installlation 19 UE4- first project 21 UE4-creating your first level 22 UE4-logging with UE_LOG 23 UE4-making an FString from STrings and other variables 25 Project management on GltHub-gettlng your Source Control 26 Project management on GitHub- using the Issue Tracker 28 Project management on visualstudio. com -managing the tasks in your project 31L Project management on visualstudio. com - constructing user stories and tasks 34 Chapter 2: Creating classes 39 Introduction 40 Making a UCLASS-deriving from Uobject 40 Creating a user-editable UPROPERTY 45 Accessing a UPROPERTY from Blueprints 47 Specifying a UCLASS as the type of a UPROPERTY 49 Creating a Blueprint from your custom UCLASS 51 Table of contents Instantiating Uobject-derlved classes(Constructobject and Newobject≤ 53 Destroying Uobject-derlved classes 55 Creating a USTRUCT 56 Creating a UENUMO 58 Creating a UFUNCTION 58 Chapter 3: Memory Management and smart Pointers 61 Introduction 62 Unmanaged memory-usIng malloc(free 62 Unmanaged memory -using new/ delete 64 Managed memory -using Newobject< and Constructobject< 65 Managed memory deallocating memory 67 Managed memory smart pointers(TsharedPtr, TWeakPtr, TAutoPtr) to track an object 68 Using TSco Pointer to track an object 69 Unreal's garbage collection system and UPROPERTY( 70 Forcing garbage collection 71 Breakpoints and stepping through code 71 Finding bugs and using call stacks 73 Using the Profiler to identify hot spots Chapter 4: Actors and components Introduction Creating a custom Actor in C++ 78 Instantiating an Actor using SpawnActor 82 Destroying an Actor using Destroy and a timer 85 Destroying an Actor after a delay using SetLife span 86 Implementing the Actor functionality by composition 87 Loading assets into components using FobjectFinder 89 Implementing the Actor functionality by inheritance 92 Attaching components to create a hierarchy 95 Creating a custom Actor Component 99 Creating a custom Scene Component 102 Creating a custom Primitive Component 106 Creating an Inventory component for an RPG 114 Creating an OrbitingMovement Component 125 Creating a building that spawns units 129 Chapter 5: Handling Events and Delegates 137 HandlIng events Implemented vla virtual functions 137 Creating a delegate that is bound to a UFUNCTION 140 Unregistering a delegate 143 Table of contents Creating a delegate that takes input parameters 144 Passing payload data with a delegate binding 146 Creating a multicast delegate 148 Creating a custom Event 150 Creating a Time of Day handler 153 Creating a respawning pickup for an First Person Shooter 157 Chapter 6: Input and collision 163 Introduction 163 AXls Mappings- keyboard, mouse and gamepad directional Input for an fps character 164 Axis Mappings- normalized input 166 Action Mappings- one button responses for an FPs character 168 Adding Axis and Action Mappings from C++ 169 Mouse Ul input handling 171 UMG keyboard Ul shortcut keys 172 Collision - letting objects pass through one another using ignore 173 Collision picking up objects using overlap 175 Collision- preventing interpenetration using block 178 Chapter 7: Communication between Classes and Interfaces 181 Introduction 182 Creating a InTerface 182 Implementing a INterface on an object 184 Checking if a class implements a UInterface 185 Casting to a UInterface implemented in native code 186 Calling native UInterface functions from C++ 189 Inheriting INterface from one another 194 Overriding UInterface functions in C++ 198 Exposing UInterface methods to Blueprint from a native base class 202 Implementing UInterface functions in Blueprint 205 Creating C++ UInterface function Implementations that can be overridden in Blueprint 208 Calling Blueprint-defined interface functions from C++ 211 Implementing a simple interaction system with Ulnterfaces 216 Chapter 8: Integrating ctt and the Unreal Editor 225 Introduction 226 UsIng a class or struct as a blueprInt varlable 226 Creating classes or structs that can be subclassed in Blueprint 230 CreatIng functions that can be called In Blueprint 232 Creating events that can be implemented in blueprint 236 Exposing multi-cast delegates to Blueprint 240 II

试读 127P Unreal Engine 4 Scripting with C++ Cookbook [全彩]
立即下载 低至0.43元/次 身份认证VIP会员低至7折
    yangguosd 再来下载。。
    • 分享精英

    关注 私信 TA的资源
    Unreal Engine 4 Scripting with C++ Cookbook [全彩] 50积分/C币 立即下载
    Unreal Engine 4 Scripting with C++ Cookbook [全彩]第1页
    Unreal Engine 4 Scripting with C++ Cookbook [全彩]第2页
    Unreal Engine 4 Scripting with C++ Cookbook [全彩]第3页
    Unreal Engine 4 Scripting with C++ Cookbook [全彩]第4页
    Unreal Engine 4 Scripting with C++ Cookbook [全彩]第5页
    Unreal Engine 4 Scripting with C++ Cookbook [全彩]第6页
    Unreal Engine 4 Scripting with C++ Cookbook [全彩]第7页
    Unreal Engine 4 Scripting with C++ Cookbook [全彩]第8页
    Unreal Engine 4 Scripting with C++ Cookbook [全彩]第9页
    Unreal Engine 4 Scripting with C++ Cookbook [全彩]第10页
    Unreal Engine 4 Scripting with C++ Cookbook [全彩]第11页
    Unreal Engine 4 Scripting with C++ Cookbook [全彩]第12页
    Unreal Engine 4 Scripting with C++ Cookbook [全彩]第13页
    Unreal Engine 4 Scripting with C++ Cookbook [全彩]第14页
    Unreal Engine 4 Scripting with C++ Cookbook [全彩]第15页
    Unreal Engine 4 Scripting with C++ Cookbook [全彩]第16页
    Unreal Engine 4 Scripting with C++ Cookbook [全彩]第17页
    Unreal Engine 4 Scripting with C++ Cookbook [全彩]第18页
    Unreal Engine 4 Scripting with C++ Cookbook [全彩]第19页
    Unreal Engine 4 Scripting with C++ Cookbook [全彩]第20页


    50积分/C币 立即下载 >