As a C# web developer how could I learn C++ with UE4?

Hi all,

Downloading UE4 now, really excited. Even though I am a C# web application developer I’ve always wanted to get in to game development and after seeing the new sub plan for UE4 I thought it might be the perfect time to try and transition. I understand there are blueprints and with my knowledge of loops, variables, bools etc. etc. I think it should be a good start but how does one get in to the real C++? Can I view the source of the blue prints so if I made an action I could see how that looks in C++ coding? What would you recommend for a C# developer doing this as a hobby? (Potentially with some friends later on).

Many thanks!

You can look at everything, they give the full source code.

I suggest starting with one of the templates and just look through the provided code. Use the examples, like Shooter and Strategy Game as a reference for how you want to do stuff. Also, made tons of C++ tutorials, like 26 of them I think. He put his work up on the wiki.

Thank you for the quick response. I’ll have a look around the templates before checking out the tutorials.

I’m mainly a C# Unity Developer, I guess I might have a bit more experience than you because I understand some of the basics of how a game engine and game loop run because of the projects I have done in Unity. I have never programmed in C++ before today, but I found running through the FPS tutorial to be fairly easy to understand. I will say though, some of the code was a bit alien to me until my brain cross referenced the similar functions with what they do in Unity.

Give it a go and see how you fair, I myself will be picking up a book on C++ just so I can understand how it’s written and what all the “extra” bits that I’ve never seen in C# do.

Thanks. I’ll look in to that. I figured a lot of it should be similar in function but just a different syntax. When I started doing PHP I had to Google a lot of syntax but it was easy to understand and create functions still.

Learn pointers and such. Probably the worst part will be memory management. But the rest is really gravy. ohh and functions cant return arrays. But can return a struct with an array in it :stuck_out_tongue:

Video tutorials are the best way. You’ll need to at least do a C++ beginners course.
Get a Pluralsight subscription. They have a 7 hours beginner course,

Once you’ve done that you’ll be comfortable enough to know what you’re doing in UnrealEngine, then it’s a matter of learning the API.

Hey Malzir, how’s going? I hope everything is fine.

So, I’m a C# web developer as well and I’m learning C++ to coding for UE4 and guess what? The best way to get inside C++'s world is learning it purely. I mean, don’t go right to UE4’s way to program C++ - try to get it natively, without anything on its top.

The best source I’ve ever seen about C++ is LearnCPP so far. Trust me, the best thing you can do is learn the language by itself and then work with it having something on the top. But remember: you already know how to program. What you need is a syntax know-how, what means that you already familiar with how a programmer think.

Just learn C++ (syntax! Try to forget usual concepts) and let your ideas fly unto the code.

If you stick to RAII all worries about memory management are gone.

Thanks for the tutorial site, plowing through it now!

EDIT: also I got C++ Primer Fifth Edition on Safari Online, might just go with that in the end

The most confusing thing is pointers, not because pointers themselves are confusing - you already understand passing by reference/value and therefore the concept of having a reference to a value. It’s confusing because the syntax used is. I highly recommend reading through this page:

http://www.cplusplus.com/doc/tutorial/pointers/

You’ll want to learn about header (.h) files and how they’re used (you define what properties/methods your class will have) and .cpp files (you implement those methods).

Also, take what error messages are telling you with a pinch of salt, they can often be wildly misleading.

Personally, I prefer to learn by setting myself a goal (make a game!) and learn everything I need to achieve that. However, in this instance I would make sure you know pointers and how you use .h/.cpp files first. Most other things you should pick up easily on the way given your strongly-typed background. There are some oddities, but you’ll find them as you go just like in any language.

Also, where possible use the Unreal Engine data types as they’re cross-platform and generally safer to use. This page is a good overview of what’s available (specifically, note that they’ve implemented their own containers, e.g. TArray, and base types, e.g. int32):

Then, I’ve found that this FPS tutorial has been a fun introduction to learning UE4 from the C++ side: