How can I learn C++ with UE4?

New coder here, I’ve seen some tutorials for C++ on this website before, but they all seem to target coders who have had some experience with game developing before, which I don’t. Are there any tutorials you can recommend for a new programmer? And yes, I know C++ is not a great place to start coding, but I want to test the language myself and see how difficult it can be. I’ve tried finding sources to teach me how to code, like Codecademy, but there is no course that teaches how to use Javascript or Python to code a game, it’s more of a basic understanding of the code. Thanks for reading!

Search for “c++ game programming for games module 1/2” Those are absolute beginner c++ books. The first one is really useful for you, and half of the second one will be of use too. I recomend you use blueprints before C++ in ue4, so you learn the way UE4 structures things.
Link to the first one:http://management.ind.in/forum/attachments/f2/13598d1415431776-c-module-1-game-institute-c-module-1-game-institute.pdf

Do not try to touch ue4 C++ until you know both C++ and blueprints or you will get lost and frustrated.

+1 for vblanco’s advises

it’s really frustrating at first but learning the basics and having a good understanding of the basic first is really the best practice to have. If you don’t want to hit your head against the wall.

if you want to go faster to the visual and UE4 thing, you can try a book that is more what your are looking for I assume:

but I warn you, the book was written in early 2015, not so long ago, but enough to be kinda old… it’s using VS2013 and UE 4.4 (today I’m with VS2015 and UE 4.12)

( I don’t know if there is a lot of things that changed in the example of the book, sorry. At worst you can install the older version of VS and UE4 to stick to the content of the book, and then upgrade and have a look at the change log of UE to know what changed)

I have to be honest though, I wanted to ask the same question weeks ago.

It’s just boring as all get out learning C++ with console I/O or reading files over and over. It would be a lot funner if, “the basics” could be recreated in UE, and even help learn the engine as well. I mean, even a simple for loop iterating over a boundary would be funner if you could actually watch “pretty” graphics throw it on the screen, you know?

There’re lot of UE4 C++ tutorial on Youtube…

I’m just a hobbyist, and I can only share what’s worked/is working for me

yep I agree, the “bottom-up” way isn’t the fancier. But At the end it often help to shape your mind/practice in a good way.

problem is part in your mind because you associate
visual = looks great = I’m proud of what I’m looking at/making = it’s fun
text/console = looks boring/awfull = I’m boring/bored/awfull = it’s crappy/awfull

try to put away that.
try to stop to overvalue the graphics/visuals.

if it can help, remind yourself, that some of the greatest features available in games have nothing to do with the fancy visual:

  • networking ! (it’s all about data, how to send them between computer, etc… Internet, LAN party wouldn’t exist without that)
  • I/O : no way to have a game without interactivity ! (keyboard & mouse inputs, kinect,… and feedback to user like sounds or just a score on the screen)
  • files (write/read), imagine if we couldn’t save files or read them, how could we save the game, or even get the fancy graphic from the files on the HD to the screen

if you can’t change your mind on the fancy appeal; go for playing directly with UE4 or with modding already existing games, there are tons of youtube vids to learn to do a lot of things.
It’s also possible to learn from a more “top-down” perspective. having to deal with the fancy effect/visual and all the things at once can be a challenge to really understand what is involved without getting lost. But some of the great game creator have learn first modding other games.

Also an important part of programming, is just to shape your mind into “problem solver” mode.
It’s about learning to recognize pattern of problem and which pattern of solution are best to solve them. It’s just about practicing that a lot. and learn that bugs and failure are the way to success and that you’ll never end to learn :slight_smile:

**
At the end, you are the only one to know what’s best for yourself, try different method if necessary, and take those which works best for you.

last comment: try to know if you want to really program games or design games. that’s kinda two different things.**

re-re-edit :stuck_out_tongue:

I forget the playing way. today there are more and more game that are about learning by playing

  • human ressource (a little game about algorithm solving puzzle)
  • tis-100
  • and there also game to learn javascript (couldn’t get the name, lost in my wishlist on steam)

Create a small game like Pong or something. Focus on building one piece at a time. Solve each before moving to the next.
The biggest thing to get used to is code structure initially or at it was for me.
Follow great examples like shootertutorial.com and tomlooman.com
Try and fail and try again, takes time but you will get there.

