My personal thread: Clarification of certain game mechanics

I'd still rather have the exact formula, but I think I'll try your suggestion tomorrow.
Been a whille since is was asked, but if your still interested I finally found it while looking for something else, the value per pop is in the global defines, which i'm kicking myself for not realising earlier
<DefineName>CONSCRIPT_POPULATION_PER_COST</DefineName>
<iDefineIntVal>60</iDefineIntVal>
The equation then, from CvCity.cpp;
return std::max(1, ((GC.getUnitInfo(eConscriptUnit).getProductionCost()) / GC.getDefineINT("CONSCRIPT_POPULATION_PER_COST")));
Its just the units cost on standard speed / 60 then rounded down, so Rifles are right below the boundary of 120 for 2 pop drafting :p
For once the rounding down fetish worked in the players favour.

Another note in the code suggests that drafting was planned to allow players to choose the unit they conscript!
Spoiler :
// Allow the player to determine the conscripted unit type
CyArgsList argsList;
argsList.add(getOwnerINLINE()); // pass in player
lConscriptUnit = -1;
gDLL->getPythonIFace()->callFunction(PYGameModule, "getConscriptUnitType", argsList.makeFunctionArgs(),&lConscriptUnit);

if (lConscriptUnit != -1)
{
eBestUnit = ((UnitTypes)lConscriptUnit);
}
return eBestUnit;
I don't really understand whether this (red line), and what follows, is just a note, or if it would really call up an interface panel to let the player pick what gets drafted. And if it is legit, whether it was disabled intentionally or by accident.....


EDIT - Also, finally got round to fixing how much gold is the AI willing to trade?
 
Been a whille since is was asked, but if your still interested I finally found it while looking for something else, the value per pop is in the global defines, which i'm kicking myself for not realising earlier

Thanks, but I already got an answer in the Quick Modding Questions Thread.

Another note in the code suggests that drafting was planned to allow players to choose the unit they conscript!
I don't really understand whether this (red line), and what follows, is just a note, or if it would really call up an interface panel to let the player pick what gets drafted.

This however is new to me, and fascinating.
 
PERMANENT ALLIANCES

Permanent Alliance allows to fuse two teams (per definition one player is viewed as a team of one element) into one. That triggers a new frame on how is dealt the new allied team. Putting that aside, here is discussed how to get a Permanent Alliance.

First, it's not a default option. It is needed to be checked in custom games.
Second, permanent alliances are enabled with either Communism tech or Fascism.
Third, there are several conditions to satisfy so the AI complies in a fusion.

1) You shouldn't be worst enemy.
2) The addtion of your power (including vassals) with potential allied (along his/her vassals) shouldn't be more than the half of world power (sum of every AI power). Power is determined by this chart here. This is implemented to avoid top dogs to fuse. Permanent Alliances were implemented for weak nations to team up against the strongs.
The AI willl either respond as denial that you are too powerful or (s)he's too powerful.
3)At last, the bonding process. You need to show your loyalty by satisfying this following equation:
AI_getDefensivePactCounter(eTeam) + AI_getShareWarCounter(eTeam)) < 40
Once 40 turns reached. It's enabled.

4) The very last check is the attitude of the AI. Normally, the AI needs to like you. Almost all AI's demand at least FRIENDLY stance for allowing Permanent Alliances. There are four exceptions: De Gaulle, Pericles, Peter and Ragnar. They only need PLEASED stance.

So, if those four conditions were verified, the Permanent Alliance option in diplo table is not longer red.
 
Tachywaxon said:
EDITED: I haven't been able to find the SDK dealing with exact mechanics of war success definitions, but a quick testing showed the cargo of a ship drowning is NOT counted towards war success. I think that is good implementation if that was intended as it avoids possible AI abuses.
From the OP, may I ask how exactly you tested this Tachy? Is there a way to see ingame calculated numbers (via debug mode perhaps)? Or did you kill off a tonne of ships to see how it experienced WW?
 
From the OP, may I ask how exactly you tested this Tachy? Is there a way to see ingame calculated numbers (via debug mode perhaps)? Or did you kill off a tonne of ships to see how it experienced WW?

Yes, tests demonstrated this and later, the code regarding fate of units in sunken ships is shown in CvPlayer.cpp where the units are simply using the function "kill()", without any impact on war success. And WW, btw, is war weariness. Something different.

So, is the AI resources evaluation came to an end? :)
 
Yes, tests demonstrated this and later, the code regarding fate of units in sunken ships is shown in CvPlayer.cpp where the units are simply using the function "kill()", without any impact on war success. And WW, btw, is war weariness. Something different.

So, is the AI resources evaluation came to an end? :)
I see. I was hoping you had some way of seeing the numbers from the code while ingame, wishful thinking I suppose :lol:.

I don't know why I put WW rather than WS....

