How much food do I need to produce a new population?
Moderator: Pocus
-
duirixuanyan
- Corporal - Strongpoint

- Posts: 56
- Joined: Mon Aug 05, 2019 3:11 pm
How much food do I need to produce a new population?
It seems simple.
30
45
60
75
90
105
120
135
150
However, some regions say no.
225
263
255
301
351
202
I'm really confused.
30
45
60
75
90
105
120
135
150
However, some regions say no.
225
263
255
301
351
202
I'm really confused.
Re: How much food do I need to produce a new population?
Hmm, now you made me confused too!!!
Plain (heatwave)
Cyrenaica, pop 32, needs 1297 food, bonus 47% = 1150 discount (sum 2447)
Arid steppes:
Arsinoe, pop 28, needs 2839 food, bonus 33% = 1399 discount (sum 4238)
Syrtica, pop 28, needs 3204 food, bonus 58% = 4424 discount (sum 7628)
Plain (heatwave)
Cyrenaica, pop 32, needs 1297 food, bonus 47% = 1150 discount (sum 2447)
Arid steppes:
Arsinoe, pop 28, needs 2839 food, bonus 33% = 1399 discount (sum 4238)
Syrtica, pop 28, needs 3204 food, bonus 58% = 4424 discount (sum 7628)
There are 10 kind of hard problems in computer science, naming, cache invalidations and off-by-one errors.
There are also 10 kinds of people, those who understand binary and those who do not.
There are also 10 kinds of people, those who understand binary and those who do not.
Re: How much food do I need to produce a new population?
Is this a reflection of regions in a province pooling their food? Supposedly, all the regions must grow to size X before any one grows to X+1.
For new players: Grand Strategy AAR and Steam Guide: Tips for new players
Samstra's Trade guide: https://steamcommunity.com/sharedfiles/filedetails/?id=1805684085
Samstra's Trade guide: https://steamcommunity.com/sharedfiles/filedetails/?id=1805684085
Re: How much food do I need to produce a new population?
It depends on the terrain in the region and how many people you already have in the region. If you go above the hard-cap max for the region, it starts to become rather impossible to get more pop from surplus food. For example 2 POP in Plains vs 20 POP in Desert, the required food for extra pop is quite different 
There are three kinds of people, those who can count and those who can't.
Re: How much food do I need to produce a new population?
Arsinoe and Syrtica are same terrain, both coastal, Arsinoe is the regional capital though.
There are 10 kind of hard problems in computer science, naming, cache invalidations and off-by-one errors.
There are also 10 kinds of people, those who understand binary and those who do not.
There are also 10 kinds of people, those who understand binary and those who do not.
Re: How much food do I need to produce a new population?
starting population fixes the soft-limit of population growth. Past this soft limit, you get extra cost penalties to grow pop
AGEOD Team - Makers of Kingdoms, Empires, ACW2, WON, EAW, PON, AJE, RUS, ROP, WIA.
-
duirixuanyan
- Corporal - Strongpoint

- Posts: 56
- Joined: Mon Aug 05, 2019 3:11 pm
Re: How much food do I need to produce a new population?
It's in Region.bsf/Region_Population_FoodNeedNextGrowth().
Basically:
plus some other factors.
Basically:
Code: Select all
popCount = Region_Population_Count(regionID);
// The function is exponential but we are not using a power function, too nerdy to explain in the manual?
if (popCount >= 30)
{
coeff = (popCount - 13) * 4 // pop 30: x68 | pop 31: x72 | pop 32: x76
}
else if (popCount >= 20)
{
coeff = (popCount - 8) * 3 // pop 20: x36 | pop 21: x39 | pop 22: x42 |..| pop 29: x63
}
else if (popCount >= 10)
{
coeff = (popCount - 2) * 2 // pop 10: x16 | pop 11: x18 | pop 12: x20 |..| pop 19: x34
}
else
{
coeff = POP_NEED_FOOD_PERPOP; // 15
}
result = POP_BASE_NEED_FOOD + (coeff * popCount);
-
duirixuanyan
- Corporal - Strongpoint

