Doto [AdvCiv ModMod]

2. after loose, find the capital with gov center.
Priority:
  1. National Wonder
  2. non wonder government centre building *
  3. World Wonder
  4. vanilla choice if none of the above exist
* in my mod you can build State Capital, that is a non wonder building under Federation civic. It works like Cathedrals: need X Courthouse / 1 State Capital.

You are awesome 😁
 
Im semi awesome, i owe all my cpp skills to @f1rpo .
At least you have those skills - unlike me 😉


Will you be able to port the code to yours and compile?
I hope. If your changes are properly marked I hope I'll be able to merge them. I want to try it at least.
 
defined anarchy for the loos capital -> almost the same as civics with a new global xml turn basis.
what do you think the number should be?
@<Nexus>
Code:
int CvPlayer::getCapitalLossAnarchyLength(bool bIgnoreGoldenAge) const // advc.132
{
    int const iMaxAnarchyTurns = getMaxAnarchyTurns(); // advc
    if (iMaxAnarchyTurns == 0)
        return 0;
    if (/* <advc.132> */ !bIgnoreGoldenAge && /* </advc.132> */ isGoldenAge())
        return 0;

    int iAnarchyLength = 0;
    
    static int const iBASE_LOSS_CAPITAL_ANARCHY_LENGTH = GC.getDefineINT("BASE_LOSS_CAPITAL_ANARCHY_LENGTH"); // advc.opt
    iAnarchyLength += iBASE_LOSS_CAPITAL_ANARCHY_LENGTH;
    iAnarchyLength += ((getNumCities() * GC.getInfo(GC.getMap().
                            getWorldSize()).getNumCitiesAnarchyPercent()) / 100);

    iAnarchyLength = ((iAnarchyLength * std::max(0, getAnarchyModifier() + 100)) / 100);

    if (iAnarchyLength == 0)
        return 0;

    iAnarchyLength *= GC.getInfo(GC.getGame().getGameSpeedType()).getAnarchyPercent();
    iAnarchyLength /= 100;

    iAnarchyLength *= GC.getInfo(GC.getGame().getStartEra()).getAnarchyPercent();
    iAnarchyLength /= 100;

    return range(iAnarchyLength, 1, iMaxAnarchyTurns);
}
 
hey buddy @<Nexus>
ok first -> in the function of ->void CvPlayer::findNewCapital() in CvPlayer.cpp.
place the below bulk somewhere in the middle of the set of iValue +=....:

Spoiler :

Code:
//doto113 keldath find the best capital enhanced start - by <Nexux>
        //BuildingClassTypes eCapitalBuilding2 = (BuildingClassTypes)GC.getInfoTypeForString(GC.getDefineSTRING("CAPITAL_BUILDINGCLASS_2"));
        BuildingTypes const eCapitalBuilding2 = getCivilization().getBuilding((BuildingClassTypes)GC.getInfoTypeForString(
            GC.getDefineSTRING("CAPITAL_BUILDINGCLASS_2"))); 
        if (eCapitalBuilding2 != NO_BUILDING)
        {
            int eCapitalBuilding2Amnt = pLoopCity->getNumBuilding(eCapitalBuilding2);
            if (eCapitalBuilding2Amnt > 0)
                iValue += pLoopCity->getPopulation() * 2;
        }
        //BuildingClassTypes eCapitalBuilding3 = (BuildingClassTypes)GC.getInfoTypeForString(GC.getDefineSTRING("CAPITAL_BUILDINGCLASS_3"));
        BuildingTypes const eCapitalBuilding3 = getCivilization().getBuilding((BuildingClassTypes)GC.getInfoTypeForString(
            GC.getDefineSTRING("CAPITAL_BUILDINGCLASS_3")));
        if (eCapitalBuilding3 != NO_BUILDING)
        {
            int eCapitalBuilding3Amnt = pLoopCity->getNumBuilding(eCapitalBuilding3);
            if (eCapitalBuilding3Amnt > 0)
                iValue += pLoopCity->getPopulation() * 2;
        }
        iValue += pLoopCity->getNumNationalWonders();
        iValue += pLoopCity->getNumWorldWonders();
//doto113 keldath find the best capital enhanced start - by <Nexux>


add in the globaldefines or in the altglobaldefines xml:
Spoiler :

Code:
<!-- doto113 keldath find the best capital enhanced start - by <Nexux>-->

</Define>
    <Define>
        <DefineName>CAPITAL_BUILDINGCLASS_2</DefineName>
        <DefineTextVal>BUILDINGCLASS_GREAT_PALACE</DefineTextVal>
    </Define>
    <Define>
        <DefineName>CAPITAL_BUILDINGCLASS_3</DefineName>
        <DefineTextVal>BUILDINGCLASS_VERSAILLES</DefineTextVal>


-- you can play with the values i gave for the new iValue changes, i based them on the population extra points.
it can be a static value as well.

---
in the Cvplayer.cpp, under the function of
getCivicAnarchyLength
pastethe bulk:

Spoiler :

