Archives de catégorie : C++

Unreal Engine Tips – Engine Migration troubleshooting

While working on the game Front Line Zero with the METATEK game developement studio, I’ve used the Unreal Engine 4 game engine for some years now.

I’d like to share some knowledge about the pitfalls and neat tricks I got to discover under the form of short, easily-readable blog posts.

Today’s topic : some tips on how to migrate a project from an older version of the engine to a newer one (and what were the encountered issues).

Continuer la lecture de Unreal Engine Tips – Engine Migration troubleshooting

How to make your own Resharper C++ file template

ReSharper is an extension for Visual Studio that provides a lot of quality-of-life improvements over the initial VS user experience. It was initially made for C# (hence the name), but also exists in C++ ! If you never used it, but know competing products like VAX (Visual Assist X) for example, you basically know what ReSharper is.

It happens pretty often that, working on a C++ project, I want to make a new class (separated in two files : a header file and a source file) based on a kind of template, like they should all follow the same basic structure, have the same copyright disclaimers at the beginning, then start implementation surrounded in a specific namespace, etc…

Visual Studio in itself is pretty limited in that respect. And to be honest it’s very possible to just copy-paste existing files and make the necessary arrangements each time, but it becomes kind of tedious and boring over time. Turns out, ReSharper happens to know how to do this kind of thing : behold the ReSharper File Templates ! Unfortunately, it’s pretty complicated to use at first and documentation is scarce (at the time I’m writing this).

So here’s a quick guide on how to do it. It assumes you have ReSharper up and running (for brevity, I skip the part about installing it).

Continuer la lecture de How to make your own Resharper C++ file template

Coercing Assimp into reading OBJ PBR materials

Edit January, 4th 2022 : The Assimp maintainers merged just a few days ago a pull request that enables PBR support by Assimp’s OBJ importer. If you are able to use a recent version of Assimp, I would advise you to go get it and work with it the way Assimp expects it. See the pull request here.

These days, I’m trying to import 3D models exported as Wavefront OBJ files in my Vulkan renderer. In order to achieve that effortlessly (kinda), I’m using the very good Assimp (pun not intended) library.

It kinda works well if you stick to a « traditional Blinn-Phong » lighting pipeline (also known as « prehistoric lighting » 😉 ), with ambient/diffuse/specular components and so on. Everything is there. Things become trickier if you try to bring PBR into the mix, with roughness, metallic and ambient occlusion maps for example.

What parameters should you use in Assimp to read those values ? What texture type should be used in order to import those maps ? Turns out it’s not as easy as one would think, because support on both the Wavefront OBJ specification and Assimp is just not there.

So I had to cheat a little, let me explain how !

Continuer la lecture de Coercing Assimp into reading OBJ PBR materials

UNREAL ENGINE TIPS – C++ BITFLAGS ENUMS

While working on the game Front Line Zero with the METATEK game developement studio, I’ve used the Unreal Engine 4 game engine for some years now.

I’d like to share some knowledge about the pitfalls and neat tricks I got to discover under the form of short, easily-readable blog posts.

Today’s topic : how to make a C++ enum that displays as an editable bit flags value in the editor.

Continuer la lecture de UNREAL ENGINE TIPS – C++ BITFLAGS ENUMS

Unreal Engine Tips – Playing random animations

While working on the game Front Line Zero with the METATEK game developement studio, I’ve used the Unreal Engine 4 game engine for some years now.

I’d like to share some knowledge about the pitfalls and neat tricks I got to discover under the form of short, easily-readable blog posts.

Today’s topic : how to play a random animation from a predefined list.

Continuer la lecture de Unreal Engine Tips – Playing random animations

Two dangers of modern C++

I’d like to talk here about two not-so-new features of C++ (auto types and lambda functions) that managed to bite me recently, even though I thought I knew them well enough (I still do!).

According to me, it doesn’t show that one should ditch them into oblivion and never use them (but some people make their life easier by doing so), but clearly that they should be handled with care, as they more or less act as syntactic sugar on C++ type system, which can be, unfortunately, both overly rigid (which is why we use them in the first place) and overly flexible (which is usually why bugs get in our way).

Let’s get to the point.

Continuer la lecture de Two dangers of modern C++

Aggressive commit of Intellisense suggestions in Visual Studio

Just to add a bit of context here: at the moment, I’m doing quite a lot of C++ programming on Windows environments, especially with Visual Studio.

And one thing I particularly dislike with Visual Studio’s default settings is that « aggressive commit » of Intellisense suggestions when you’re typing a type is disabled by default.

So, what is « aggressive commit of Intellisense suggestions », you ask…

Continuer la lecture de Aggressive commit of Intellisense suggestions in Visual Studio