Faction:Portugal
Status: minor, not playable
Regions: portugal, curacao.
Capitol: Lisbon
Government: Absolute monarchy
startpos.esf/
CAMPAIGN_STARTPOS/
CAMPAIGN_PREOPEN_MAP_INFO:
The first data about Portugal are met in CAMPAIGN_PLAYERS_SETUP/PLAYERS_ARRAY/PLAYERS_ARRAY/:
Here are the factions with the relations to the player. In the table above there is a list with all the players_array and their position in the list:
The 27th record that belongs to portugal:
CAMPAIGN_PREOPEN_MAP_INFO/CAMPAIGN_PLAYERS_SETUP:
The second false value tells if portugal is playble (True) or non (False). There are other fields need to be changed for activating a non playable factions in next records.
CAMPAIGN_PLAYERS_SETUP/CAMPAIGN_VICTORY_CONDITIONS:
These values are the same for all factions in PLAYERS_ARRΑY (factions) as those in CAMPAIGN_PLAYERS_SETUP_MODIFIABLES.
CAMPAIGN_PREOPEN_MAP_INFO/VICTORY_CONDITION_OPTIONS:
There is a list of the faction is in a different order. Portugal's VICTORY_CONDITION_OPTIONS:
VICTORY_CONDITION_OPTIONS of Portugal is divided by 4 VICTORY_CONDITION_BLOCK which include the preconditions for victory in every campaign scenario.
The CAMPAIGN_VICTORY_CONDITION of the first VICTORY_CONDITION_BLOCK is for campaign mod 0 (short), which ends in 1750 and the player must own 10 provinces:
Among them must be the regions that included in the the REGION_KEYS under VICTORY_CONDITION_BLOCK:
The rest three blocks has the preconditions for the campaign mod 1-long, 2-prestige, 3 - world domination.
CAMPAIGN_PREOPEN_MAP_INFO/FACTION_INFOS:
Here are the factions in the same order as in PLAYERS_ARRAY with basic informations.
Portugal is the 27th record with infos about portrait, description and the region that the faction owns. The entries in 3rd and 4th line are True/True for playable faction, False/False for unplayable and True/False in Mughal and US.
CAMPAIGN_PREOPEN_MAP_INFO/REGION_OWNERS_BY_THEATRE:
All the regions with the owner faction are grouped in the 3 theatres, europe, america, india.
Above the REGION_OWNERSHIPS malaba-portugal in indian theatre.
startpos.esf/
CAMPAIGN_STARTPOS/CAMPAIGN_ENV:
CAMPAIGN_ENV/CAMPAIGN_SETUP includes the same records as startpos.esf/CAMPAIGN_STARTPOS/CAMPAIGN_PREOPEN_MAP_INFO/CAMPAIGN_PLAYERS_SETUP:
CAMPAIGN_SETUP/CAMPAIGN_SETUP_OPTIONS:
Unknown entries with 6th and 7th lines matching with 7th and 8th entry of next table.
CAMPAIGN_ENV/CAMPAIGN_MODEL:
CAMPAIGN_MODEL/
CAMPAIGN_MAP_DATA:
CAMPAIGN_MODEL/WORLD/
Here is one of the most interesting fields of startpos.esf -and area of many modifications-. where detailed settings and unique ID's are given to game elements.
WORLD/FACTION_ARRAY:
In FACTION_ARRAY/FACTION we can see informations about Portugal. Some interesting are in line:
1st faction's ID.
6th False for minor, True for major.
8th, 10th True playable, False non. If True is placed here for a minor faction, even it is playable by modding, the game crashes.
11th , 12th Capitol region ID. Regions ID's are in a later record of WORLD.
13th Demis14 connects True/False with emergent/non emergent.
17th , 18th Usually is 0. Some of the major factions have numbers like France 4960/2150, Ottomans 3690/730, Austria 4570/0, etc.
19th The following strategy during the game. All the minor nations have MAINTANANCE and majors FULL.
20th Is something like special ability. Portugal's is maritime_repressive. The minors have usually default. Some of them like Morocco have no_europe but most of non europe factions have default. The values of the major factions are variable. Brtain maritime_progressive, France mixed_progressive, Austria continental_progressive, Netherlands trader, Spain maritime_repressive, etc. There are also major with default like Sweden and no_europe like Ottomans or Maratha.
23th - 26th All values are 0 for minor factions. Major have numbers (like 8, 10, 15, etc.).
FACTION/ANCILLARY_UNIQUENESS_MONITOR:
As in all minor factions, ENTRIES in Portugal are empty. In the above image is Britain with two ENTRIES: Ancillary_Government_Comptroller and Ancillary_Army_Merc_Artilleryman.
FACTION/CAMPAIGN_PLAYERS_SETUP:
Same records as in CAMPAIGN_PREOPEN_MAP_INFO.
FACTION/FACTION_ECONOMICS:
Staring money of Portugal.
FACTION/DIPLOMACY_MANAGER:
Here are the relations between Portugal and the other factions. Above in DIPLOMACY_RELATIONSHIP Portugal is neutral to faction with ID 351568752 which is new_spain.
For the relation between Portugal and New Spain there are 22 DIPLOMACY_RELATIONSHIPS_ATTITUDES_ARRAY. Most of them have 0 values in 1, 2, 3, and 5th line. If a number appears in one of 1, 2, 3, then False in 4th line turns to True. Same thing happens in 5th and 6th line.
MORE INFO: Lazy Knight
FACTION/GOVERNMENT:
ID an type of Portugal's government.
GOVERNMENT/POSTS_ARRAY/CHARACTER_POST:
In Portugal's GOVERNMENT there are 9 CHARACTER_POST's. 7 are for the ministers and 2 governors for Europe and India. In every record are noted the government post ID, the type, the character ID and the government ID of Portugal.
GOVERNMENT/GOV_IMP
Probably when the first revolution is occurred. Above, after 10 turns or years (?) a CONSTITUTIONAL_MONARCHY will be attempted (?).
FACTION/FAMILY:
In FAMILY are included the Monarch and his successors. The 5t line maybe is the turns or years that he will be replaced by his successor. CAMPAIN_LOCALISATION and PORTRAIT_DETAILS link to descriptions and details (loc files). The records of successors have 0/False values.
Every MONARCH_INFO_CHARACTER seems to have a NAME_ALLOCATION_DETAILS record. One of them has in 1stline 0 (the others have numbers) and in second the number 4245029912. These type of 10 digit numbers are met also in the other records.
Comment:
We have also meet CAMPAIGN_MODEL with 10 digit number and CAMPAIGN_MODEL/RandSeed with 11th digit number.
FACTION/CHARACTER_ARRAY/CHARACTER:
In this CHARACTER table of a Portugal minister there are in line:
1st Character ID
2nd Type of character. Except ministers here are the generals, admirals, captains, gentlemen and rakes.
7th The government post ID for this minister. It is GOVERNMENT/POSTS_ARRAY/CHARACTER_POST ID for finance we've met already. So this character is the minister of treasury.
14th Number 10 is met on land CHARACTERS and 15 on sea CHR's (admirals, etc.)
CHARACTER_ARRAY/CHARACTER/LOCOMOTABLE:
1st and 2nd line are the location of finance minister. These are the basic coordination's of Lisbon settlement (we'll meet the entries later), where the government is settled. The coordinates varies from character to character depending on his location on campaign map.
Comment:
I've noticed many remaining entries like settlements coordination's, which are connected with several records, in attempts of changing region ownership.
FACTION/ARMY_ARRAY:
Here are registered the armies and navies of Portugal. Every army has it's ID, settlement ID (if it is inside settlement as in Lisbon). In MILITARY_FORCE the character leader's ID (general or captain) and in UNITS_ARRAY the units that this army has in the beginning of the game.
WORLD/REGION_MANAGER
Thanks to Gerlandric
here is an update list after 1.4 patch.
This is the REGION portugal and in line:
1 Region name.
2 Region ID
6-11 Demis14 connects these numbers with economic figures like starting wealth of productive facilities.
17 Controlling faction ID
18 Governorship ID
19 Theatre
20 Emerging nation
21 Region rebels
22 Region group. Bournoutfigshas moded this line so New Orleans get europe civilian buildings around city and not native american's(sc_european_americans).
REGION/LINE_OF_SIGHT:
Most of the regions have that record just after SETTLEMENT. All the QAD_TREE_BIT_ARRAY_NODE sub-records have no values.
REGION/POPULATION:
These three numbers of population have nothing to do with the 3 classes. 1st and 3rd is very close to staring population.
In REGION_FACTORS 2nd line is the population number that you can see in the Lists of in game interface, regions tab, in Lisbon city. Maybe the fourth line is the population of all region.
REGION_FACTORS contains 3 population records for the 3 classes with the same values (0 most cases). RELIGION_BREAKTROUGH determines the religion of Portugal.
Above in rel_catholic table 2nd line is 1 and in all others religions 0.
REGION/REGION_SLOT_MANAGER
Here are placed all the building slots of buildings, towns, ports, farms and mines for region portugal. Minor cities have only 1 building (minor_government), major 4 or 5.
Above is the table of Lisbon's army building:
1 REGION_ SLOT ID for army building.
2 Type of slot, settlement lisbon:settlement_army-admin.
5, 6 The coordinates of its location in Lisbon settlement major city.
8 Type of civilian small buildings. Can be between 1-5 depending on the city growing. Here there are images of the 5 levels.
10, 11 Are connected with the type of slot as well as 7, 8.
12 The 10 digit number 4294967295 is shown in many occasions. Amazing coincidence (?) that is the same with highest value of turns per year in Just's tool.
REGION_ SLOT/SIEGABLE_GARRISON_RESIDENCE must have the REGION_ SLOT ID, and GARISSON_RESIDENCE the FACTION ID
REGION_ SLOT/BUILDING_MANAGER is True/False if the slot exists in the beginning and False/False if it is going to be spawned later in the campaign:
If the slot is occupied by a building (True/False) then the sub-record BUILDING appears with the specific type and level of slot.
Above the army building of Lisbon in army_encampment level.
REGION_SLOT_MANAGER/SETTLEMENT
This record has to do with the city of Lisbon:
First line's value must be the same with 8th line of city's building slots. In 2nd and 4th the status of settlement lisbon
and in 3rd the owner faction.
SETTLEMENT/ SIEGABLE_GARRISON_RESIDENCE table is almost the same as REGION_SLOTS,
plus the basic coordinates of the settlement in lines 10, 11 and the ARMY ID that is stationed there in the beginning of the game. The same coordinates were met in the CHARACTERS that are in city. Also this ARMY ID is connected with the ARMY and the it's leader records in FACTION/ARMY_ARRAY and FACTION/CHARACTER_ARRAY.
REGION_SLOT_MANAGER/REGION_RECRUITMENT_MANAGER:
Portugal owns a second region, Goa in India, which has it's own REGION records.
CAMPAIGN_MODEL/CAI_INTERFACE
CAI_INTERFACE/CAI_WORLD
All the CAI records are connected among them and with the rest startpos file. Here are gathered all the elements by type and not by region or by faction. CAI uses it's own ID's. Portugal has a FACTION ID (352193016) and a CAI_FACTION_ID (1341).
CAI_WORLD/CAI_WORLD_FACTIONS. The order is the usual by FACTION ID and Portugal is the 27th .
CAI_FACTION ID for Portugal can be found here in the 1st line of it's record. The record numbers are from 1263-1431. Not all the numbers between 1263-1431 are used. The unused numbers are not free but are used in other field of CAI. That's a rule in CAI records numbering.
CAI_WORLD_FACTIONS/CAI_FACTION:
6th and the last line is CAI_REGION ID where the capitol is, that means region portugal. These are 0 in emerged factions.
7th is FACTION ID of Portugal as is registered in WORLD/FACTION _ARRAY.
10th is CAI_TECHNOLOGY_TREE ID of Portugal.
CAI_WORLD/CAI_WORLD_REGIONS
CAI_WORLD_REGIONS records are numbered in the area between 52-1261. It's easy to find portugal CAI_REGION since it's ID (629) is registered in CAI_FACTIONS.
CAI_REGION ID of portugal in 1st line, CAI_WORLD_TRADING_POST in 11th.
CAI_WORLD_REGIONS/OWNED_INDIRECT
Here is registered the CAI_SETTLEMENT (Lisbon) ID.
CAI_WORLD_REGIONS/CAI_REGION
CAI_REGION records are numbered in the area between 1439-3588.
3rd line is CAI_SETTLEMENT (Lisbon) ID.
5th, 6th basic coordinates of Lisbon settlement and are the same with regions.esf/regions(portugal)/settlements_and_slots, 1st line.
11th the region name.
12th REGION ID.
13th CAI_COVERNRSHIP ID.
CAI_WORLD/CAI_WORLD_SETTLEMENTS
Theserecords are numbered in the area between 1439-3588.
As registered in CAI_REGION, CAI_WORLD_SETTLEMENT of portugal (Lisbon) is 1752.
In the following list of settlement you can find the CAI_SETTLEMENT ID's. Using this list is very useful especially for the settlements that are not capitol's.Due to changes in startpos.esf (1.3.0 build), the right ID is this the list plus 1.
In CAI_WORLD_SETTLEMENTS/OWNER_DIRECT there is CAI_FACTION ID of Portugal.
CAI_WORLD_SETTLEMENTS/CAI_SITUATED:
CAI neededs informations for the location of settlement Lisbon. The coordinates in 1sth and 2nd line are the basic coordinates of settlement Lisbon and are registered in portugal's region REGIONS_ARRAY/SETTLEMENT/SIEGABLE_GARRISON_RESIDENCE of WORLD/REGION_MANAGER/
In CAI_WORLD_SETTLEMENTS/CAI_GARRISONABLE first line there is CAI army ID which is our key to enter CAI armies later.
CAI_WORLD_SETTLEMENTS/CAI_SETTLEMENT:
CAI_FACTION ID and SETTLEMENT ID. Only settlements who are the same time capitols have in the second line the CAI_FACTION ID. For the rest, the value is 0.
CAI_WORLD/CAI_WORLD_BUILDING_SLOTS
CAI_WORLD_BUILDING_SLOTS records are numbered in the area between 1433-3591. The quicker way to find a CAI_BUILDING_SLOT record is using the CAI_SETTLEMENT ID that belongs to. The records with numbers close to it are the CAI_BULDING_SLOTS records. To find settlement Lisbon's I am looking the records around 1752 checking the CAI_WORLD_BUILDING_SLOTS/CAI_BUILDING_SLOTS of every record.
In the third line is the CAI_SETTLEMENT ID settlement Lisbon's: 1752. In the first the BUILDING_SLOT ID that has been registered in REGION_SLOT_MANAGER of WORLD/REGION_MANAGER/REGIONS_ARRAY (portugal). Above is the CAI record 1745 of the army-admin building slot of Lisbon city. The second line is 0 for city building slots and 1 for road and fortifications. In this way can be found the records 1745, 1746, 1747, 1748, 1749, 1750, 1751 that belongs to the 5 buildings of the city (in minor 1), and to city's road and fortifications.
The rest CAI building slots (towns, ports, farms, mines, etc.) are the first records after 1742nd : 1754, 1756, 1758, 1760, 1762, 1764, 1766. They belong to 1 port, 4 towns, 1 wineries and 1 sheep farm, that exist in portugal region. As in city's building slot, in the first line of CAI_BUILDING_SLOT record is the BUILDING_SLOT ID. In second changes depending on the type: towns 2, ports 3, sheep farms, wineries, 5. In the third line there is a link that leads not to the CAI_SETTLEMENT ID as in city's building slot, but to a specific record in CAI_RIGION_SLOTS.
CAI_WORLD/CAI_WORLD_REGION_SLOTS
CAI_WORLD_REGIONS_SLOTS records are numbered in the area between 1441-3591. These are the “alter ego” of the CAI_BUILDING_SLOTS that are non city building slots and provide CAI with additional need informations. Next image belongs to Porto's CAI_REGION_SLOT ID.
In OWNED_INDIRECT is CAI REGION ID
In CAI_SITUATED are the coordinates registered in building slot of REGIONS_ARRAY:
The second CAI_SITUATED record under CAI_REGION_SLOT appears only in ports. The coordinates are very close to those of it's place and maybe has to do with the position of ships recruitment. The number in 3rd line (170) is the CAI ID of the sea that is attached. Seas have their own CAI_REGION ID.
WORLD/CAI_WORLD_RESAURCE_MOBILES
This is the list of the armies in the beginning of the game. The easiest way to get here is with CAI army ID in CAI_WORLD_SETTLEMENTS/CAI_GARRISONABLE.
In the first 2 sub-records, informations can be found about the owner CAI_FACTION, the CAI_REGION ID the army is stationed and the coordinates of its place.
In CAI_BDI_COMPONENT_BLOCKS_OWNS are probably connected with the green area in campaign map of army response.
In CAI_RESOURSE_MOBILE there is the CAI_CHARACTER ID that this army is being assigned to. In the second line is CAI_SETTLEMENT ID and in 10th line the army ID that was registered in WORLD/FACTIONS_ARRAY/FACTION/ARMY_ARRAY.
The next records in the list are for the rest armies and fleets of Portugal. Armies and fleets are organised by the game in groups registered to a character (general, admiral, etc.). If there is not general then one of the units becomes colonel and a new character record is created in FACTION/CHARACTERS.
CAI_WORLD/CAI_WORLD_UNITS
Here are the units of the armies. Having in mind the numbering system that CAI uses, these ID's should be in the records closest to the number of CAI_ARMY ID.
In CAI_UNIT there is the CHARACTER ID in first line. This happens only to the units that belong to CHARACTERS, like body_guards to generals. The rest units of the army have in 1st line 0. The unit ID is registered in FACTION/ARMY_ARRAY. In 3rd line is the CAI_ARMY ID we saw previously.
CAI_WORLD/CAI_WORLD_CHARACTERS:
Here are the CAI records of all characters that are registered in FACTION/CHARACTERS with the ID of the 4th line. In first and third lines are the CAI_ARMY ID or 0 if is a civilian (minister, priest, etc.). Gentlemen and Rakes have also CAI_ARMY ID but they luck CAI_UNIT ID so in second line is 0. For military CHARACTERS here is the basic CAI_UNIT he belongs (e.g. body_guards).
CAI_WORLD/CAI_WORLD_FORTS:
Typical CAI record about forts with basic informations. CAI_FORT ID, coordination's of its place, CAI_REGION ID of the region it is settled and CAI_ARMY ID if one is stationed.