Programming in UE4 A Quick Orientation for Coders Gerke Max Preussner

Slides:



Advertisements
Similar presentations
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 12 Introduction to ASP.NET.
Advertisements

CS 11 C track: lecture 7 Last week: structs, typedef, linked lists This week: hash tables more on the C preprocessor extern const.
Code Correctness, Readability, Maintainability Svetlin Nakov Telerik Corporation
Epic’s Build Tools & Infrastructure
Things to Remember When Developing 64-bit Software OOO "Program Verification Systems"
C++ Templates. What is a template? Templates are type-generic versions of functions and/or classes Template functions and template classes can be used.
Coding Standard: General Rules 1.Always be consistent with existing code. 2.Adopt naming conventions consistent with selected framework. 3.Use the same.
Game Framework & Sample Projects
The Slate UI Framework Architecture & Tools Gerke Max Preussner
Extensibility in UE4 Customizing Your Games and the Editor Gerke Max Preussner
Concurrency & Parallelism in UE4
Integrating a Cloud Service Joe Overview Example from our games Support in UE4 to achieve that.
Software Engineering and Design Principles Chapter 1.
Engine Overview A Programmer’s Glimpse at UE4 Gerke Max Preussner
A Quick Orientation for Coders
CS414 C Programming Tutorial Ben Atkin
COMP171 Data Structure & Algorithm Tutorial 1 TA: M.Y.Chan.
R R R CSE870: Advanced Software Engineering: Frameworks (Cheng, Sp2003)1 Frameworks A Brief Introduction.
Run time vs. Compile time
1 Run time vs. Compile time The compiler must generate code to handle issues that arise at run time Representation of various data types Procedure linkage.
Game Framework & Sample Projects
The Slate UI Framework Part 1: Introduction Gerke Max Preussner
CIT241 Prerequisite Knowledge ◦ Variables ◦ Operators ◦ C++ Syntax ◦ Program Structure ◦ Classes  Basic Structure of a class  Concept of Data Hiding.
Platforms and tools for Web Services and Mobile Applications Introduction to C# Bent Thomsen Aalborg University 3rd and 4th of June 2004.
General Issues in Using Variables
Object Oriented Software Development 1. Introduction to C# and Visual Studio.
Niklas Smedberg Senior Engine Programmer, Epic Games
Separating VUI from business logic Caller Experience-centered design approach Alex Kurganov, CTO Parus Interactive
Ranga Rodrigo. Class is central to object oriented programming.
PHP TUTORIAL. HISTORY OF PHP  PHP as it's known today is actually the successor to a product named PHP/FI.  Created in 1994 by Rasmus Lerdorf, the very.
GENERAL GUIDELINES FOR CODING. RULE #1 The most important aspect of the code is the readability If your code is incorrect it can be fixed (if it is readable)
Distributed Systems (236351) Tutorial 1 - Getting Started with Visual Studio C#.NET.
Algorithm Programming Bar-Ilan University תשס"ח by Moshe Fresko.
Introduction to Java University of Sunderland CSE301 Harry R. Erwin, PhD.
Netprog: Java Intro1 Crash Course in Java. Netprog: Java Intro2 Why Java? Network Programming in Java is very different than in C/C++ –much more language.
GAME 1024: Advanced Game Programming Lesson 1: The Beginning By Kain Shin.
Introduction to Building Windows 8.1 & Windows Phone Applications.
Chapter 13. Procedural programming vs OOP  Procedural programming focuses on accomplishing tasks (“verbs” are important).  Object-oriented programming.
Applied Computing Technology Laboratory QuickStart C# Learning to Program in C# Amy Roberge & John Linehan November 7, 2005.
Beginning C++ Through Game Programming, Second Edition
Copyright © Curt Hill Generic Classes Template Classes or Container Classes.
Version 5. ¿What is PAF? PAF is a tool to easily and quickly implement… …distributed analysis over ROOT trees. …by hiding as much as possible the inherent.
Introduction to C#. Why C#? Develop on the Following Platforms ASP.NET Native Windows Windows 8 / 8.1 Windows Phone WPF Android (Xamarin) iOS (Xamarin)
Introduction to Java COM379 (Part-Time) University of Sunderland Harry R Erwin, PhD.
Introducing Allors Applications, Tools & Platform.
Java Basics Opening Discussion zWhat did we talk about last class? zWhat are the basic constructs in the programming languages you are familiar.
Presented by Vishy Grandhi.  Architecture (Week 1) ◦ Development Environments ◦ Model driven architecture ◦ Licensing and configuration  AOT (Week 2)
Digging into the GAT API Comparing C, C++ and Python API‘s Hartmut Kaiser
Computer Graphics 3 Lecture 1: Introduction to C/C++ Programming Benjamin Mora 1 University of Wales Swansea Pr. Min Chen Dr. Benjamin Mora.
Object Oriented Software Development 4. C# data types, objects and references.
High-Quality Programming Code Code Correctness, Readability, Maintainability Svetlin Nakov Technical Trainer Software University
Rich Internet Applications 2. Core JavaScript. The importance of JavaScript Many choices open to the developer for server-side Can choose server technology.
Clean Code “Keep it Clean, Your Mother Doesn’t Work Here”“Keep it Clean, Your Mother Doesn’t Work Here” William PenberthyWilliam Penberthy Application.
CSE 332: C++ pointers, arrays, and references Overview of Pointers and References Often need to refer to another object –Without making a copy of the object.
Introduction to C# Anders Hejlsberg Distinguished Engineer Developer Division Microsoft Corporation.
C# Fundamentals An Introduction. Before we begin How to get started writing C# – Quick tour of the dev. Environment – The current C# version is 5.0 –
PROGRAMMING USING PYTHON LANGUAGE ASSIGNMENT 1. INSTALLATION OF RASPBERRY NOOB First prepare the SD card provided in the kit by loading an Operating System.
Lecture 1 Page 1 CS 111 Summer 2013 Important OS Properties For real operating systems built and used by real people Differs depending on who you are talking.
Java and C# - Some Commonalities Compile into machine-independent, language- independent code which runs in a managed execution environment Garbage Collection.
CST 1101 Problem Solving Using Computers
C Basics.
Concurrency & Parallelism in UE4
CS360 Windows Programming
Lecturer: Mukhtar Mohamed Ali “Hakaale”
AVG 24th 2015 ADVANCED c# - part 1.
Unreal Engine and C++ We’re finally at a point where we can start working in C++ with Unreal Engine To get everything set up for this properly, we’re going.
Navigating huge (UE4 (rendering)) code
Introduction to Python
Data Structures and ADTs
Plug-In Architecture Pattern
Presentation transcript:

