Announcement

Collapse
No announcement yet.

Govern.txt questions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Govern.txt questions

    How do WarDiscontentMaxUnits and WarDiscontentPerUnit work exactly?

    It says in the mod section,

    WarDiscontentMaxUnits - Maximum number of unit to be counted towards War Discontent
    WarDiscontentPerUnit - Amount of Unhappiness to be created by each unit
    so as an example Democracy is,

    WarDiscontentMaxUnits 5
    WarDiscontentPerUnit 2

    ?
    Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
    CtP2 AE Wiki & Modding Reference
    One way to compile the CtP2 Source Code.

  • #2
    Okay so i know that for every unit after the 5th i get -2 happiness (using the example above) so 1 city and 6 units would create -2 WD (WarDiscontentPerUnit is 2), but thats only for 1 city. If i have 2 cities and 6 units its -1 WD.

    Well i know its worked out by # of cities too, i just dont know how exactly. I had some things written down to work it out and they did work, but the formulas were failing with 35 cities, so im still Would be nice if some looked at the sourcecode

    Id also like to know how AtHome Radius works and what it affects too.
    Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
    CtP2 AE Wiki & Modding Reference
    One way to compile the CtP2 Source Code.

    Comment


    • #3
      Code:
       m_warDiscontent = 0;
      const GovernmentRecord *grec = g_theGovernmentDB->Get(p->m_government_type);
      if(militaryUnitsOutOfCities > grec->GetWarDiscontentMaxUnits()) {
      	sint32 diff = militaryUnitsOutOfCities - grec->GetWarDiscontentMaxUnits();
      	double total = diff * grec->GetWarDiscontentPerUnit();
      	double perCity;
      	if(all_cities.Num() < 1)
      		perCity = 0;
      	else
      		perCity = total / all_cities.Num();
      
      	m_warDiscontent = perCity;
      }
      So,

      total = (militaryUnitsOutOfCities - WarDiscontentMaxUnits) * WarDiscontentPerUnit


      And then (per city): warDiscontent = total/number_of_your_cities


      I'll try to track down 'AtHomeRadius' now.

      Edit: Yuk. Basically, if an army is further than AtHomeRadius away from one of it's cities, it may contribute to some 'overseas' measure, but I can't find where this is used.
      Last edited by Peter Triggs; March 24, 2004, 12:02.

      Comment


      • #4
        Comparing to some saves ive got, working it out with that formula i get roughly WD -2 more above what it actually says in the city manager, i dont have any WD reducing builds either.

        I guess stealth units and settlers dont count as "militaryUnitsOutOfCities", but still im not getting an exact result.

        But... i guess i cant argue with the sourcecode.

        I suspected units in the at home radius, but not in cities, would contribute to WD, which is kinda strange.
        Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
        CtP2 AE Wiki & Modding Reference
        One way to compile the CtP2 Source Code.

        Comment


        • #5
          Originally posted by Maquiladora
          Comparing to some saves ive got, working it out with that formula i get roughly WD -2 more above what it actually says in the city manager, i dont have any WD reducing builds either.

          I guess stealth units and settlers dont count as "militaryUnitsOutOfCities", but still im not getting an exact result.

          But... i guess i cant argue with the sourcecode.

          I suspected units in the at home radius, but not in cities, would contribute to WD, which is kinda strange.
          which is the weird thing i really love about CTP2, its not an exact game to play or work out
          'The very basis of the liberal idea – the belief of individual freedom is what causes the chaos' - William Kristol, son of the founder of neo-conservitivism, talking about neo-con ideology and its agenda for you.info here. prove me wrong.

          Bush's Republican=Neo-con for all intent and purpose. be afraid.

          Comment


          • #6
            Probably the only civ game that cant always be played the same way and won everytime, lots of different strategies, all the more need to know whats going on under the hood.
            Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
            CtP2 AE Wiki & Modding Reference
            One way to compile the CtP2 Source Code.

            Comment

            Working...
            X