Not entirely, I haven't had much time of late to do anything with that thread beyond editing in corrections due to workload, illness and other problems. I still haven't fully got the hang of the work you posted on it yet, though I could probably add the parent functions, which were quite easy IIRC.
 
I see. I was hoping you had some way of seeing the numbers from the code while ingame, wishful thinking I suppose :lol:.

I don't know why I put WW rather than WS....

Not entirely, I haven't had much time of late to do anything with that thread beyond editing in corrections due to workload, illness and other problems. I still haven't fully got the hang of the work you posted on it yet, though I could probably add the parent functions, which were quite easy IIRC.

I know that DanF5771 (many mod designers have done the same and much more if one looks into Kmod for example) has recompiled the code with his own debugging functionality, so if one wants to go to this length it is definitely possible. The debug console itself can provide some information that is not normally viewable in-game.

The source code is far more useful when one can actually change it (recompile it) to suite one's needs.

Sun Tzu Wu
 
I know that DanF5771 (many mod designers have done the same and much more if one looks into Kmod for example) has recompiled the code with his own debugging functionality, so if one wants to go to this length it is definitely possible. The debug console itself can provide some information that is not normally viewable in-game.

The source code is far more useful when one can actually change it (recompile it) to suite one's needs.

Sun Tzu Wu
This thought did cross my mind as i've seen the "blue circles" for all civs in the WB of one mod, but unfortunately my modding knowledge extends no further than the xml.

Annoyingly, i've never been able to get the debug console for vanilla BTS to appear.
I know how to get cheat mode active and how to use parts of it, but the ~ key does nothing (this is a shift # on my keyboard if it matters), which is a shame because although i don't think it would do what I want, I suspect it would be the best candidate for modding to do so (if I did attempt it!).
 
How is this possible:



Save attached. This is 1 of at least 2 games, where my Settler started on the Gold.
 

Attachments

  • Per_Dei_Sma_Inl_Epi_Anc_4000-BC_Ari_Low_Jan-29-2014_08-59-25_3298_674.CivBeyondSwordSave
    21.8 KB · Views: 63
It's possible on inland sea mapscript. There is a bug where a resource can spawn under the settler occasionally. It happened to me with gems and once it happened to AI hatty with her sole food resource being rice.
 
Thx Tachy .

Your explanation seriously does make more sense than mine, and no, I won't tell what I thought, because Insanity really is no fun.

May your thread be healthier from now on again.

All the best.
 
I have a question about animal to barb transition. Do animals actually turn into barb warriors/archers/spears, or is it all random? Do the animals simply die and at some point barbs pop up?

The reason I ask is that I noticed in the last game I played that where I had noted bears were located, soon later archers showed up, and at some places I had put down notes for lions, warriors showed up. So, do 3:strength: animals turn into archers, while 2:strength: animals turn into warriors?

Another question: When do barb archers turn into longbows? Is it based on them self-researching it, or some other way?

I was very surprised once, because I could visually see archesr in an island city, but upon landing units to attack it, they instantly turned into longbows.
 
I have a question about animal to barb transition. Do animals actually turn into barb warriors/archers/spears, or is it all random? Do the animals simply die and at some point barbs pop up?

The reason I ask is that I noticed in the last game I played that where I had noted bears were located, soon later archers showed up, and at some places I had put down notes for lions, warriors showed up. So, do 3:strength: animals turn into archers, while 2:strength: animals turn into warriors?

Another question: When do barb archers turn into longbows? Is it based on them self-researching it, or some other way?

I was very surprised once, because I could visually see archesr in an island city, but upon landing units to attack it, they instantly turned into longbows.

First, animals start to pop at T5. For every speed.

Now, regarding barbarian behaviour transistions, it is intimately related to the ratio NumberOfCivilizedCities/NumberOfPlayers, excluding barbs and including the human player(s).
In fact, there are two parameters: a threshold of how early it can start spawning and the ratio previously mentioned. The threshold was implemented particularly for scenarios where pre-settling a lot of cities would lead to barbarian invasions too early....

Ignoring the min turns threshold (which depends of game difficulty), the city/player ratio is when the number of all cities is 50% more the number of players, normal barbarian units start to spawn and each turn, one animal is killed. The type of barbarian units depend of the techs possessed by the Barbarian team. That is why for IMM+ for Nobles' Clubs, you need to add Archery to have archers spawning both in open lands and in barb cities.

There is no relation between animals and human barbs.
Also, there is a capacity threshold of barbarian units per landmass.
And size threshold of landmass, meaning some small islands will never let barbs to spawn.

Longbows are something from barb cities; normal archers upgraded into longbows. It happens depending of the global tech advancements. The earlier most teams get Feudalism, the better are the trickle down modifiers for that tech for the barb teams. Also, the barb teams mustn't constantly wiggle in techs and get pretty straightfowards to Feudalism to avoid delay. It upgraded pretty fast because for two reasons:
1) You put that city into danger
2) Upgrade cost are halved for every AI teams, including barb team.
3) Barb workers tend to mass improve cottages.