Programming in UE4 A Quick Orientation for Coders Gerke Max Preussner

Programming Is Awesome Sucks But… Because you can: Create something from nothing Bring dead matter to life Improve the human condition Impress your girl/boyfriend/cat Make a good living in the process

Programming Is Awesome Sucks But… Because: Programmers are crazy Programming languages & tools suck All code is bad and buggy There is never enough time to do it right You are always behind the curve Peter Welch:

Programming Is Awesome Sucks But… Don’t get discouraged! If it was easy, a monkey could do it! Don’t be afraid of programming languages Don’t get discouraged by complex code bases There are ways to make your life easier Know your tools and keep learning Software Design and Architectural Patterns Coding Guidelines & Best Practices Transfer knowledge with your peers

Getting Started Tools: Windows: Visual Studio, UnrealVS, Visual Assist X (recommended) MacOS: XCode For everything else see:

Common Blockers Compiling Acronyms Entry Point Compiling is handled through UBT UBT – Unreal Build Tool Solution/Projects in Visual Studio and Xcode are a lie!

Common Blockers Compiling Acronyms Entry Point Acronym Soup (and Code Names, too) UBT – Unreal Build Tool UHT – Unreal Header Tool UAT – Unreal Automation Tool UFE – Unreal Frontend BP – Blueprint CDO – Class Default Object INI – Text Based Configuration File Cooking – Optimizing game content Lightmass, Persona, Cascade, Swarm and other tools etc. pp.

Common Blockers Compiling Acronyms Entry Point I Want To Understand the Engine - Where Is the Main Loop? LaunchEngineLoop.cpp It’s really complicated (and everybody hates it) Please don’t bother with this – start with our tutorials!

