Unreal Engine 4 Blueprints: Odio e amore Roberto De Ioris - Codemotion Rome 2017

Preview:

Citation preview

Unreal Engine 4 Blueprints:

Hate and LoveRoberto De Ioris

@unbit http://aiv01.it

http://github.com/20tab

Codemotion Rome 2017

Disclaimer

https://github.com/20tab/UnrealEnginePython

Blueprints ?

Blueprints …

Blueprints :)

Blueprints :|

Blueprints :(

!!!

How to reduce Hate ?

First Rule: Use Events

Tick is an antipattern in Unreal Engine

Why Events ?• “Code” organization

• Networking friendly

• Time management for free

• Triggerable by animations too

• Easy to explain to non programmers: cause->effect

Come on, we need Ticks…

Use Components

MoveForwardComponent

Generating events from components: Event Dispatchers

Subscribing to Events

NO-if/branch

https://cirillocompany.de/pages/anti-if-campaign

Good Branch (single path)

Evil Branch

Anti-IF Weapons in Unreal Engine 4

• ENum’s

• Maps (UE4 >= 4.15)

• Switch statement (???)

• Events !

ENum + Switch Example

Organization: Multiple Graphs

CommentsConsider them as “visual grouping” too

Functions

Functions VS Events

• Events can be replicated (networking)

• Events can be interrupted (delay, timelines)

• Events cannot return values

• Events have no local variables

Macros• Raw way to re-organize code in function-like blocks

but without functions limits

Blueprint Utility FunctionsFor Programmers: Static functions ;)

Re-routing nodes

Auto-Collapsing

… collapsed to function

Debugging• Real time graph traversing

• watch values

• clients/server attaching

• break points

• stepping

A Debugging session

Interfaces• Decoupling

• Decoupling

• Decoupling

• Decoupling

• …

IDamageable

Hey !• Functions

• Interfaces

• Debugging

• Variables

• Conditionals

• Type Casting

• …

“I Fear Writing Blueprints IS programming…”

Blueprints VS C++• The UE4 C++ API is not fully exposed

• Using blueprints for shaders (materials) is extremely advantageous

• Interfacing with C/C++ is a must for libraries

• Good designed Blueprints are easy to read even for non programmers

• Blueprints are sometimes too much “silent” on error

The Obvious Truth ?

Honour the “good programming/design rules” and your blueprints will be more like coding instead of

spaghetti

Alternatives

• UnrealEnginePython

• Unreal.js

• SkookumScript

An Indie Success StoryDownward by Caracal Games

http://store.steampowered.com/app/506900/

Thanks• http://aiv01.it

• info@20tab.com

• https://github.com/20tab/UnrealEnginePython

• https://github.com/ncsoft/Unreal.js/

• http://skookumscript.com/