CPP – DLL Injection using CreateRemoteThread on Windows
Sometimes we are working from which we would like to extract data on the fly and use it in our own program. However, the developer doesn't provide an API, either deliberately, to block the use of his application, or just by lack of time. For examples, video games which (generally) do not offer an API allowing you to see the enemy's hit points, or even to recover the entire map. Other times it will be a more professional application, [...]
UE4 – Reading Command Line Arguments with Blueprints
Today we'll talk about command line arguments in an Unreal Engine application. As you certainly know, you can use command line arguments to launch your compiled UE executable with specific launch options. For instance MyGame.exe -debug to enable some debugging messages, MyGame.exe -inputFile=C:\test to parse a specific file, etc. If you have already dealt with command line arguments with UE, you have certainly read the documentation about this feature: https://docs.unrealengine.com/en-US/Programming/Basics/CommandLineArguments/index.html In this tutorial, we'll focus on our own command [...]
UE4 – How to Rename an Unreal Engine Project with Sources Files
Disclaimer: We strongly advise you to use the "migration" feature from UE if possible. As a developper, we often need to use an old project as a template for a new one. Unfortunately, we can't just copy/paste the project folder and simply rename the .uproject file with the new project name... Renaming a whole UE project is not an easy task. Also, when we work a lot with C++ files, we have to deal with source files renaming too. [...]
UE4 – Get Assets by Path in Blueprints with the AssetRegistry
In some projects, when we are working with a lot of assets, we may need to be able to programmatically get one/load one using its path. This happened to us when we were working on a big project, in which we had a lot of assets automatically imported from FBX files and we needed to be able to instantiate them using their name at runtime. In this short tutorial we present how we've managed to do it, and especially [...]
UE4 – How to start Oculus Quest development using Unreal Engine 4.24
Hi guys, As you certainly know (FB or TW pages), we won an Epic MegaGrant for our First Aid Training project. We are really proud of this and it convinces us about the potential of such a tool in first aid training classes. We already made some tests and tryouts with VR devices (Oculus Rift) on the previous version of the First Aid Training. We really loved this new approach of gameplay, and we wanted to continue on this way. [...]
UE4 – Network Multiplayer in Blueprints – Getting Started
Even though the network is a well covered subject in UE4 documentation, a small tutorial explaining how to get started with a really simple application is really missing. In this article, I propose you to implement a multiplayer small game over the network, and we will see how easy it is using Unreal Engine if we know where the things must be placed and what configuration must be done. But first, let's start with the basic principles of Unreal Engine [...]
UE4 – Programmatically starting an Editor Utility Widget
Editor Utility Widgets are one of the new feature of the Unreal Engine since 4.22. It allows users to define editor widgets using the UMG designer. We already covered this topic previously, so if you want to start with Editor Utility Widgets, you may want to check this article, this one and this one. In this article, we will answer to a question we can have when using the Editor Utility Widgets: how can we programmatically start an Editor Utility [...]
UE4 – Controlling Editor Widgets with C++ (4.22)
In the previous articles, we have seen how we can define editor widgets with blueprints and how define an editor widget from C++. But, while we have seen the basics of the creation of such widgets, we have not studied how we can build a widget from C++, i.e. selecting the components to display and writing the logic behind. This tutorial will present you how it can be done, by doing something similar to the tutorial with blueprints, but using [...]
UE4 – C++ Editor Utility Widgets (4.22)
In the last article, we introduced the UMG Editor Widgets which allows you to define editor widgets using the UMG designer since Unreal Engine 4.22. In this article, we cover the usage of UMG Editor Widgets, but using C++. Of course, it was already possible to define editor widgets using C++ before the 4.22, but this new release added new possibilities. We can now, for instance, define an Editor Widget class from C++ and extend it using an Editor Utility [...]
UE4 – Editor widgets with UMG (4.22)
The new 4.22 version of the Unreal Engine 4 has just come with a lot of new features. The most marketed one is the real-time ray-tracing which comes with a lot of promises. But among the new features, there is one which is definitely huge if a part of your job is to improve the engine by adding new features: it's the Editor Utility Widgets. According to Epic: Editor Utility Widgets enable you to extend the functionality of Unreal Editor [...]
UE4 – Making a progress bar in the editor
When we make an editor plugin, we may have slow tasks. And if we don't want to freeze the editor window without any notification, we need to add a progress bar, so the user can keep a track of the progress of the task. Unreal Engine editor's progress bar Unreal Engine provides an easy-to-use class for this: FScopedSlowTask. In this small article, we will see how to use it. Using the FScopedSlowTask Let's say we have a slow task in [...]
UE4 – Making animations with blueprints: the Timeline
Anytime we want to change the value of something over a given amount of time, we should use the Timeline nodes. An example of a timeline node Timelines are explained in detail in the official documentation here : https://docs.unrealengine.com/en-us/Engine/Blueprints/UserGuide/Timelines That’s why, in this small tutorial, we will only focus on concrete examples answering to “what is it?”, “when to use it?”, and “how to use it?”. The Timeline nodes A Timeline node is a description of the evolution of one [...]
UE4 – Using the Flow Control Macros
If you develop with UE4 and are writing blueprints, you already know a lot about the Flow Control macros. Indeed, the Flow Control macros are all the macros allowing you to alter the execution flow of your blueprint (i.e. the white line connecting the nodes). The most used one is certainly the Branch node which will redirect the flow in either the true or the false path, depending on the result of a condition. Switch is similar, except it will [...]
UE4 – Interesting tricks and shortcuts in the blueprint editor
Though I’ve been using the UE4 blueprint editor for a while, I still manage to learn tricks making me think “how I did without it…”. So here’s a selection of tips and tricks of the graph editor that made me save a lot of time. Dragging connections Just hold Ctrl when clicking on a link to drag it If you hold Ctrl while clicking on a connection, you can drag it to another node. If you were still re-creating a [...]
UE4 – Be careful with the Construction Script
If you develop with Unreal Engine 4, you have certainly used the Construction Script. Probably without knowing this can ruin your project. The Construction Script is accessible within the blueprint editor: You can access the construction script in the blueprint editor Or if you prefer, in C++, it is represented by the OnConstruction method: virtual void OnConstruction(const FTransform& Transform) {} And more details can be found here: https://docs.unrealengine.com/en-us/Resources/ContentExamples/Blueprints/1_4 This convenient tool is really useful to define how an actor must [...]
UE4 – Making a Android Plugin in 10 minutes
Let's say we're developing a game for mobile and we want to use one of the device functionalities, like reading the data from the light sensor, get the data from the contacts, or send a SMS: UE4 doesn't provide an API for this, so we have no choice, we have to make this API ourselves. Fortunately, it's really easy (if we follow this guide)! It's easier if you're familiar with the plugin system of UE4, but even if you're not, [...]
UE4 – Create a loading screen for your map (free template)
Loading screen, loadings screens everywhere... It's so simple to create into your Unreal Engine project. So, why don't add one in each of your projects? Let's see in this quick tutorial how to add a loading screen in an existing project. 1. Understand Map, Level and World terms First of all, we need to understand the little difference between these 3 words. A Map can be a Level or a World. The map is the asset created and stored [...]
UE4 – Create a free camera pawn with custom inputs
When we create a new default project with Unreal Engine, it uses the DefaultPawn which is a kind of free camera, i we can move in all directions without being affected by the gravity. In this mode, the keyboard's keys are used to move the pawn, while the mouse is used to set its orientation. Usually, it's W to go forward, A to go left and so on. But this works only if we have a QWERTY keyboard layout, [...]
UE4 – Create your own automatic converters for blueprints custom types
Introduction You all know the automatic conversion system available in Unreal's blueprints (when you drag and drop a pin of one type on a pin of another type). This is a very handy feature to save time during blueprint development. Basic types already have automatic converters, such as Integer to String, Float to Integer, Name to String and so on... In this post, we'll see how to create our own automatic converters for your custom types. Let's say we [...]
UE4 – Improving speed with ParallelFor
Developing for the Unreal Engine, we have sometimes to make complex for loops with a lot of stuff in the body. Usually, it's a performance breaker, especially when the number of iterations of the for-loop increases. The purpose of this small article is to introduce a nice trick that can greatly improves the performance of these operations : it's the ParallelFor. ParallelFor allows us to multi-thread any for-loop in a minute, thus dividing the execution time by splitting the work [...]
UE4 – AI Perception: Senses and stimuli source
In this short tutorial, we're going to see the basics of senses and stimuli sources using the Unreal Engine. Using AI perception makes it really easy for an AI to detect ennemies, or other objects. But while the Unreal Engine provides a good documentation on AI and behavior trees (here), there are few things on AI perception. The basics. The AI perception system allows an AI controller to perceive elements in its environnement. These elements are actors with the [...]
UE4 – Reading the pixels from a UTexture2D
Reading the pixels from a UTexture2D is not particularly difficult, indeed this post on Unreal AnswerHub resume almost perfectly how to do it. However, there are some points missing and one could go in the case where a call to RawImageData->Lock(LOCK_READ_ONLY) will return nullptr. When it happens, it prevents us from reading the pixels, and moreover, potentially causes a huge crash if the situation wasn't anticipated. We will review quickly how to read the pixels from a UTexture2D, and [...]
UE4 – Programmatically create a new material and inner nodes
In this post, we will learn how to create a new material from Cpp code, create nodes and make links. You can add this code into a custom plugin in order to magically create a new material when the user clicks on an editor button. Remember, this code is designed to be execute into the editor. Your plugin must be an editor plugin. This code can't work at runtime... Create a new asset : Material First of all, we must [...]
UE4 – Declaring and using interfaces in C++
Unreal Engine interfaces When we develop in C++, in Java, or in any object-oriented programming language, we often use the OOP concept of interfaces. In C++, they are generally implemented using totally abstract class without members, i class containing only pure virtual functions. However, when developing blueprint C++ classes with Unreal Engine, it's not possible to directly use this kind of syntax. Indeed, Unreal Engine has a specific syntax for the interfaces. It is detailed in the Unreal Engine wiki, [...]
UE4 – Make an input UCLASS pin compulsory in a blueprint custom node
Context.If you used to create some custom blueprint nodes (using blueprint function library or directly into a UCLASS), you probably know the different ways to pass parameters to this function with their pros and their cons.Let's summarize.When we want to use a UCLASS as a parameter, we need to pass it by address, otherwise we will have a compiler error:Missing '*' in Expected a pointer typeBut, we have two ways to do the job (in the following example, UGenerationModule is [...]
UE4 – Save a procedurally generated texture as a new asset
Creating the UTexture2D object. Let's say we have generated a UTexture2D from C++ within the editor. It could be interesting to save it in order to use later. Let's have a look on how to do this. The first step is to create a UTexture2D object. Here, we cannot create a transient texture using UTexture2D::CreateTransient, because if we did so, we would be unable to save the texture (transient objects can't be saved). So, we will create a package, and [...]