Announcement

Collapse
No announcement yet.

Question about C++

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Question about C++

    Hello,
    the only programming language I've done was Javascript and I'm pretty good at it and I'm not talking about jQuery, I created my own jQuery at some point
    So, I've looked a bit into Unity3D and C# the same as UE4 and C++ and is that true that you MUST manage the memory allocation manually?

    Are there also some rules that must be done in C++ to get a much better performance or can I use Blueprints for most parts?
    If I create a C++ project, am I still able to use Blueprints? Like a mixed BP/C++ project.

    #2
    Welcome! I'll take these one at a time.

    Originally posted by DamianToczek View Post
    So, I've looked a bit into Unity3D and C# the same as UE4 and C++ and is that true that you MUST manage the memory allocation manually?
    If you are using basic C++ then yes you manage the memory, but Unreal Engine has many built in memory management features. Usually when using C++ with the engine you'll use an Unreal Engine class as a base, and the garbage collection will be taken care of for you. Also kind of related are Unreal Engine "TArrays" which are much easier to dynamically use than C++ arrays.

    Originally posted by DamianToczek View Post
    Are there also some rules that must be done in C++ to get a much better performance or can I use Blueprints for most parts?
    Blueprints can handle most things, the general rules are to keep your blueprints graphs small (split into functions instead of sticking everything on one graph), avoid lots of connections (better to use one node that gets the job done than 3 nodes that do the same thing), and avoid using the tick function in blueprints (making a node connection every single tick on top of whatever code the blueprint is running).

    Originally posted by DamianToczek View Post
    If I create a C++ project, am I still able to use Blueprints? Like a mixed BP/C++ project.
    Yes, mixing them is a great way to do it. You can create a base C++ class (based off an Unreal Engine class), and then create a BP inheriting from that C++ class you just created. Then any variables or C++ calculation intensive functions that you stick in the C++ class can be exposed to the blueprint using UPROPERTY() and UFUNCTION() macros. This way you can quickly prototype with the Blueprints but still use C++ code when it makes sense.

    UPROPERTY() also lets you expose C++ variables to the editor, which means you can quickly tweak default values without recompiling your C++.
    Last edited by Kelso; 07-10-2019, 02:11 PM.

    Comment

    Working...
    X