Unrealisms Type Names UObjects Basic Types Strings Macros We Use Prefixes for All Types U – UObject derrived class, i.e. UTexture A – AActor derrived class, i.e. AGameMode F – All other classes and structs, i.e. FName, FVector T – Template, i.e. TArray, TMap, TQueue I – Interface class, i.e. ITransaction E – Enumeration type, i.e. ESelectionMode b – Boolean value, i.e. bEnabled Everything in Unreal is Pascal Case (Upper Camel Case) Function names and function parameters, too Even local and loop variables!

Unrealisms Type Names UObjects Basic Types Strings Macros UObjects Work Around Limitations in C++ Run-time reflection of class properties and functions Serialization from/to disk and over the network Garbage collection Meta data Also: Blueprint integration Decorate regular C++ Classes with Magic Macros UCLASS – for class types USTRUCT – for struct types UFUNCTION – for class and struct member functions UPROPERTY – for class and struct variables

Unrealisms Type Names UObjects Basic Types Strings Macros // Example (not actual UE4 code – omitting some more advanced details) USTRUCT() struct FVector2D { UPROPERTY() float X; UPROPERTY() float Y; UFUNCTION () float GetLength() const; };

Unrealisms Type Names UObjects Basic Types Strings Macros Fundamental Types We don’t use C++ integer types (char, short, int, long, etc.) Custom typedef’s for ints & strings in GenericPlatform.h (int32, uint32, uint64, TCHAR, ANSICHAR etc.) Numeric type traits in NumericLimits.h Common Structures FBox, FColor, FGuid, FVariant, FVector, TBigInt, TRange And many more in Core module

Unrealisms Type Names UObjects Basic Types Strings Macros Containers TArray, TSparseArray – Dynamic arrays TLinkedList, TDoubleLinkedList TMap – Key-value hash table TQueue – Lock free FIFO TSet – Unordered set (without duplicates) And many more in Core module Delegates Unicast and multicast delegates Also thread-safe variants

Unrealisms Type Names UObjects Basic Types Strings Macros Smart Pointers TSharedPtr, TSharedRef – for regular C++ objects TWeakPtr – for regular C++ objects TWeakObjPtr – for UObjects TAutoPtr, TScopedPtr TUniquePtr Similar to boost:: & std:: implementations Also thread-safe variants

Unrealisms Type Names UObjects Basic Types Strings Macros String Types FString – Regular string FText – Localized string, used heavily in Slate UI FName – String hash, used heavily in UObjects String Literals TEXT() – Creates a regular(!) string, i.e. TEXT(“Hello”); LOCTEXT() – Creates a localized string, i.e. LOCTEXT(“Namespace”, “Name”, “Hello”); NSLOCTEXT() – LOCTEXT with scoped namespace, i.e. NSLOCTEXT(“Name”, “Hello”);

Unrealisms Type Names UObjects Basic Types Strings Macros FNames are case-insensitive! Can’t rename ‘MisSpelled’ to ‘Misspelled’ in the Editor Can’t name a property ‘Blast’ if one ‘bLast’ exists

Unrealisms Type Names UObjects Basic Types Strings Macros Logging UE_LOG, also GLog->Logf() Assertions check(), checkSlow(), ensure() Localization LOCTEXT_NAMESPACE, LOCTEXT, etc. Slate (UI Framework) SLATE_BEGIN_ARGS, SLATE_ATTRIBUTE, etc.

Best Practices Guidelines Principles Coding Guidelines Posted on There are some inconsistencies in the code base If in doubt, follow existing style in current code file Naming Conventions Choose descriptive names that are as short as possible Also for local and loop variables! Avoid your own acronyms

Best Practices Guidelines Principles General Principles KISS, YAGNI Composition vs. inheritance Avoid tight coupling of code and modules Many trivial instead of few complicated components Design Patterns SOLID (especially S, O, L and I; DI is not elegant in C++) Hollywood Principle (especially for Slate & game code) GOF, EIP Methodologies DDD, TDD (we support unit tests), AOP

Questions? Documentation, Tutorials and Help at: AnswerHub: Engine Documentation: Official Forums: Community Wiki: YouTube Videos: Community IRC: Unreal Engine 4 Roadmap lmgtfy.com/?q=Unreal+engine+Trello #unrealengine on FreeNode