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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How is "Unreal" C++ built up?

I know its C++ with a bunch of libraries and functions. But when I create a new C++ actor for example, it's just ... different. Different from the native C++. So is there any syntax or so?
Thanks for answers!

Product Version: Not Selected
Tags:
more ▼

asked Aug 27 '17 at 02:20 PM in C++ Programming

avatar image

Pixel_Error
49 2 9 10

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

1 answer: sort voted first

There no such thing as "Unreal C++", this is normal C++, and UBT use normal C++ compiler from VS, so every things you see is all valid C++ syntax and any C++ compiler will build it. Also note: names =/= syntax. UE4 use it's own "make" tool (build manager) to build the code called UnrealBuildTool (UBT)

It might look different due to fact that UE4 use it's own standard library or to be more exact it has library wrapper so there no need to rewrite anything to run you game code in different platforms, but those are not syntax diffrences. So you need to look exclusively at UE4 APIs, standard C++ library is still usable in UE4 (as it still normal C++) but it's not recommended as engine code don't expect you to use it and may cause hard to debug crashes. You will only need to use those if UE4 don't have function equivalent in it's APIs or you trying to communicate with 3rd party library that uses standard C++ library types (and most of them does). If you gonna use, there no guaranty that your code will build on all platforms

Also UE4 use macros to mark declarations of classes, structs, enums, functions, variables etc. which assist tool UnrealHeaderTool generates extra C++ code that will register those for reflection system, this avoid need of doing so manually which would double the work.

It's also impotent to understand that what you do in UE4 C++ project is writing dll module to the engine, effectively extending engine itself. enigne is modular very similarly to linux kernel, so making a module in game project is same as adding extra code to engine, also same as making plugin too, all modules modules are equile. There module class htta have module load and unload code, but in game project uses ready made macro for that, look up plugin example to see how it looks like, it should open your eyes.

Most classes in UE4 are rooted in single class called UObject, which contains base code for all classes for there managment, look Window->Development Tools->Class Viewer for full UObject class tree. Only those classes are visible in reflection system and can be extended from Blueprints. But there also normal classed not related to UObject and they are normal raw C++ classes, if you ever gonna play with Slate, it uses exclusively raw C++ classes.

If you know blueprints well you practically know UE4 APIs well, all classes are same and most blueprint nodes are function bindings (all you need to do is UFUNCTION(BlueprintCallable) to make function work in blueprint), so you should have general idea what and where to call. But not all functions are binded to blueprints.

Now i don't really know what you need, you just adding classes to engine and thats it.

If you look how to use those UPROEPRTY etc. macros here list of most specifiers (go to bottom for more U macros) https://wiki.unrealengine.com/UPROPERTY

If you for core function that substitutes C++ standard library, look up API refrence of Core module, which have most basic of basic functions:

https://docs.unrealengine.com/latest/INT/API/Runtime/Core/index.html

I can't recomand API refrance more, use it to find any list of functions you need

If you didn't understand what i said, just forget about standard C++ library existance and think only about UE4 APIs in UE4

more ▼

answered Aug 27 '17 at 08:14 PM

avatar image

Shadowriver
36.6k 931 169 1111

avatar image Pixel_Error Aug 28 '17 at 02:48 PM

Wow, thanks a lot Shadowriver, for taking your time to explain all this! You've actually answered all my questions!

(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