How much food do I need to produce a new population?

Field of Glory: Empires is a grand strategy game in which you will have to move in an intricate and living tapestry of nations and tribes, each one with their distinctive culture.
Set in Europe and in the Mediterranean Area during the Classical Age, experience what truly means to manage an Empire.

Moderator: Pocus

Post Reply
duirixuanyan
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 56
Joined: Mon Aug 05, 2019 3:11 pm

How much food do I need to produce a new population?

Post by duirixuanyan » Sun Jul 12, 2020 1:33 am

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.

Surt
Staff Sergeant - Kavallerie
Staff Sergeant - Kavallerie
Posts: 305
Joined: Thu May 21, 2020 9:50 pm

Re: How much food do I need to produce a new population?

Post by Surt » Sun Jul 12, 2020 9:38 am

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)

Gray Fox
Sergeant Major - Armoured Train
Sergeant Major - Armoured Train
Posts: 558
Joined: Tue Dec 04, 2018 12:02 am

Re: How much food do I need to produce a new population?

Post by Gray Fox » Sun Jul 12, 2020 4:35 pm

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

Swuul
Staff Sergeant - StuG IIIF
Staff Sergeant - StuG IIIF
Posts: 290
Joined: Wed Mar 15, 2017 5:44 pm

Re: How much food do I need to produce a new population?

Post by Swuul » Sun Jul 12, 2020 6:07 pm

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.

Surt
Staff Sergeant - Kavallerie
Staff Sergeant - Kavallerie
Posts: 305
Joined: Thu May 21, 2020 9:50 pm

Re: How much food do I need to produce a new population?

Post by Surt » Sun Jul 12, 2020 8:23 pm

Arsinoe and Syrtica are same terrain, both coastal, Arsinoe is the regional capital though.

Pocus
Ageod
Ageod
Posts: 2654
Joined: Tue Oct 02, 2012 3:05 pm

Re: How much food do I need to produce a new population?

Post by Pocus » Mon Jul 13, 2020 9:35 am

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 Empires, ACW2, WON, EAW, PON, AJE, RUS, ROP, WIA.

duirixuanyan
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 56
Joined: Mon Aug 05, 2019 3:11 pm

Re: How much food do I need to produce a new population?

Post by duirixuanyan » Tue Jul 14, 2020 10:37 am

Pocus wrote:
Mon Jul 13, 2020 9:35 am
starting population fixes the soft-limit of population growth. Past this soft limit, you get extra cost penalties to grow pop
What is the the soft-limit if the starting population is 1?

n0b0dy007
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 34
Joined: Sat Dec 07, 2019 3:52 pm

Re: How much food do I need to produce a new population?

Post by n0b0dy007 » Tue Jul 14, 2020 9:24 pm

It's in Region.bsf/Region_Population_FoodNeedNextGrowth().
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);
plus some other factors.

duirixuanyan
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 56
Joined: Mon Aug 05, 2019 3:11 pm

Re: How much food do I need to produce a new population?

Post by duirixuanyan » Wed Jul 15, 2020 10:36 am

Thanks a lot.

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

n0b0dy007
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 34
Joined: Sat Dec 07, 2019 3:52 pm

Re: How much food do I need to produce a new population?

Post by n0b0dy007 » Wed Jul 15, 2020 1:16 pm

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
These are constants defined in MapGlobals.bsf. A few have some commentary hints:

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
duirixuanyan wrote:
Wed Jul 15, 2020 10:36 am
I don't understand this part. Could you explain it?
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.

Surt
Staff Sergeant - Kavallerie
Staff Sergeant - Kavallerie
Posts: 305
Joined: Thu May 21, 2020 9:50 pm

Re: How much food do I need to produce a new population?

Post by Surt » Wed Jul 15, 2020 5:58 pm

Nice, so most of the game is in the .bsf files!!!

n0b0dy007
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 34
Joined: Sat Dec 07, 2019 3:52 pm

Re: How much food do I need to produce a new population?

Post by n0b0dy007 » Wed Jul 15, 2020 7:45 pm

Surt wrote:
Wed Jul 15, 2020 5:58 pm
Nice, so most of the game is in the .bsf files!!!
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 :roll: ) the AUTODOCS files are re-generated every time the launcher starts the game.

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 7 times

Pocus
Ageod
Ageod
Posts: 2654
Joined: Tue Oct 02, 2012 3:05 pm

Re: How much food do I need to produce a new population?

Post by Pocus » Fri Jul 17, 2020 2:45 pm

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
AGEOD Team - Makers of Empires, ACW2, WON, EAW, PON, AJE, RUS, ROP, WIA.

Post Reply

Return to “Field of Glory: Empires”