1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

raising the vassal limit from 4

Discussion in 'Civ4 - Rhye's and Fall of Civilization' started by jassious, Aug 29, 2014.

  1. jassious

    jassious Chieftain

    Joined:
    Aug 29, 2014
    Messages:
    4
    I love rfc. The entire structure of the game, the map, the coming of nations, the stability etc.

    But even the best game, isen't fun to play, if there isen't any changes sometimes.
    In the start i enjoyed the cap of 4 vassals/alliances (5 in the older version), but now, i want to play as romans, or germans, and make more vassals than the limit of 4.

    As the game concept runs in to different language, i found a programme which enables me to compile the low language to the assembly language. I use the programme named "HXD".

    I read through different discussions and guides, but as i am fairly new (a total idiot in this), i seems to have missed something. I therefore ask for help from someone a litle more ecperienced in this edditing/programming world.

    A) Here is the sites i primarily have used:
    1) http://forums.civfanatics.com/showthread.php?t=475513
    2) http://forums.civfanatics.com/showthread.php?p=9246358#post9246358

    As far as i understood it, i only had to change the number 4 in both places, to another number, compile it, and then it should take effect, but in a recent roman game i played, nothing happened when i got to my number 4 vassal, it simply said the same as always: "You've grown too powerfull for us"


    C) Here is my questions:
    1) Have i missed something in this part:
    Spoiler :
    //Rhye - start (16 vassals cap if already the strongest)
    int mastersVassals = 0;
    int mastersPower = kMasterTeam.getPower(true);
    bool bStrongest = true;
    for (int iLoopTeam = 0; iLoopTeam < NUM_MAJOR_PLAYERS; iLoopTeam++)
    {
    CvTeam& kLoopTeam = GET_TEAM((TeamTypes)iLoopTeam);
    if (kLoopTeam.isAlive() && kLoopTeam.isVassal(eTeam) && iLoopTeam != getID())
    mastersVassals++;
    if (kLoopTeam.getPower(true) > mastersPower)
    bStrongest = false;
    }

    if (mastersVassals >= 16 && bStrongest)
    return DENIAL_POWER_YOU;
    //Rhye - end

    return NO_DENIAL;

    2) or might it be somewhere else, perhaps even in another file. I have primarily focused on searching through these files in the cvgamecoredll in rfc:
    a) CvTeam
    b) CvTeamAI
    c) CvDeal
    But then again, as i am an idiot to this, i might have missed something which in a skilled eye, should be impossible to mis!
    I have used hours and hours, but i am totally lost, i hope for some qualified help.
     
  2. Leoreth

    Leoreth Space Ranger Moderator

    Joined:
    Aug 23, 2009
    Messages:
    27,862
    Location:
    Red Lion
    This seems to be the right piece of code. I can give you a more specific answer once I have access to the entire source code again.

    However, I am not familiar with the program you're using to compile the code. Do you know if you're actually able to to compile a DLL? You can tell by the creation of the CvGameCoreDLL.dll in the Assets folder.

    If you need more assistance with that, there are some guides on modiki.civfanatics.com and in the tutorials sections of the C&C forum about compiling the C++ source code.
     
  3. jassious

    jassious Chieftain

    Joined:
    Aug 29, 2014
    Messages:
    4
    HXD is changing the c++ to dll in the cvgamecoredll. As i understand it, then it should either crash, because of the missing file, if it didn't work, or use an older file, which would allow unlimited vassals, but without renaming them, so they get those awesome names like province of hispania!!!

    As none of it happened in my recent game, i saved when england wouldn't become a vassal to rome, i must have compiled it correct, but missed another place with a "denial".

    so it should work flawlessly

    I am slowly going through those sites, but i don't think i have the brains to learn what i need to solve this problem in the first couple of months in this process. As it gets a litle boring, without the outcome i want, i ask for a litle help in here.

    I have been going through this part too a few times:
    Spoiler :
    //Rhye - start
    //due to easier pact trading, there's a cap of civs alliances
    //exploring the pacts tree without recursion
    int civsArray[27] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
    civsArray[getID()] = 1;
    civsArray[eTeam] = 1;
    int iJ;
    bool bContinue = true;
    int targetFlag = 1;
    while (bContinue) {
    bContinue = false;
    for (iI = 0; iI < NUM_MAJOR_PLAYERS; iI++)
    {
    if (civsArray[iI] == targetFlag)
    {
    if (GET_PLAYER((PlayerTypes)iI).isAlive())
    {
    for (iJ = 0; iJ < NUM_MAJOR_PLAYERS; iJ++)
    {
    if (iI != iJ && GET_PLAYER((PlayerTypes)iJ).isAlive())
    {
    if (GET_TEAM((TeamTypes)iI).isDefensivePact((TeamTypes)iJ) && civsArray[iJ] == 0)
    {
    civsArray[iJ] = targetFlag + 1;
    bContinue = true;
    /*char buf4[50];
    sprintf(buf4, "iI = %d; iJ = %d; targetFlag: %d;", iI, iJ, targetFlag);
    GC.getGameINLINE().logMsg(buf4);*/
    }
    }
    }
    }
    }
    }
    targetFlag++;
    }
    int totalNodes = 0;
    int numVassalsCoalition = 0;
    int maxNumVassalsPlayer = 0;
    int iMaxEra = 0;
    for (int iK = 0; iK < NUM_MAJOR_PLAYERS; iK++) {
    if (civsArray[iK] > 0) {
    totalNodes++;
    if (GET_PLAYER((PlayerTypes)iK).getCurrentEra() > iMaxEra)
    iMaxEra = GET_PLAYER((PlayerTypes)iK).getCurrentEra();
    /*char buf2[50];
    sprintf(buf2, "True: player %d: %d", iK, civsArray[iK]);
    GC.getGameINLINE().logMsg(buf2);*/
    int numVassalsPlayer = 0;
    for (int iL = 0; iL < NUM_MAJOR_PLAYERS; iL++) {
    if (GET_TEAM((TeamTypes)iL).isVassal((TeamTypes)iK)) {
    numVassalsCoalition++;
    numVassalsPlayer++;
    if (numVassalsPlayer > maxNumVassalsPlayer)
    maxNumVassalsPlayer = numVassalsPlayer;
    }
    /*char buf5[50];
    sprintf(buf5, "iL: %d; numVassalsPlayer: %d; maxNumVassalsPlayer: %d; numVassalsCoalition: %d", iL, numVassalsPlayer, maxNumVassalsPlayer, numVassalsCoalition);
    GC.getGameINLINE().logMsg(buf5);*/
    }
    }
    }
    bool bTech = false;
    for (int iK = 0; iK < NUM_MAJOR_PLAYERS; iK++) {
    if (civsArray[iK] > 0) {
    if (GET_TEAM((TeamTypes)iK).isHasTech((TechTypes)FASCISM) || isHasTech((TechTypes)FISSION)) {
    bTech = true;
    break;
    }
    }
    }

    //now the cap
    int iCap = 3;
    if (iMaxEra >= 5 && iGameTurn > 390) //modern && year > 1940
    iCap = 4 + GC.getGameINLINE().countCivPlayersAlive()/17 + (bTech? 1:0); //16 Warlords, 13 vanilla (higher because of the addition of bTech)
    else if (iMaxEra >= 4 && iGameTurn > 325) //industrial && year > 1800
    iCap = 3 + GC.getGameINLINE().countCivPlayersAlive()/17 + (bTech? 1:0);
    /*char buf3[50];
    sprintf(buf3, "totalNodes: %d; iCap: %d; civsArray: [%d,%d,%d,%d,%d]", totalNodes, iCap, civsArray[0], civsArray[1], civsArray[2], civsArray[16], civsArray[26]);
    GC.getGameINLINE().logMsg(buf3);*/

    if (totalNodes > iCap)
    {
    return DENIAL_NO_GAIN;
    }

    if (maxNumVassalsPlayer >= 4)
    {
    if (totalNodes > 2)
    {
    return DENIAL_NO_GAIN;
    }
    }
    else if (maxNumVassalsPlayer == 3 && numVassalsCoalition > 3)
    {
    if (totalNodes > 3)
    {
    return DENIAL_NO_GAIN;
    }
    }
    else if (maxNumVassalsPlayer == 3)
    {
    if (totalNodes > 4)
    {
    return DENIAL_NO_GAIN;
    }
    }

    if (numVassalsCoalition >= 6) //5 in Warlords
    {
    if (totalNodes > 4)
    {
    return DENIAL_NO_GAIN;
    }
    }

    if (numVassalsCoalition >= 2) //1 in Warlords
    {
    if (totalNodes > 5)
    {
    return DENIAL_NO_GAIN;
    }
    }
    //Rhye - end


    I would say, with my limited modding knowledge, it is one of the problems. Unfortunately i am not entirely sure how to change it to my number of 16 vassals.
    In the last part of the this part of the file, it makes a denial for more than 4 vassals. But what does totalnodes stand for, and should i look at something above the "int iCap = 3"?
    It's mentioned in one of the disussions i linked, but without explaining it...

    You seem to be quite good at modding leoreth. Based on your comments in other discussions on this forum. Would you look through the spoiler, and give a helping hand to my problem?
     
  4. jassious

    jassious Chieftain

    Joined:
    Aug 29, 2014
    Messages:
    4
    just a quick question more.
    When making a change in the dll, does it take affect on already saved game. assuming it doesn't crash like the other times...
    or do i have to play it all over again. I thought that was the issue first time i compiled the cvgamecoredll. But as nothing happened, i just need to know?
     
  5. clanky4

    clanky4 Platinum Chip is what all true couriers strive for

    Joined:
    Jul 11, 2012
    Messages:
    1,236
    Location:
    USA
    When making any change to the DLL or Python I found that old saves no longer worked.
     
  6. jassious

    jassious Chieftain

    Joined:
    Aug 29, 2014
    Messages:
    4
    And totalnodes. What is that? What does it refer to?
     

Share This Page