Generate visual studio project files ....

Ok Just need some clarification,

It seems to me, once you compile the editor from source, then start a new C++ project and add your first C++ class to the project, the editor generates the visual studio Project files the same way right clicking on the .uproject file and choosing “Generate Visual Studio Project Files” does. It even opens the generated project solution in visual studio for you once it adds the code and compiles it.

So , my question is, does generating the project files from right clicking the .uproject file->“Generate Visual Studio Project Files” add anything more than just adding a new c++ class to the new project does? Is it a dependency thing?

Basicly what I am asking i guess is what exactly is the difference?

Because it seems kinda redundant to me to start a c++ project, add your empty C++ class to get started, let the engine add the code and compile it and seemingly generate the project files, then close the new project and Visual Studio, go back to the .uproject file, right click , then generate the project files again.

also by doing it that way, you end up with the build tool, complaining that build rules already exist for c:/unreal projects/foo.uproject and it fails to rebuild the project files, leading to hours of migraine inducing searching for the file its complaining the build rules exist in lol.

No One knows?

The best workflow to create a new class is to create the file with the Unreal Editor Wizard. It’s create the files with some base code. You can find how to use it in the official documentation.
When you need to compile from Visual Studio, press Ctrl + Shift + B for compile and hot reload the project to the Editor (if you have an error with this shortcut : right-clic on your project in VS -> Set as StartUp Project).

I never use the “Generate Visual Studio Project Files” for add a class (neither than the other options of the .uproject file). I use this option only if I have to reload some .dll files (add a UE4 module for example).

You don’t need to do this. Sometimes the editor don’t show the new C++ class but it’s just visual, the class is here and loaded by the engine. If you need to see your file, just restart the editor (VS don’t need to be close).

There are a difference between ‘just’ compile the code and generate the Visual Studio files :

  • Generate the files reload all the necessary files from the UE4 location (code and dependencies). Generally you need to do this only once.
  • Compile : compile your code and generate the necessary files (like the *.generated.h files)