FreeHeroes2 Enhanced 1.0
This release includes everything I was expecting to be included in an "enhanced" version.
This change is as previous last changes deeper under the hood but less visible excluding few bug fixes (lightning bolt will not crash and vampire lord should revive properly).
As changes under the hood are concerned:
- most inheritance is done properly according to OOP principles, and it prefers composition over inheritance. In English what it means, is that in most cases, the data structures are defined to be defined as a combination of multiple data fields, instead of being defined as a category of categories. This change makes compilers to give both less warnings and make easier to understand most of sections of code related with iteration of items and such. The most important is breaking the relation of "Army" and "Monster", as "an army was a monster" instead of an army being defined as a monster. This made some code to be really almost impossible to debug related with damage, as the developer (aka me) had to look life and damage if it is multiplied or not with the number of units and similar.
- there were hundred of changes so that FreeHeroes 2 Enhanced compiles in C++ 14 and C++ 17 mode, especially as C++ 17 doesn't allow
std::bind
construct. In plain text it means that if in future (or in present) you want to compile to a newer compiler, let's say Visual Studio 2017 and you want to improve it by adding some C++ 17 specific functionality in your fork, now you can do it, as you can compile it - many changes were done to expose as possible (still there are thousands of places that this can be improved) to not use "int" or similar non-descriptive type, when code had the specific labeling.
Important note: FreeHeroes2 Enhanced did break file save functionality compared with FreeHeroes 2 "original" and it does not want to keep a binary compatible at major versions. FH2Enh as FH2 does not load original save files from the original GoG Heroes 2 game, but both versions will load maps and original assets.