Usage of C++ concepts in Unreal

How often do you guys utilize these while programming in Unreal: using lambda and their captures, stack and heap memory management, using standard C++ cast?

I am wondering because recently I received an interview test on those subjects, among other programming questions.

I feel like I am quite familiar working in Unreal, and yet only needed to use lambda a handful of times, barely put any thought on memory management, and only used C-style cast for simple types, converting int and float, for example.

Is this something that one should know and learn more, especially when working in Unreal?

I mean it’s always good to know those concepts. In Unreal you won’t really be touching memory management, as Unreal manages UPROPERTY stuff itself. Lambdas are more frequently seen in Unreal when you need to make a callback for something. I see it in editor/tools code sometimes.

Not really. You received these questions because it was a test. Even if you don’t really have to worry about memory management in Unreal, it’s always a plus if you know how things work, rather than just “yeah idk Unreal will handle this for sure”.

It’s one thing to be able to “use what’s there,” it’s another thing to “debug it when it goes wrong.”

So, if you’re a “gameplay programmer,” you might not need all the C++ features, as long as you can make the right thing happen using the tools that are in the engine, and add some new classes for things like new Gameplay Abilities or whatnot.

If you’re a “technical designer” then you might not even need to be able to write new classes, just know enough to write sane blueprints and use the C++ classes that exist.

If you’re an “engine programmer,” then you’re expected to know how the language works, what the runtime looks like, how memory management works, how to best use the available functions in the OS (files / memory / network / graphics / etc) and so on.

These are roles working at different levels of the stack, and require different skill profiles. If you’re a “gameplay programmer” and interviewed for an “engine programmer” position, it’s likely you didn’t do very well, because the needed skills are different.

Also, different companies call these roles slightly different things, and push responsibilities for the different systems up/down the borders a little bit, mainly depending on internal studio history and specific people they already have on board, so even with the seemingly clear name “gameplay programmer,” you may see more or less engine work, depending on the specific position/company.

1 Like

I definitely use lambdas quite a bit, both with the Unreal containers as well as systems that I’ve written that work well with them.
I don’t generally do a whole lot of manual memory allocation, I can really only think of a few instances where it’s been relevant. I could if I had to of course, but it’s generally not relevant in Unreal.
In addition to C-style casts like you mentioned, I do use const_cast a bit more than I might otherwise due to some const-correctness issues passing things back and forth between C++ and Blueprints. I generally don’t use static or dynamic casts with UObject pointers since the Unreal cast functions are better there.

jwatte laid out a pretty good breakdown (though gameplay engineers at my work are much more technically capable) and I probably fall somewhere between a gameplay and engine programmer as far as expertise.

1 Like