Modding Question - Allow same founding father for multiple nations?

DB1

Chieftain
Joined
Apr 14, 2022
Messages
3
Question - Is there any way I can edit WTP to let multiple nations unlock/enable the same founding fathers?

Context - Absolutely loving WTP and the new life it gives Civ IV Col, have been for years.

However the one aspect that ive often been frustrated in is that there is a race to unlock founding fathers.

Similar to the race for wonders in other Civ games, I constantly feel this is forcing me to rush certain aspects else my late game civ is left behind - leading to the need to crush other nations before then or miss out on enjoying building up a fully developed civilisation. Or to use the World Editor to nerf the AI till I unlock my favourites, leading to unbalanced gameplay even if I buff them after.

I have some C++ experience in other contexts, and have modified xml and some aspects of python for WTP - but not enough that i can see a solution to stop founding father choices being blocked after its first unlocked by a nation.

Im not overly concerned about the UI aspect, if it needs adjusting to stop errors then yes but if it shows first nation, or no nation, or any nation thats ok.

Is there anyone that can direct me to a solution?

Ideally one without recompiling the dll, if at all possible
 
Last edited:
I don't really like chasing after fathers either (or any of the races really, except when there is a more clear overview of who might be about to win the race - like the other European nation just sent out a settler and he is heading towards that gold). I have tried to change this myself but I kept digging deeper holes, so I quit. But you have now inspired me to give it another shot.

I am no programming expert of course, but I can say for sure that it is not a quick solution and you would definitely have to recompile the DLL if you do it.

Currently there is an enum map called m_em_eFatherTeam from which you get or set which team a father belongs to. There is also a function named canConvinceFather("Not Your Daddy") which checks if the father belongs to a team and which.

You would have to switch things around and probably make something like an info array of which fathers belong to a team so that each team can have a list of their fathers which puts no constraints on whether the fathers are different or the same as the ones on other teams. You may also want to make another info array of rejected fathers or you will keep on getting popups for the same person over and over.

Then you would need to change the founding father screen (..\Assets\Python\Screens\CvFoundingFatherScreen.py to remove the flags of the other nation's claimed fathers and maybe only show your own founding fathers.

You would also want to remove the notification of when a father has joined another nation, which at the moment is in the function setFatherTeam("Son", "Tottenham"); but you would probably do away with that function altogether, and instead make a new function and name it setTeamFathers(TeamTypes, FatherTypes) or something along that line.

I'll paste in the different snippets of code here, if I can succeed in getting it done, and you think you are still interested in making it happen. Or the other way around please if you succeed in getting it to work.
 
I don't really like chasing after fathers either (or any of the races really, except when there is a more clear overview of who might be about to win the race - like the other European nation just sent out a settler and he is heading towards that gold). I have tried to change this myself but I kept digging deeper holes, so I quit. But you have now inspired me to give it another shot.

I am no programming expert of course, but I can say for sure that it is not a quick solution and you would definitely have to recompile the DLL if you do it.

Currently there is an enum map called m_em_eFatherTeam from which you get or set which team a father belongs to. There is also a function named canConvinceFather("Not Your Daddy") which checks if the father belongs to a team and which.

You would have to switch things around and probably make something like an info array of which fathers belong to a team so that each team can have a list of their fathers which puts no constraints on whether the fathers are different or the same as the ones on other teams. You may also want to make another info array of rejected fathers or you will keep on getting popups for the same person over and over.

Then you would need to change the founding father screen (..\Assets\Python\Screens\CvFoundingFatherScreen.py to remove the flags of the other nation's claimed fathers and maybe only show your own founding fathers.

You would also want to remove the notification of when a father has joined another nation, which at the moment is in the function setFatherTeam("Son", "Tottenham"); but you would probably do away with that function altogether, and instead make a new function and name it setTeamFathers(TeamTypes, FatherTypes) or something along that line.

I'll paste in the different snippets of code here, if I can succeed in getting it done, and you think you are still interested in making it happen. Or the other way around please if you succeed in getting it to work.


Thanks @Ramstorp - yeh if you can share snippets of what you expect to need changing im happy to dig further and see what comes up

I have decent C++ experience though havent compiled DLL for this game before, so will look into that once we figure out most of the places in need of changing
 
I would rather see those ff that modify production be able to be purchased after 25 turns with only a 10% bonus rather than the full 25% this concept would represent technological decision.
 
Thanks @Ramstorp - yeh if you can share snippets of what you expect to need changing im happy to dig further and see what comes up

I have decent C++ experience though havent compiled DLL for this game before, so will look into that once we figure out most of the places in need of changing
Alright, I think I am getting it done. I was making it too hard for myself. There is a function in CvTeam that keeps track of whether a father has been rejected called isFatherIgnore(). So you just more or less duplicate it in wherever place and different ways it appears and rename it into another bool function for the founding fathers that are accepted:

CvTeam.h
Code:
bool isFatherIgnore(FatherTypes eFather) const;
    void setFatherIgnore(FatherTypes eFather, bool bValue);
// Ramstormp, PTSD, Everyone can have every dad - start
    void setFatherConvinced(FatherTypes eFather, bool bValue);
    bool isFatherConvinced(FatherTypes eFather) const;
// Ramstormp - end

Then in places where setFatherTeam() shows up you replace it with setFatherConvinced():

CvTeam::convinceFather()
Code:
if (bAccept)
    {
        for (int iPoint = 0; iPoint < GC.getNumFatherPointInfos(); ++iPoint)
        {
            FatherPointTypes ePointType = (FatherPointTypes) iPoint;
            changeFatherPoints(ePointType, -getFatherPointCost(eFather, ePointType));
        }
        // Ramstormp, PTSD, Everyone can have every dad - start
        //GC.getGameINLINE().setFatherTeam(eFather, getID());
        setFatherConvinced(eFather, true); 
        // Ramstormp - end
    }

Instructions on compliling: https://github.com/We-the-People-civ4col-mod/Mod/wiki/How-to-play-the-development-version
 
  • Like
Reactions: DB1
Top Bottom