- Posts: 56
- Joined: Mon Aug 05, 2019 3:11 pm
Re: How much food do I need to produce a new population?
Thanks a lot.
I don't understand this part. Could you explain it?
For example, popCount=53, result = POP_BASE_NEED_FOOD + (coeff * popCount)=8495.
result = DivideAndRound(result * coeff, 100)=72208, meaning coeff=8.5
I don't know what these numbers are.
POP_FOOD_POPULOUS_MINVAL,POP_FOOD_POPULOUS_RATIOh,POP_FOOD_POPULOUS_COEFF
Code: Select all
// If beyond x time the initial number of inhabitants, penalize heavily
count = GetNumPopulations(regionID) * 100 ;
count = DivideAndRound(count, Max(POP_FOOD_POPULOUS_MINVAL, Region_Population_GetInitialInhabitants(regionID)));
count -= POP_FOOD_POPULOUS_RATIOh;
coeff = 100;
while (count >= 0)
{
coeff += POP_FOOD_POPULOUS_COEFF;
count -= 100;
}
result = DivideAndRound(result * coeff, 100);
I don't understand this part. Could you explain it?
For example, popCount=53, result = POP_BASE_NEED_FOOD + (coeff * popCount)=8495.
result = DivideAndRound(result * coeff, 100)=72208, meaning coeff=8.5
I don't know what these numbers are.
POP_FOOD_POPULOUS_MINVAL,POP_FOOD_POPULOUS_RATIOh,POP_FOOD_POPULOUS_COEFF
Re: How much food do I need to produce a new population?
These are constants defined in MapGlobals.bsf. A few have some commentary hints:duirixuanyan wrote: ↑Wed Jul 15, 2020 10:36 am I don't know what these numbers are.
POP_FOOD_POPULOUS_MINVAL,POP_FOOD_POPULOUS_RATIOh,POP_FOOD_POPULOUS_COEFF
Code: Select all
// *** P_ ***
// __POPULATION
#define POP_REALNUMBERCOEFF 10000
#define POP_BASE_NEED_FOOD 15
#define POP_NEED_FOOD_PERPOP 15
#define POP_FOOD_USAGE_SLAVE 1
#define POP_FOOD_USAGE_OTHER 2
#define POP_HEALTH_MAX_BONUS 65 // no more than 65% discount in food need from health
#define POP_HEALTH_MAX_PENALTY -300 // no more than -300% penalty in food need from health
#define POP_KEEP_FOOD_PERC 15 // keep 15% of food on growth
#define POP_COEFF_GROWTH_WF 4 // slowdown coeff on pop growth for world faction (also used in infra bld)
#define POP_FOOD_POPULOUS_COEFF 50 // +50% food cost per pop ratio at populous and beyond
#define POP_FOOD_POPULOUS_RATIOh 300 // starting ratio where you get a penalty (in hundredth)
#define POP_FOOD_POPULOUS_MINVAL 3 // Min pop ever considered, preserve some back compatibility
I don't understand it, either, as the software's design description is not available. It's apparently an implementation of some game rule's logic.
Philippe, as the code's author, can probably explain his intent.
Re: How much food do I need to produce a new population?
Nice, so most of the game is in the .bsf files!!!
There are 10 kind of hard problems in computer science, naming, cache invalidations and off-by-one errors.
There are also 10 kinds of people, those who understand binary and those who do not.
There are also 10 kinds of people, those who understand binary and those who do not.
Re: How much food do I need to produce a new population?
Pretty much. The rules/logic and UI code, anyway. The data live in the DATA directory's .csv files (generated from the .xlsx spreadsheets, per: viewtopic.php?f=562&t=99539).
The BSF files are text files containing CScript code, which is Slitherine's C-like dialect for their Archon engine (see: viewtopic.php?f=562&t=93020 and http://archonwiki.slitherine.com/index. ... es_Modding).
The Archon engine is 32-bit and single-threaded, so set expectations accordingly.
It also appears that the contents of Data/ATTRIBUTES.TXT (crucially, the main data structures and their attributes) serve as input to a process that generates the API found in AUTODOCS/BATTLESCRIPT.TXT, which serves as the foundational API between the game and the underlying Archon engine. The game's scripts apparently are run through the AUTODOCS/BATTLESCRIPT.BIN interpreter layer.
For some reason (probably a Development setting left on for the Release build
The attached .zip file contains ARCHON.XML, a file that teaches Notepad++ (https://notepad-plus-plus.org/) about the CScript syntax (the semantics definition, alas, remains elusive).
Although, just setting Language to C works well enough.
- Attachments
-
ARCHON.XML.zip- (3.91 KiB) Downloaded 83 times
Re: How much food do I need to produce a new population?
The idea is that past a certain initial value (thrice the initial population count (A) or 3 (B), whichever is the max), you get an increase of +50% to the found need (C)
(A) #define POP_FOOD_POPULOUS_RATIOh 300 // starting ratio where you get a penalty (in hundredth)
(B) #define POP_FOOD_POPULOUS_MINVAL 3 // Min pop ever considered, preserve some back compatibility
(C) #define POP_FOOD_POPULOUS_COEFF 50 // +50% food cost per pop ratio at populous and beyond
(A) #define POP_FOOD_POPULOUS_RATIOh 300 // starting ratio where you get a penalty (in hundredth)
(B) #define POP_FOOD_POPULOUS_MINVAL 3 // Min pop ever considered, preserve some back compatibility
(C) #define POP_FOOD_POPULOUS_COEFF 50 // +50% food cost per pop ratio at populous and beyond
AGEOD Team - Makers of Kingdoms, Empires, ACW2, WON, EAW, PON, AJE, RUS, ROP, WIA.




