I am just starting to mod Civ4 in order to implement a Reinforcement Learning agent from a 2009 paper and try to improve upon it as a project for an exam. The code for the paper was written in C++ and embedded in the SDK instead of using the Python API so for now I am mostly working with the C++ codebase.
I would consider myself an expert Python user and I have used C++ sporadically in the past with Cython bindings but due to time limitations and my unfamiliarity with older versions of C++ and Python I have some questions that I'd rather have answered by an expert modder than trying to figure everything out by myself.
My main concerns are as follows:
I would consider myself an expert Python user and I have used C++ sporadically in the past with Cython bindings but due to time limitations and my unfamiliarity with older versions of C++ and Python I have some questions that I'd rather have answered by an expert modder than trying to figure everything out by myself.
My main concerns are as follows:
- Is there a cheat sheet or a way to generate one for the various Enums in the game and how they relate to actual human-readable names? I am struggling to fully understand the logs I'm producing because everything is encoded as an int and not very readable, I know that these are filled in at runtime by reading the corresponding XML files but does anyone have a cheat sheet for the base BTS civs and leaders?
- On the same note, I'm trying to use some available functions like
C++:
GC.getInitCore().getLeaderName(PlayerTypes eId)
- Finally I've seen the Cython wrappers and the corresponding Python files but I can't find where they are called in the C++ code. Also all the tutorials show how you can implement Python scripts that make use of the exposed C++ variables and functions but is it possible to do the other way around? Not only is Python quicker to develop in and more suited to write Machine Learning algorithms but also a lot of the interface functions that I would like to use for code readability like the ones mentioned above are already implemented in the Python API because they are used to generate the interface. How would I go about calling Python functions and classes from the C++ SDK?