The BuildingClass and UnitClass elimination project

int* m_piCivilizationFreeUnitsClass; int* m_piCivilizationInitialCivics; bool* m_pbCivilizationFreeTechs; bool* m_pbCivilizationDisableTechs;
Yep, Unless this is how player civs get something critical somewhere, I'm cool with removing all that, though maybe not the disable techs... that could be useful for the non-player civs.

We like to make sure all civs start as equals here.

Code:
//infos.h
 int getNativeCultureGroup() const;
void setNativeCultureGroup(int i);

int m_iNativeCultureGroup;

//city.cpp
//new code
  setNumRealBuilding((BuildingTypes)GC.getCivilizationInfo(getCivilizationType()).getNativeCultureGroup(), 1) ;

//current code
  for (iI = 0; iI < GC.getNumBuildingClassInfos(); iI++)
      if (GC.getCivilizationInfo(getCivilizationType()).isCivilizationFreeBuildingClass(iI))
           setNumRealBuilding((BuildingTypes)iI, 1);
Going off of just the ID of the building is one way, but it would be better if it read the building type tag and interpreted it during load so in the XML you could just say <NativeCultureGroup>BUILDING_CULTURE_GROUP_EUROPEAN</NativeCultureGroup>.

However, I'm thinking, deeper still, that it really shouldn't be a building at all. A set of new functions in CvPlayer.cpp:
getNumCultureGroupTypes() const; - gets the count of the vector
getCultureGroupType(int iIndex) const; - gets the Culture Group ID
bool hasCultureGroupType(int iIndex) const; - checks to see if a particular Culture Group ID is owned
setInitialCultureGroupType(); - called at initializing the player, checks the loaded getCultureGroup tag in CvCivilizationInfos that corresponds to getCivilizationType for that player, and pushes this first entry to the Player's culture group vector.
changeCultureGroupType(int iCultureGroup, int iChange); - adds to the culture group the Culture Group ID IF iChange is 1 and if it is 0 or -1, removes it if it exists. This is useful for assimilation.
 
@Anq hopefully not only civs can spawn base cultures - some normal wonders and buildings require or give BUILDINGCLASS_GOOD_[Insert one of 7 continental cultures]
 
  • Like
Reactions: Anq
@Anq
There is 1029 global instances in buildingclassinfos but only 1027 global instances in buildinginfos (max instances of 1 or bigger). Hopefully it was because you didn't adapt things in "My Mods (unloaded)".
Only one building - national wonder - has max team instances of 1 or greater.
There are 269 player instances >1 in building classes and 267 player instances in buildings - hopefully it was because of "My Mods (Unloaded)" didn't get adjustement.
 
Last edited:
@Anq
There is 1029 global instances in buildingclassinfos but only 1027 global instances in buildinginfos (max instances of 1 or bigger). Hopefully it was because you didn't adapt things in "My Mods (unloaded)".
Only one building - national wonder - has max team instances of 1 or greater.
There are 269 player instances >1 in building classes and 267 player instances in buildings - hopefully it was because of "My Mods (Unloaded)" didn't get adjustement.
I skipped the "My Mods (Unloaded)" folder.
It contains an earlier(?) Mormon religion file, and we have integrated Mormon already in the Custom Religions.

EDIT: the files in "Mormon New" are actually newer
 
I skipped the "My Mods (Unloaded)" folder.
It contains an earlier(?) Mormon religion file, and we have integrated Mormon already in the Custom Religions.

EDIT: the files in "Mormon New" are actually newer
Yeah it meant to be replacement, I was fixing most serious XML errors in it, but I didn't move it out of My Mods (unloaded), as art and events weren't properly done.
Also one building seemed to be partial duplicate in it.
 
Top Bottom