Hi! I have some questions about how to structure my C++ files.
I’m currently working on an RPG using C++, so naturally I have an ability base class, and a character base class. Each ability instance must have a caster reference, so it can pass information to any effects it creates or to affected targets when it is cast, and each character has a list of abilities. This means that the ability base class header #includes the base character header, and the base character cpp (not the header, otherwise circular dependencies are an issue) contains the base ability header.
Now, I have my build.cs file configured so that a full recompile isn’t performed with every compilation, only files that have changed. However, the way I’ve structured my code above means that if I make even the most trivial of changes to my character base class and recompile, Visual Studio spends a good 10-15 minutes recompiling every single ability in the game (as well as all my characters, but that I can understand).
With that said, are there any pointers about the way I should structure my header files to avoid unnecessary recompilation time? I’ve heard that you can split code into modules, and compile each module separately, but I don’t know anything beyond that about that system, so is that worth looking into?