Note the maintenace inner working of the barbarian team is different form the civilized teams: it is not centralized by the lack of a palace and thus has the other form of maintenance, which is quite costly. Thus the tech rate is pretty low. STRIKE doesn't work on the barbarian team IIRC.

Any other more precise question?
 
Thanks. So it was just a coincidence then, and bears don't actually turn into barb archers?

Could you explain that ratio thing better?

Barb units start to spawn when the number of cities per player(?) is 50% higher than amount of players? So with standard settings with 7 players (6 AI, 1 player), there must be 11 cities before barbs start spawning. When can they start attacking cities?

I seem to recall Tachy saying it was when there were about 2 cities per player.
 
Tachy?
Oh well.

If you want the complete list of thresholds:

  1. If the #Cities less than #Players: Animals won't spawn yet. (Reason why moving a settler for over 5 turns happen to not trigger animals below deity, especially on a Oasis mapscript in an attempt to settle on the northern strip of land...)
  2. If the #Cities is at least 50% the #Players, then human barbarian units will start to spawn at the expense of one animal unit per turn...provided AFTER the min turns threshold and a non-OCC game.
  3. If the #Cities is at least the double of the #Players, then barbarian cities will start to spawn, provided it's AFTER the min turns threshold.
  4. If the #Cities is at least 3 times the #Players, barbarian invasions will start, provided it's not Raging Barb option.

That is all about barbarian behaviours.
The map size, number of players, gamespeed plus non mentioned variables above are irrelevant except for min turns threshold. To know those thresholds (although normally useless for typical games) can be found somewhere about AI handicaps spreadsheets.

It was just coincidence. The bear died and a barb archer spawned near soon after.

Barb units start to spawn when the number of cities per player(?) is 50% higher than amount of players? So with standard settings with 7 players (6 AI, 1 player), there must be 11 cities before barbs start spawning. When can they start attacking cities?

Not exactly because of truncating effects when divisions are included in formulae.
To be more precise, the formula goes by multipliying the #Players by 3, then dividing by 2 and finally truncates the value to the lower integer. Thus, it's 10.5 ==> 10. Then it compares to #Cities (non barbs). If the #Cities is less than 10, no human barbs. Still animal era. If equal to 10 cities, animals start to die individually and human barbs start to spawn.
 
Forgot to reply to this thread, but thanks a lot for the information. Brief and precise :)

[*]If the #Cities less than #Players: Animals won't spawn yet. (Reason why moving a settler for over 5 turns happen to not trigger animals below deity, especially on a Oasis mapscript in an attempt to settle on the northern strip of land...)

I'm looking at this excellent overview, but can't see a threshold about animal barb creation. Does this mean barb animals can in theory pop up on turn 1 (if the player settles on turn 0)? I seem to recall something about turn 10, but perhaps I'm just imagining that, or mixing it up with human barbs on Deity.

[*]If the #Cities is at least 50% the #Players, then human barbarian units will start to spawn at the expense of one animal unit per turn...provided AFTER the min turns threshold and a non-OCC game.

Thanks for the added info in the above post as well. There seems to be rounding errors all over the place in this game, sometimes working in our favour, and sometimes not, as in this case. On a normal map with 7 players, that means, as you say, that animals start turning to barbs when 10 cities have been founded, provided it's after the limit (turn 15 on Immortal, which I play, or turn 10 on Deity).

[*]If the #Cities is at least the double of the #Players, then barbarian cities will start to spawn, provided it's AFTER the min turns threshold.

So on a normal map then this would require 14 cities AND being after turn 20 on Immortal (15 on Deity).

[*]If the #Cities is at least 3 times the #Players, barbarian invasions will start, provided it's not Raging Barb option.

This is the one I was most unsure about really. It can be nerve-wrecking to see a barb close to your 2nd or 3rd city location, and then be unsure about when the b*stards will start invading. But now I can do the city count, and know that there must be 21 cities founded on a normal start. Of course we can't always know that number, because you typically don't meet all AIs that early.

I've learnt one thing from experience though. If you happen to found a city with a barb unit within the inner square (ie, sitting right next to your settler), he will NOT be bumped out of the city borders, as happens with animals, and you're extremely likely to lose the city, unless there is already a defending archer there, or you are lucky with the defending warrior.
 
I have another query though, and figured it was better to post it here than in the General Forum, as the city gifting thread didn't get a lot of love.

What are the requirements for getting an AI to convert religion? Sometimes I see "Too few of our people follow that faith", so I assume one city having it isn't enough. What are the thresholds?
 
Top Bottom