gdce 2015: blueprint components to c++

10
UE4 COMPONENT DESIGN: FROM BLUEPRINT PROTOTYPE TO C++ Zak Parrish [email protected] Gerke Max Preussner [email protected]

Upload: gerke-max-preussner

Post on 18-Aug-2015

99 views

Category:

Software


0 download

TRANSCRIPT

Page 1: GDCE 2015: Blueprint Components to C++

UE4 COMPONENT DESIGN:FROM BLUEPRINT PROTOTYPE TO C++

Zak [email protected]

Gerke Max [email protected]

Page 2: GDCE 2015: Blueprint Components to C++

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

Page 3: GDCE 2015: Blueprint Components to C++

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

Page 4: GDCE 2015: Blueprint Components to C++

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.

Page 5: GDCE 2015: Blueprint Components to C++

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!

Page 6: GDCE 2015: Blueprint Components to C++

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

Page 7: GDCE 2015: Blueprint Components to C++

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

Page 8: GDCE 2015: Blueprint Components to C++

And now...

a demonstration!Yay!

Page 9: GDCE 2015: Blueprint Components to C++

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

Page 10: GDCE 2015: Blueprint Components to C++

Questions?