[Music] hello everyone and welcome back to the course in this lesson we will learn some fundamental programming concepts that will serve as the foundation for more advanced topics we will learn later in the course these general concepts can apply to many programming languages so we will learn about the theory and see some examples that are specific to unreal engine let's get started so what is programming in essence programming refers to writing instructions that your computer or game engine can understand and execute you give your instructions by writing code in a specific programming language common languages
include things like c c plus plus c sharp python and even blueprints unreal engine uses c plus plus and blueprints as its languages and in this course we will focus on learning to code using the blueprint scripting language blueprints are a custom language made by epic games that allows for fast iteration inside the engine and visual scripting means that you will be writing your code by using predefined nodes that you connect in a sequence so how do you actually write your code the code you write is known as source code and is made to be
human readable you write this code inside a code editor such as visual studio writer or even notepad plus plus this is the case when writing code in c plus plus unreal engine has a custom code editor for blueprints built inside the unreal engine this makes it convenient and very fast to write your code and see the results the source code you write needs to be converted to a format the computer actually understands and the process of converting your human readable code or source code into machine code it's called compiling your code now let's briefly learn
about a very important programming concept this is the concept of object oriented programming object oriented programming or oop is a paradigm based on the concept of objects these objects can represent anything from the real world to abstract concepts some examples might be a house or an animal oop is useful because it lets us write code and create our own objects that represent real world equivalents for example you can create the concept of a human character in code which has the same characteristics of a real person in programming terms such an object is referred to as
a class a class defines the characteristics of a specific object for example the human class may contain the following data attributes two legs two arms two eyes a class can also contain information about available functionality this functionality can include functions methods routines etc we will learn how to create functionality later in the course one of the advantages of using the object-oriented programming approach is the concept of inheritance that is the ability of a class to inherit information from another class this creates the concept of a parent and a child class a child class refers to
a class that is derived from another class its parent a child class will inherit all the information from its parent automatically this can be useful when organizing our classes into logical categories for example we could define an animal class then we can create a child class from animal and call it dog the animal class contains all the attributes and functionality common to all animals has eyes ears can move can eat etc the dog will inherit all those attributes but in addition we can add specific attributes or functionality that are only relevant to a dog for
example the ability to bark we can create as many parent in child classes as we want effectively creating a hierarchy now let's look at a more complex example we could start with an animal class as before then we could go to a ground animal class then a dog class then a german shepherd class we could then do the same for aquatic animals by going aquatic animal fish and salmon and for each class we create we could define its attributes and functionality like so as you can see on the table as we go down the hierarchy
of animal classes the attributes and functionality become more and more specific to each child class but always remember that each child class inherits the information from its parent in this example the german shepherd class inherits all the attributes and functionality from animal ground animal and dog classes unreal engine uses the object-oriented programming approach to write its code so we will be using this approach when learning to code in blueprints unreal engine comes with a lot of predefined classes that we can use immediately for a variety of purposes for example unreal has a pre-built class called
character which comes with many common attributes and functionality that a game character typically needs now let's take a look at some of the common pre-built classes that come with unreal engine the actor class is the simplest class you can use to place an object in the world it has a transform as one of its attributes a transform is a location rotation and scale an actor can be placed in the world and transformed the pawn class is the simplest class that can be possessed or controlled by the player it has the same attributes as the actor
class with the added functionality that it can be controlled by a player or ai agent [Music] the character class comes with attributes such as collision visual representation such as a mesh and many movement attributes and functionality it has functionality relevant to humanoid characters like jumping so if you wanted to create an inanimate object like a door or a lamp you would use the actor class if you wanted to create a character or vehicle that can be controlled by the player or ai you would use the pawn class and finally if you wanted to create a
humanoid character you would start with a character class to take advantage of all the pre-built attributes and functionality of that class let's do a quick recap programming refers to writing instructions that your computer can understand and execute you write these instructions in a specific programming language inside a code editor when you're done writing your source code you compile it to turn it into machine code unreal engine uses c plus plus in blueprints as its programming languages unreal uses the object oriented programming paradigm with oop we can create classes that define specific objects oop has inheritance
which means that certain classes child classes can be derived from other classes parent classes and obtain all their attributes and functionality unreal engine comes with many pre-built classes ready to use for our game if you want to practice what you've learned here's an additional exercise come up with three other examples for classes you can create by using the principles of inheritance use the table below to help you to find them and that's it that's all for this lesson if you have any questions leave them in the comments section below also don't forget to join our
discord and use the support channel there as well thanks for watching and i'll see you in the next lesson [Music] you