Introductory slides for our live coding demonstration at GDC Europe on August 4th, 2015. We are creating a hover component in Blueprint and converting it to a C++ plug-in. The corresponding Visual Studio project files are available at https://headcrash.industries/vault/presentations/gdc-europe/
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
GDCE 2015: Blueprint Components to C++
1. UE4 COMPONENT DESIGN:
FROM BLUEPRINT PROTOTYPE TO C++
Zak Parrish
zak.parrish@epicgames.com
Gerke Max Preussner
max.preussner@epicgames.com
2. Overview
● Key Terms and Concepts
○ UE4’s Framework (High Level)
■ Actors & Components
○ What is Blueprint?
● Prototyping a Custom Component using Blueprint
○ Where to begin
○ Building our first component (Hover Component)
● Converting to C++
○ Deconstructing artist’s intent
○ Adding code to project
○ Replacing Blueprint asset with native version
3. UE4 Framework at a Glance
● Object
○ Engine’s highest-level base class
■ In C++, UObject is the base of all classes
○ Lots of “under-the-hood” functionality
■ Garbage collection
■ Metadata (UProperty)
■ Support for exposing variables to the Editor
■ Serialization
■ Loading and Saving
○ Just about everything in Unreal inherits from (or gets some functionality from) Object
4. UE4 Framework at a Glance
● Actor
○ Inherits from Object
■ C++ class is AActor
○ Used for anything that is placed in your game’s world
○ Supports 3D transformations
■ Position
■ Rotation
■ Scale
○ There are many Actor types included with the Engine
■ If it is actually in your game, it’s probably some kind of actor
■ Characters, meshes, lights, particle systems… just about everything.
5. UE4 Framework at a Glance
● Component
○ Inherits from Object
■ C++ class is UActorComponent
○ The “building blocks” of Actors
○ Self-contained piece of modular functionality
○ Can be added to or removed from any Actor
And best of all…
YOU CAN MAKE THEM IN BLUEPRINT!
6. What is Blueprint?
● Powerful visual scripting language
● Tailored to artists, visual people
● Solves communication problems
between artists and programmers
● Allows you to create compiled script
using nodes and wires instead of
code
● Includes a variety of real-time
debugging features
7. Blueprint vs. C++
● Blueprint is great for fast iteration!
● Blueprint has lower performance than native C++
○ Runs on its own VM layer
○ Approximately 8-10x slower than native code
○ For most simple event-based game tasks, you probably won’t notice
○ Many AAA games are using Blueprint in shipping titles (incl. Epic!)
○ Anything running on every frame (tick) should probably be native (physics calculations)
● Still, Blueprint is excellent for prototyping!
○ Often faster for a designer to create what they want in Blueprint, then let a programmer
convert it to code
○ This is how we often use Blueprint at Epic
9. Conclusion
● Blueprint makes it easy for visual developers to implement ideas!
● The nature of the graph makes it easy for programmers to reproduce (and optimize!)
● Code can be added to any project right inside the Editor
● Faster collaboration, clearer communication