Thanks for the replies everyone! I will be trying out all the options you guys have listed. I think knowing the basics and taking my time might be the best option, I’m not in a rush to make anything.

I’d recommend go higher level languages first…
I’d go this route, personally:

Blueprints in UE4
JavaScript in Unity
C# in Visual Studio or Unity
CRL in Visual Studio
C++ in Visual Studio
then C++ in UE4…

Or a quicker route:

Blueprints in UE4
Convert Blueprint to C++ in UE4
Study converted code…

Oh, and there’s the BlitzBasic program which is 100% awesome to take your first steps in programming.

UE4 is a large C++ code base. Trying to start C++ programming inside that large code base will be very hard, just because there’s so much “UE4” that you don’t know, in addition to the “C++” you don’t know. However, as you learn C++ from some simpler projects, searching through and reading the code in the Unreal code base is a great way of getting exposure to how real C++ programs work, what patterns people use, etc. Using Visual Studio “go to declaration” on classes/functions/macros you find is super helpful. Similarly, using “find in entire solution” is also useful to find a possibly large number of places where a thing is being used, so you can compare the different ways.

UE4 is one of about three flavors of C++ – the “middle ground” flavor. There’s also the “use all templates and new features as much as possible” flavor, and the “break everything into as small and simple objects as possible” flavor, neither of which is as common in practice as the middle ground. However, some books/tutorials will lean more towards some of these flavors, and thus what you read/learn in the book may look different than what you find being actually used in the Unreal code.

Finally, do you know how to program in any language? If not, I would highly recommend starting with Blueprint in Unreal. This is about as gentle an introduction to programming concepts you can get, and working through blueprints will show you the shape of the architecture of UE4. After you’ve done that (or in parallel,) you can learn C++ from various tutorials/books, and then, once you’re ready to do C+±for-unreal, you have a better grasp of what kinds of things to look for.

Oh I agree, but I think it’s also part of being tired of just reading books and working exercises from them in console I/O (or FLTK from Stroustrup’s book) :wink: You have to start somewhere, and if you’re new, having Visual Studio open to a basic C++ Actor class is going to be overwhelming at best, but it would be AMAZING if there was a real, genuine, “Hello, World!” for UE C++! I mean, you can only reverse that file or make Tic-Tac-Toe so many times in console before you want to see a little more haha!

Don’t get me wrong, I still have plenty to learn as far as C++ is concerned, but even with the basics down pretty well (much past “Hello, World” :wink: ) and a real interest in getting into UE4 (it looks really fun) the tutorials just sort of throw it at you, and you get the feeling of being overwhelmed not just by UE - which is only natural - but not knowing where to REALLY begin with it. You get UPROPERTIES and a few other things under your belt from the tutorials, you’re feeling good, and the tutorials quite literally say, “You’re on your own!” Ha, I mean it’s all good and well, and I hardly expect Epic to teach me everything, but I’m sitting there yelling, “No don’t go! We were just getting started!”

I still feel like it’s not Epic’s job to teach people C++. Blueprints are a propietary language/format, so it makes sense to teach that stuff, and some tutorials on how C++ should be used in the UE4 ecosystem definitely makes sense. But C++ itself? There are plenty of resources on the internet to learn that stuff, and I’d rather Epic not waste time re-hashing material that’s already available.

I actually never really suggested they do that. I’ve learned enough bare C++ to be just fine without it. In fact, from my own post you quoted, I did say, “… I hardly expect Epic to teach me everything…”

I DID suggest it would be nice to see how C++ translates directly into Unreal Engine, because I do believe it would be a fun method of learning something difficult. By no means do I think it would be an easy thing to do, but Epic has chosen the royalties path and distributed the engine free (and make no mistake, I love it), and people reference and gravitate towards things they learned first and best. You may speak two languages, for example, but you will often prefer and reference your native language above all. C++ and UE4 is unlikely to be the exception, so any amount of additional training they can provide is likely to be worth their time. Our success with the engine is their success. Re-hashing content? Possibly a waste. Updating and supplementing existing content? Not a waste by any stretch of the imagination.

