x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

UE4 Beginner C++ Questions

So I'm trying to understand the C++ UE4 pipeline a little better. Pardon my newbieness in these matters :). At the very last, whoever answers this will at least provide the documentation staff with some places to start.

1. Notation. I see a hungarian notation on a lot of these new C++ classes and functions; the heavy extent of its use being something new to me coming from unrealscript. Can someone give a comprehensive breakdown of the naming conventions that Epic uses for its functions and classes?

A couple examples: The "A" in "AGameInfo". Does it mean "abstract"?

Another example: FPostConstructInitializeProperties. What does the "F" mean?

You also see it also in FVector and FRotator:

FVector("210", "20", "200") and FRotator("0","0","0")

Another prefix is used in TSharedPtr. These are just some to name a few.

2. Inheritance. I see this a lot (bolded):

AYourGameInfoClass::AYourGameInfoClass(const class FPostConstructInitializeProperties& PCIP) : Super(PCIP)

Why is there a super modifier for one of the arguments at the end? I want to believe that this is telling the function to inherit the super form of that argument's value, but that just sounds confusing. Aren't there "vtables" for variables too, not just functions? And if this is the case, how would you declare super for multiple arguments?

The super modifier also does bring up questions about member scoping, and how to access different values up the inheritance chain (e.g. super.super.MemberValue).

3. MyPlayerController.generated.h - What is a generated.h and their purpose outside of your typical MyPlayerController.h header file and how do I go about creating them for my own projects from scratch (And do I need to)?

4. UFUNCTION(reliable, client), etc. At first glance as an unrealscripter, this sounds intuitive until you realize that you don't know what arguments can be passed into this thing and in what order they have to be, etc. What about UFUNCTION() with no arguments. What is different about that? In the absence of UFUNCTION declaration above the actual function, what is treated differently?

5. Saw something like this: "UPROPERTY(editinline)". This question is in the same vain as #4, in that I'm asking about properties and ordering for this macro.

6. When I see something like:

AYourGameInfoClass::AYourGameInfoClass(const class FPostConstructInitializeProperties& PCIP) : Super(PCIP)

Is the part in bold the same as typing "function AYourGameInfoClass(const class VariableName)" in unrealscript?

How would you 'instantiate' a reference to a new class, as opposed to creating an actual class instance?

7. In UE3, for blend nodes, we had "node names" that looked for similarily named variables in unrealscript. When the values of these variables changed, so did the blend values. Will we be having C++ and blueprints interfacing with each other in the same manner? And if so, how do we set up code to listen for animation updates in the blueprint?

Product Version: Not Selected
Tags:
more ▼

asked Mar 11 '14 at 02:06 AM in C++ Programming

avatar image

ue4-archive ♦♦ STAFF
50.1k 3672 2002 9129

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:06 AM

Thanks for these questions, Markus; I was just about to post several of the same questions. It would be great to have a more thorough/exhaustive guide for folks planning on going down the C++ route.

avatar image ibocon Jun 29 '16 at 04:38 AM

This is a great thread where to start learn Unreal Script basic. Thanks.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

I'm in the process of redoing the gameplay programming docs at the moment as they have become pretty outdated. :( I'll try to answer a few of the questions you asked, though someone else may need to help out. :)

  1. Classes have various prefixes that specify what kind of class they are:
    • Template classes are prefixed by T.

    • Classes that inherit from UObject are prefixed by U.

    • Classes that inherit from AActor are prefixed by A.

    • Classes that inherit from SWidget are prefixed by S.

    • Classes that are abstract interfaces are prefixed by I.

    • Most other classes are prefixed by F, though some subsystems use other letters.

  2. That is passing the argument on to the parent class's constructor. Super is a typedef that always references the parent class. So you can also do Super::SomeFunction() and it will call the parent class's version of that function.

  3. The *.generated.h files are automatically generated by UnrealBuildTool when you compile your project. You just have to make sure you add the include for them as they will contain necessary bits for compiling.

  4. The available UFUNCTION specifiers can be found in ObjectBase.h in an enum within the UF namespace. I don't believe the order you use them is important. Adding the UFUNCTION() macro to a function declaration provides access to that function within the reflection system. The main benefits of this are UFUNCTIONs can be exposed to Blueprints, assigned to delegates (i.e. for input binding), called as RPCs or assigned as callbacks for replication, and declared as exec functions to be executed from the console. There may be other special things about UFUNCTIONs I missed, and some of these depend on certain specifiers being added.

  5. These are found in the same ObjectBase.h file as above in the UP namespace.

I'm going to let someone else tackle 6 and 7 as well as add to what I said or correct anything I might have gotten wrong.

more ▼

answered Mar 11 '14 at 02:06 AM

avatar image

ue4-archive ♦♦ STAFF
50.1k 3672 2002 9129

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:06 AM

6) Not quite. It is more comparable to const VariableType VariableName. The 'class' keyword in this case is part of a forward declaration, it lets the C++ compiler know that the type which follows it is a class type, even if the C++ compiler hasn't encountered that type yet. You can frequently omit the class or struct keyword in front of a reference type, it's only needed if your code could be compiled before the declaration of that type.

A class of a particular Unreal type would be passed around as:

 TSubclassOf
 

7) I think this bit of documentation will be helpful, but can you break this out into it's own question and go into a bit more depth about what you're wondering about?

Cheers, Michael Noland

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question