Steps from just after compiling engine to compiling module?

https://docs.unrealengine.com/latest/INT/Programming/Modules/Gameplay/index.html
I tried looking at this, but I have had no luck following it. How do you make Visual Studio detect [GameName]\Source[ModuleName]\Public\ and [GameName]\Source[ModuleName]\Private\ when the editor puts code in [GameName]\Source[GameName]\ ?

That article seems to be lacking quite some information.
I was able to get a module to compile for UnrealTournament. I’ll use the same macros [GameName] and [ModuleName] to keep it as generic as possible:

  1. Add the following line in Source\[GameName].Target.cs and Source\[GameName]Editor.Target.cs (in the SetupBinaries method):

    OutExtraModuleNames.Add("[ModuleName]");
    
  2. In the Source, create a directory called [ModuleName]
    (I believe that in the article you mentioned, there is a typo that lacks a backslash!)

  3. In Source\[ModuleName], create a file called [ModuleName].Build.cs with the following content (edit the dependencies as required):

    using UnrealBuildTool;
    
    public class UTRPG : ModuleRules
    {
        public UTRPG(TargetInfo Target)
    	{
        	PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine" });
    	}
    }
    
  4. Create the directories Private and Classes in Source\[ModuleName]. I have no idea when to use Public, in the UT source code, it doesn’t even exist.

  5. In Private, create a file called [ModuleName].cpp with the following content:

    #include "[ModuleName].h"
    #include "[ModuleName].generated.inl"
    
    IMPLEMENT_PRIMARY_GAME_MODULE(FDefaultGameModuleImpl, [ModuleName], "My Module");
    

    Also in Private, create [ModuleName].h with:

    #ifndef __MODULE_NAME_H__
    #define __MODULE_NAME_H__
    
    #include "Engine.h"
    /* ... add an include for each of your classes here and include this header in every source (cpp) file ... */
    
    #endif
    

    Note: that .generated.inl file that’s being included in the source only seems to be generated if you have any classes at all.

  6. Put your class header files (h) into the Classes directory and the source files (cpp) into the Private directory. When you build the game project, your module should now be built as well.

I hope this helps, but I cannot really explain all of those steps. It was a matter of trial and error.

I’d be really grateful if somebody who has the authority edited the article you linked to, because it lacks a bunch of information that’s apparently required.

For instance, while I can compile my module that way, I have not found a way to make the game load the module. Editing the INIs as described in that article does not seem to do anything (or not enough). I have posted a question regarding that here: How can I get a Gameplay Module to load? - Programming & Scripting - Epic Developer Community Forums