ORIGINAL: paulderynck
I would surmise the limits on number of partisans per country were put in place as antidote to the possibility that huge numbers would appear in outlier situations, given an infinite supply of them.
Yes.
In brief, the country has to qualify for getting partisans. Next a die is rolled and compared to the partisan number for the country (from the data file) to see if partisans might appear. Should the fist die roll succeed, a second die is rolled to see how many partisans might appear. Then there has to be room for the partisans to be placed on the map. The number of partisans appearing in a turn is also limited to 3 maximum. Garrisons are also a factor in these calculations.
Here are in-line comments from the code:
============
// ****************************************************************************
// To get partisans, a country must be at least a subcountry.
// ****************************************************************************
// ****************************************************************************
// Yugoslavia and Bulgaria do not get partisans in Barbarossa. Those countries
// are only there for rail movement from Germany to Rumania.
// ****************************************************************************
// ****************************************************************************
// PartisanMaxCount is used for counting the number of partisans for which there
// is room. It starts at 0 and is incremented by the number of open slots found
// on the map. It has a maximum of 3, since no more than 3 partisans can appear
// in a country during a turn.
// ****************************************************************************
// ****************************************************************************
// To get partisans, a country must be legal, have some chance of getting
// partisans, and have fewer than 3 partisans as MaxCount. The last restriction
// is dynamic, as described immediately above. Also dynamic is HasEnemyUnit.
// Both are built within these loops to check every hex on the map, and a hex
// can be skipped if both have been set for country SubC.
// ****************************************************************************
// ****************************************************************************
// Check SubC's political relationships to see if partisans are possible.
// ****************************************************************************
if ((not SubC.RedPartisans) and // Not red partisans,
SubC.Neutral and // neutral, and
(not WarC.Conquered)) or // not conquered.
(SubC.RedPartisans and // Red partisans, but
(SubC.ControllingMajorPower <> nil) and // controlling major
SubC.ControllingMajorPower.Neutral) then // power isn't active.
Continue;
// ****************************************************************************
// CP is the original owner of the hex allowing for China & the Ukraine.
// ****************************************************************************
if C = China then CP := China
else if C = Ukraine then CP := USSR // Just until Ukraine code written.
else if SubC = Siberia then CP := USSR
else CP := SubC.HomeCountry.ControllingPartisanCountry;
// ****************************************************************************
// Found a hex not controlled by player controlling the partisans.
// ****************************************************************************
// ****************************************************************************
// Count how many openings are available and compare it to the # of partisans to
// be created. If there are not enough openings, reduce the # of partisans to
// be created.
// ****************************************************************************
// ****************************************************************************
// Since we need another opening, try placing two partisans in the hex.
// ****************************************************************************
// ****************************************************************************
// PNumber is the Partisan Number. This is the number the die roll must exceed
// in order for partisans to appear in the country. This is directly from data
// file.
// ****************************************************************************
PNumber := SC.Partisans;
// ****************************************************************************
// Red partisan countries are never in their first year of partisans. If the
// SubCountry was controlled by a major power at the start of the war, then that
// major power's status for Neutral This Year is used. If a SubCountry belongs
// to another minor country (e.g., Dutch Guyana belongs to the Netherlands),
// then its parent minor country's status for Neutral This Year is used.
// ****************************************************************************
// ****************************************************************************
// Calculate the probabilities for 1, 2, and 3 partisans.
// ****************************************************************************