Code:
//doto 113 -> loose capital anarchy start by <Nexus>
int CvPlayer::getCapitalLossAnarchyLength() const // advc.132
{
    int const iMaxAnarchyTurns = getMaxAnarchyTurns(); // advc
    if (iMaxAnarchyTurns == 0)
        return 0;
    //if (/* <advc.132> */ !bIgnoreGoldenAge && /* </advc.132> */ isGoldenAge())
   //     return 0;

    int iAnarchyLength = 0;
 
    static int const iBASE_LOSS_CAPITAL_ANARCHY_LENGTH = GC.getDefineINT("BASE_LOSS_CAPITAL_ANARCHY_LENGTH"); // advc.opt
    iAnarchyLength += iBASE_LOSS_CAPITAL_ANARCHY_LENGTH;
    iAnarchyLength += ((getNumCities() * GC.getInfo(GC.getMap().
                            getWorldSize()).getNumCitiesAnarchyPercent()) / 100);

    iAnarchyLength = ((iAnarchyLength * std::max(0, getAnarchyModifier() + 100)) / 100);

    if (iAnarchyLength == 0)
        return 0;

    iAnarchyLength *= GC.getInfo(GC.getGame().getGameSpeedType()).getAnarchyPercent();
    iAnarchyLength /= 100;

    iAnarchyLength *= GC.getInfo(GC.getGame().getStartEra()).getAnarchyPercent();
    iAnarchyLength /= 100;

    return range(iAnarchyLength, 1, iMaxAnarchyTurns);
}
//doto 113 -> loose capital anarchy end by <Nexus>

-- you can play with the numders (its always gotta be integers, not floats.

in the CvPlayer.h under the function of getCivicAnarchyLength
place this small bulk:
Spoiler :

Code:
//doto 113 -> loose capital anarchy start
    int getCapitalLossAnarchyLength() const;                                                                               // Exposed to Python
                 
//doto 113 -> loose capital anarchy end


under the function void CvCity::kill( in cvCity
place this line
Spoiler :

Code:
           //doto 113 -> loose capital anarchy start by <Nexus>
       
            int const iAnarchyLength = kOwner.getCapitalLossAnarchyLength();
            if (iAnarchyLength > 0)
            {
               kOwner.changeAnarchyTurns(iAnarchyLength);
            }
            //doto 113 -> loose capital anarchy end by <Nexus>

after this check:
Code:
if (bCapital)
{
     kOwner.findNewCapital();
  .....
on the end of the statement of the if check,
after the text of the switched capital takes place
cause you need the anarchy to fire if its a capital and after all the stuff that changed the capital finishes.

in the globaldefines or the altglobaldefines xml add this:
[spoiler
Code:
<!-- doto 113 -> loose capital anarchy start by <Nexus> -->    
    </Define>
    <Define>
        <DefineName>BASE_LOSS_CAPITAL_ANARCHY_LENGTH</DefineName>
        <iDefineIntVal>1</iDefineIntVal>
[/spoiler]

I have not tested it, just compiled.
i think it should run as in tended cause its not a big deal.
enjoy :)
 
Last edited:
the was the code works,
is that it gives scores to every potential city.
what i did , checks if any of the forbidden or versalis exists, if so it will add points to that city.
so, it will give the city that has it a higher value.
you can see in the lines that there are scores for wonders and nationals.

you can tweak what i did to you preferences,
lets say, give a score of 100 to forbidden palace and 50 to versalise.
of change the if statement to having both.
you can do anything that comes to mind.
 
anymore interesting ideas? :)
You really didn't think that through :lol:

Can you do this:
When entering a new era can we play a video instead of a static image? Even better if it's art style dependant.
 
Huh well,
More gameplay stuff i mean.

As for movies/art, i have gone down that lane in terms of modding.
I always preferred in focusing on gameplay rather then art overloading(aside from unit models).
The goal is to keep the mod size small.

So thats something that aside from me not being familiar with, is less attractive...

If you got gameplay additions and such ,id love yo hear.
 
I expected such an answer 😅
Well... there's and other one...

I don't know about your mod but I think Cottages are not enough tempting to build:
You build Farms to grow the city, which also results in more :commerce:
B
You build Mines and Workshops for more :hammers: which you can convert directly to :commerce:
S
But why do you need Cottages, that generate only :commerce: ?

So I have some ideas to spice up Cottages:
1) Cottages should generate not only yields but :gp: too. This would require a new XML tag.
2) Cottages could mean additional population for the city by giving a fraction of free specialists in the city. Something like this: Cottage gives +1/5 specialist, Hamlet gives +1/4, Village +1/3 and Town +1/2. So if around the city you have 3 Cottages, 1 Hamlets and 2 Villages: (3/5) +(1/4)+(2/3)=1.51. That is 1 free specialist in the city. But when all six of the upgrades to Town, it means 6/2=3, that is 3 free specialist in the city. Of course, it would require a new XML tag too.

I have some other ideas too, these 2 are the most useful IMO.
 
hey,
well, i had thought about improvements, buildings on the tiles.
yield of GP you say, interesting.
i have implemented an exact system as you described for my civics, early game, there is no influence, so i gave all the upkeep levels, 0.2, 0.4 0.6 etc...
then i added them up for an added upkeep instead of whole numbers , which is too high for upkeep .

so anyway, the system that you said can work nicely,
but, GP, i think is a bit overpowered no?
maybe some other yield?
 
hey bro,
i found some sleeper bugs in my ranged attack, so im fixing.

--
you think there is too little gp gen?
i always thought there is too much...

how about a new counter?
or maybe provide a % for faster city growth - it can be rebalance by reducing city growth in base growth.

or it can give out culture?

we can do gp i guess, but to me it was always too high.
huh, here is an idea, a cap for city gp count with cottages to make it higher?

--
Closing in on 500 downloads soon :)
 
Last edited:
Back
Top Bottom