I have been neglecting this thread, but that doesn't mean I have been idle.
Currently I'm working on a new project I started, which I call autogenerate.exe. It is a C++ project, which is compiled when the makefile starts and it outputs C++ code and makefile files. This aids programming and compiling WTP.
XML and code awareness
It scans both the mod's source code as well as all the xml files. A new files.xml makes it possible to configure how files are handled.
New enums
It creates classes, each containing an enum. For instance UnitType contains all types from UnitTypes and has a single variable, so it is intended to be interchangeable. The difference is that a class can hand member functions. For instance looping would be
PHP:
for (UnitType eUnit; eUnit.next();)
This will loop through the entire list and no typecasting needed. Other features are on the drawing board, but this part is still in the early days and isn't used yet.
EnumMap rewrite
EnumMap is the concept of having arrays of length matching xml files (not a new concept). It has gone through a few iterations, each fixing the mistakes of the previous one. Currently it's based on template classes and class inheritance. Now autogenerate.exe is generating them, so it's still templates, but no class inheritance and all the code is specialized functions. This makes the code way more readable and it's also easier to maintain and upgrade. This has reduced the memory usage so now all EnumMaps will only use 4 bytes. Well 8 for bools if they are in the range 33-64, which is useful for say CvPlot storing a bool for which teams have seen the plot. Since it doesn't have to use the precompiler to configure anything automatically and instead relies on C++ to generate text, the need for creative coding is gone. It also allows for using faster code as each specialized function can be optimized to the specifics of said xml file, like is length known at compile time, which may or may not be used to reduce the code enough to inline functions.
EDIT: forgot to mention, one major change to EnumMap is that I now consider thread safe coding. Since I wrote the original, we have split off to make the mod multi threaded, but the current EnumMap is optimized for low memory usage and sacrifices multi thread support in the process. The new version aims at being thread safe for 4 byte variables, such as ints. It's not a flaw in the original, but rather the requirements have changed.
Fastdep replacement
Fastdep.exe is a program used to list which C++ files includes which headers recursively and that way will only need to be recompiled if an included header is changed. However it's not a super good program as crashing is an issue, at least for some people and the output is not configurable. I let fastdep.exe do the job instead and it is custom designed for our use case. For instance usage of the precompiled header has become optional on a per file basis. If a cpp file doesn't include CvGameCoreDLL.h, then the resulting makefile will just not use the pch file, which is an improvement over the current makefile, which will cause it to make a compile error. Since the output isn't depending on the pch file, those files can be compiled in parallel with generating the pch file, which just happens to take forever and only use a single CPU core. This will at least eventually make compiling faster.
InfoArray rewrite
This is a write once, read many times array of a non-fixed length. It's designed to read an array from xml, like list of UnitCombatTypes a promotion can apply to, through it can have much more complex data structures, like <FeatureTypes, TerrainTypes, int> entries in the list. Like EnumMap, this class has seen a few iterations and is currently a hybrid of template class inheritance, which in turn inherits the pre-template version as protected so the type unsafe version can't be called from outside the class. It works, but it's certainly not reader friendly and not expansion friendly.
Work on InfoArrays have not yet started. I want to get the other parts to work flawlessly before including yet another project.
So work is progressing into having much better code, which in turn will make programming both faster and more fun. It will also hopefully make it harder to introduce bugs as the new code is way more restrictive on type correctness as well as proper use of const.