OP, take my word with a grain of salt as someone that has a mere 7-8 months with C++ and still feels he knows little, but get a decent beginner book for C++ programming. Stroustrup’s “Programming Principles and Practice” (2E) is an excellent start. He made the language and heads the standards committee, so he likely knows as much as anyone. It’s a double-edged sword with him though as he occasionally forgets his target audience is beginners, and the structure of the book is… out there. If you can get through it OK though, you’ll have enough of the basics to be dangerous, but understand.

I was fortunate enough to attend college way back when for engineering technologies, so things like logic operators, boolean operations and whatnot weren’t new to me. They’re not hard to learn by any stretch of the imagination, but if you want a REALLY basic book on C++, the best I’ve seen is “Problem Solving With C++” by Walter Savitch.

Between the two, I’d go with Stroustrup, reason being the exercises and examples between the two books. Savitch’s exercises are EXTREMELY dry, typically involving little more than mathematical tasks that aren’t particularly difficult anyway. The examples do their job for the most part, but they’re often overly simplistic. Stroustrup provides FAR better examples and exercises that you can see basic, but real application. It comes with the caveat that his book is definitely not the most beginner friendly, but amazingly still friendly ENOUGH.

You’ll see people saying, “C++ Primer.” Don’t. I bought it, and it was a bad idea. The book never claims to be beginner friendly, instead masquerading as an, “intermediate” level text, but at times makes attempts to be beginner friendly. It does neither well. Stroustrup has a reference book, “The C++ Programming Language” which - as the word “reference” implies - is aimed at more experienced programmers, and was meant to be the equivalent of reading system documentation. It reads friendlier than Primer. Primer has a very bad habit of being overwhelming and very quickly bogging the reader down in details, and it’s equally difficult to know what are unnecessary or obscure details (as a beginner) and which are absolutely essential. As an example, Chapter 3 begins teaching the concept of low and high level const. At this time, you just need to understand the concept of const. Much of the next several chapters (I’ve read) is more of that, and it becomes very frustrating very quickly.

Anyhoo, I hope this was at least helpful. I know I’m still very much a noob and everyone is different, but as a person only ever so slightly ahead of you, it’s still fresh in my memory, which possibly makes me a decent resource for where to - and equally importantly - where NOT to start. Also, if you’re getting any crazy ideas of giving pay sites like PluralSight money, please don’t. MS ran an offer where PluralSight was free for 6 months. It’s not good. It has very knowledgeable people to be certain, but it’s more of a crash course to C++ than anything, and nothing you find there can’t be found free elsewhere. I sincerely doubt you walk away with knowledge commensurate cost.

Hi

I’ve spent a lot of money on books : C++ primer 5ed , Programming Principles and Pratices Using C++, The C++ Programming Language (C++11 ed), Accelerated C++ from koening & Moo, some Online Courses form pluralsight with Kate Gregory, even “Learning C++ by Creating Games with UE4” (Pretty outdated right now)

And I had never enough confidence to start UE4 C++ tutorial series, until i’ve found this course : https://www.udemy.com/unrealcourse/ 4 weeks ago on Reddit. Even for a non native speaker it’s a totally mind blowing, it’s worth every penny specially for C# developers or other false beginner, everything is updated to UE4 4.10 to 4.12 using C++11, a lot of concepts are now crystal clear (even forward declaration are clearly explained).

Would you recommend it for a new coder? Also, is it a one time fee?

Hi all.
If there is someone who knows the Russian language, I recommend to take this course: С++ - YouTube.

Thanks for your reply! I’ll definitely try out the book.

The course start from the real beginning with a console text game and a really light C++ so you can give it a try, but for a total beginner its pretty straight forward sometime and if it’s too hard you can request a refund.

I’m near to the end of this course and the teacher is still uploading new videos every 2/3 days. (The subscription is a one time/Lifetime fee for the price of one Stroustrup’s Book (C++ Author) )

Epic should reward this guy with an MVP Title at least.

Actually, I found a 50% off code online, but its only up until July 30th at 2 AM

Yeah, that’s totally fair. I was probably more adding in to what you were saying rather than trying to rebuke it, but it came off as harsh either way. Appreciate the pull-up.