Hello guys, I need your advice. I have learned Java in school and C# by myself. I understand Object Oriented Programming and I have middle level knowledge with Java and C#. I was willing to use Unity 3d but I have decided to use UE4 and I know that I need to learn C++ but I have seen some post saying general C++ is different from the language which UE4 use. My point is that I don’t want to spend too much time to learn whole C++ language. I just want to learn C++ which is necessary for UE4. However, I have doubt If there is any specific way to learn C++ which UE4 use or not. Or should I learn whole C++ language from the begining?
I’ve only really spent the last 2 days with C++ in Unreal, I was converting 5 or 6 C++ classes to blueprints to increase readability, it was actually pretty easy, and I felt very comfortable doing it. That being said, C++ in UE4 is a bit different than C++ in general see my thread: C++ in & out of UE4 - General Discussion - Unreal Engine Forums
In conclusion, what do you suggest? Should I get a C++ book to learn C++ from the begining or should I learn it from the official UE4 C++ tutorials?
I think it is fine if you run through some online free tutorial series (e.g. http://www.learncpp.com/), read carefully only the really new-for-you sections, then jump into some UE4 C++ tutorials (on the Wiki and there is a video series, but that is for UE4.4), then you can still go back to check C++ tutorials or other source like http://www.learncpp.com/
I found this book : http://www.amazon.com/Beginning-C-Through-Game-Programming/dp/1305109910/ref=sr_1_1?ie=UTF8&qid=1441113913&sr=8-1&keywords=Beginning+C%2B%2B+Through+Game+Programming&pebp=1440738153267&perid=0G9XJHA7CD5565ZCM25C
Seems good. Have you checked it?
You might be better off with http://www.amazon.com/Learning-C-Creating-Games-UE4/dp/1784396575. It’s specific to UE4, and starts from the absolute beginning. I haven’t read it, but I looked through it, and it seemed liked like a pretty good resource for someone looking to learn C++ to do Unreal.
I have checked that book and it seems really nice but also I have read some comments saying that book is outdated. Since I am new at UE4, I am afraid of confused. Is it really different the UE4 version which that book uses from updated UE4 version?
The language isn’t different; It’s the same C++, UE4 just won’t use the **std **library while also being a very gigantic self-contained environment.
Yes that book is good until ue4.5, and with 4.6 many little changes were introduced. But it might be still the best choice as it also teaches other parts of the engine.
The truth of th matter is, no printed book will be able to keep with the pace of development Epic has been on.
Since you are comfortable with Java and C# and are familiar with OOP, there are just a few concepts that are “slightly lower level” that you must know before you can become pretty effective using C++ with UE4:
- A good grasp on pointers. For example know what the difference is between int* and an int.
- Knowing the distinction between:
- passing an object - void MyFunction(int A)
- passing an object by reference - void MyFunction(int& A)
- passing an object by pointer - void MyFunction(int* A)
- Knowing the const keyword for functions and variables - void MyFunction(const int A) const
- Header files: what are they for and in what order are they processed by the compiler
- Related to that forward declarations so that you don’t have circular includes between your header files
- Operator overloading: When you make a custom class you may need to specify what ==, +, - etc do for your class
All in all if your purpose is to become fluent in UE4 and C++, given your Java/C# background I recommend skipping C++ books. Most books will be useful but for general books in C++ you will never know which parts you will and won’t need. Instead try downloading and dissecting C++ example projects like ShooterGame. If you like learning from books, get some books on design pattersn that are useful no matter the programming language. But you may have those already.
Great thanks to everyone who try to help me. I could not get too much answer like this on Unity forums.
Respect to this great community!
By the way, I have one more question about this book: http://www.amazon.com/Learning-C-Cre.../dp/1784396575
The outdated part is UE4 but not C++ right? I mean C++ is still same but the interface has been changed?