What c++ design patterns should i learn, and stuff?

c++ design patterns, and stuff :).
That is the simple question :slight_smile:

I have been programming c++ for about a year now but haven’t really learned any c++ design patterns yet.
I mean i have been looking up on the basics “interfaces and factories”.

What does this have to do with the Unreal engine you might ask…
Well… I have been working on a simple menu and some maps for a few days now. Nothing special i assure you.
And i have come to a point where i need to set up the Graphics Options widget. I know i can do this by executing console commands, but i would rather tap in to the UGameUserSettings class.
So on i went and installed VS 2013 “normally use code::blocks” and thought that i simply could create a blueprint function library that tapped in to this class, giving me access to stuff like ApplySettings() and SetFullscreenMode().

And that’s where i’m stuck. i have done several searches on this, read stuff in the documentation and i’m clearly not well equipt to deal with the c++ code of the Unreal engine. My guess is that i simply don’t know what the underlying design patterns used are or stuff :slight_smile:

So back to the question at hand :slight_smile:

If any of you guys have some recommendations about what i should read up on so i can traverse the UE code base without getting confused about stuff like UObjects and how to properly instantiate them. I would be vary happy.

PS: Have C++ primer fifth edition. Haven’t reed the thing through but use it to look stuff up from time to time. so if you know about a specific chapter i should know by hart then please do tell.

First thing first, if you use external material to learn C++ keep in mind UE4 does not use C++ standard library (well it uses in backend, but it does not expect you to use it), UE4 has it’s own implementation of it and reflection system will only work with it, if use C++ standard library with UE4 APIs you will end up with errors, use it only when you want to interact with external libraries. So names of functions and types will be diffrent in UE4 then what you see in typical C++ tutorials, for example insted of std::string there FString instead of std::vector theres TArray and so on.

Considering you already know some of blueprint you should have idea how UE4 is constructed, C++ is not really different from it, in fact blueprint by majority use binded C++ functions and blueprint themselves are like C++ classes. Look up Class Viewer and you will see that Blueprint classes normally appear there, you can also explore C++ classes there too. If you don’t know all of framework yet check this link:

https://docs.unrealengine.com/latest/INT/Gameplay/Framework/index.html

You can learn how to use C++ in UE4 here, you need to learn how to use things like UFUNCTION or UPROPERTY and some other things:

https://docs.unrealengine.com/latest/INT/Programming/index.html

Also API refrence, it will be your bible, if you want ot search how do things search for right functions there:

I also encorage you to explore the UE4 source code, how classes are made there, if you want to check how something work it’s good place to go. Keep in mind that engine it self is writen in C++ and it’s if you looks at it’s not much diffrent of game code you writing. It’s big so best way to navigate is to use github’s search, if you download source and use compiled version of engine you can explore that code in VS too and in case of debuging it will also show up there:

https://github.com/EpicGames/UnrealEngine

Thank you vary much…
This is a lot of help :slight_smile:
Now i have a place to start…

Already thinking some stuff up. like trying to implementing the SwarmInterface in the runtime library so i can procedurally generate a map and build the lighting in game via a blueprint function.

Working on a 3D Level generator that can make it possible to generate maps using standardized room types, like rooms with stairs, corners, T-junctions and so on.

Currently my main problem is that the lighting needs to be built/baked after the map is generated and as far as i know that’s only possible in the editor.

With this i can also start implementing some procedural stuff that gets overly complicated in the blueprint graphs in a blueprint function library.

Anyways thanks a lot.