Getting started with programming in Unreal Engine 4

I’ve started a 3rd Person Project, in visual studio I see a list of headers in External Dependencies, which I suppose are what I should be basing my code on.

As I’m new to C++ and the vs environment, can anybody think of a better way to display the classes and packages with some hierarchies instead of browsing through a long list? Am I looking at the wrong place?

I’d like to have a nice programming environment before I dive into the actual code, especially since it seems like I’m going to need to figure out many stuff by myself from their code.

From a very brief look, it seems like many classes names and functions are similar if not identical to UE3, is that something I’ll be able to rely on or would I need to figure stuff out here from the beginning?

The files listed under ‘External Dependencies’ are the files Visual Studio has detected to be in use at some point in your code. You shouldn’t edit these files directly but you can really learn a lot by opening them and reading through the comments.

You can use the class view. If you are using the default window layout in Visual Studio, then you can click on the Class View tab next to Solution Explorer, or if you can’t find it then just press Ctrl+Shift+C. Once in the class view, you can click on classes in the top list and see their members in the bottom list. You can also expand the entries in the top list to explore the inheritance hierarchy, so you can select base classes and see their members too. Double-click a member function to jump straight to its implementation.

As far as I know, the only programming environment that works with UE4/C++ is Visual Studio 2013. It’s a very nice editor but there have been reports of its IntelliSense feature draining the performance down a lot. I, personally, seem to be experiencing the same thing sometimes. I would love to write C++ code for UE4 in my favorite IDE, Qt Creator; that would be very nice, especially since it is a bit lighter than VS.

I don’t have any experience with UE3, but you are right in that you will have to learn a lot by yourself because there isn’t much documentation on the C++ side of things right now. There are many high quality tutorials on the wiki (A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums) but individual class and function descriptions are sparse at the moment. Check out the programming guide (https://docs.unrealengine.com/latest/INT/Programming/index.html), you will see a lot of learning material for UE4/C++ there. Also, check out the API reference, to find it launch the UE4 editor and go to Help > API Reference, you should find the most up-to-date description of individual classes and functions there. Alternatively, you can download the UE4 source code from GitHub, open the solution in VS, open the class view, and just browse the code, the UE4 source code is pretty well commented, so this is one way of learning the UE4 API. For a beginner it would probably be best to read the programming guide and go through the tutorials first.

Now that you mentioned it, what I was looking for could probably be achieved by downloading the whole source from github.

I’d like to download it just to be able to see the source, and if possible even link my solution to it (for F12, etc…), but I don’t want to build the source every time, just my solution. How do I approach doing that?

Straight from the documentation:

So, you don’t have to do anything special. Launch the Unreal Editor and start a new game based on a C++ template. After that, Visual Studio will pop up and you will be able to apply any knowledge you acquired by browsing the UE4 source code. The only reason I recommended that you download the source code was so that you could browse it with the class view as opposed to browsing through the long External Dependencies list in your project. Also, the External Dependencies list only shows files used at some point in your project’s code, so it does not reflect the entire UE4 API (unlike the full UE4 source code, which does reflect the entire API).

You can click on a class name and press F12 to jump to its definition, even if all you got open is the game project. I started a new third person C++ project called “ThirdPersonCpp”, Visual Studio showed up and in the Solution Explorer I opened ThirdPersonCppGameMode.h, then I clicked on AGameMode, pressed F12 and the file GameMode.h (located in the UE4 installation folder) was opened with the cursor already on line 41 where the class is defined. All without the UE4 project open.

Related noob question - I’ve just begun the new 3rd person tutorial and don’t see an ‘External Dependencies’ folder at all. Why is this?

You’ll find it in the Solution Explorer. Look in the Games folder, then in your game project. It’s one of the top level filters. There is also one in the UE4 project.

Hey jCoder, thanks for the assist. I’m still not seeing it. Is it buried in one of the pictured folders? (See attached image)

projectShot01.PNG

What version of Visual Studio are you running? If you’re running VS Express, that may be why you’re not seeing it.

This is what I see:
b5a9cf1a26b3742f452093d549a3a3db60fc2d76.jpeg

Bummer, I am indeed using VS Express.

Hi andersh,

Another thing you might check is whether you have disabled the Intellisense database (Tools -> Options -> Text Editor -> C/C++ -> Advanced -> Browsing/Navigation -> Disable Database). If this option is set to True, then the External Dependencies folder will not be created for your solution. Unfortunately I do not have VS Express installed so I cannot check it side-by-side with VS Professional.

It wasn’t showing on mine either until I made the “Disable External Dependencies Folder” option false. (Tools -> Options -> Text Editor -> C/C++ -> Advanced -> Browsing/Navigation -> Disable External Dependencies Folder )