Due to a sudden burst in spammer activity, account creation has been temporarily disabled. Sorry for the inconvenience to any new potential contributors.
Regional Decisions
From AGEWiki
Contents |
Overview
Regional decisions or more simply Decisions are actions taken by the faction on the map. It expends the possibility of the engine, as before, only multi-choices events could have simulated, in a more restricted way (max 4 choices) that a faction wanted to act with a particular action, on a specific region.
Decisions must be understood as a means to interact with the map, and so can be extended with some tricks to decisions involving an action over an entire area instead. Do to so, some flags just need to be set (so that only one such decision can be added per area).
Decisions can be of different kinds: one per game mode, but a free to use sub-mode must be available.
In VGN we have these modes and sub-modes usage
- Military (submode: build units)
- Industry (submode: build structures)
- Commerce (submode is free)
- Colonisation (submode is free)
- Diplomacy (submode is free)
- Social&Pop (submode is free)
So at most 4 kinds can be defined for VGN. Each kind of decision will appears as a serie of available icons, when you are in the right mode and submode. Think of them like units you can drag&drop on the map. Here, the decisions will work the same. Switch to the colonial mode, select an icon in the panel. Highlighted in green, the regions were you can do the ‘colonial decision’. In red where you can’t (example: Gunboat diplomacy).
Same for Diplomacy missions. Switch to the sub-mode, select ‘Propose Peace’, the enemy capitals will be highlighted. Drop the treaty onto the capital. (There will be a need to a dedicated GUI for the treaty terms). In the end, Regional Decisions is a somehow generic module allowing performing actions over a particular region.
Implementation
Decisions are split into a ‘Force Pool’ and a usage. The Force Pool is added by script, and remains as is (until a new script alters it). The usage (also called ‘Act’) is what is currently on the map (the decisions on the map). When a decision on the map is completed, then it is returned to the force pool (unless a special flag is set). There can be at most one decision of a given UID in a region. You can have overall more than one decision per region active at the same time though (i.e at most one ‘Fire on the strikers’ and one ‘Arrest all dissidents’ in a given region but not two of the same UID).
Database fields
The file is use for VGN is VGN_DB_RgnDecisions.xls
Please refer to the file and notes in each column for further infos.
Here is the declaration part of the data fields in the code, as of May 17th, 2012
// from ancestor // UID : integer; // Kind : integer; colonial, diplomatic, social // Name : string; ShortName : string; // used for interface display when room is short SubType : TUID; // some subtypes can have hardcoded behavior Text : string; // flavor text
Attributes : string; // string attributes attrib1 value1|attrib2 value2 ... SoundsPlayed : string; // sound when played on map, can have several separated by |, one will be played at random MustHaveInThisSUAttrib : string; // A SU must have one of these attribs in the targeted region Attrib1|Attrib2 MustHaveAdjThisSUAttrib : string; // A SU must have one of these attribs in the region adjacent to the target MustHaveInThisSUFamily : string; // A SU must have one of these families in the targeted region Family1|Family2 MustHaveAdjThisSUFamily : string; // A SU must have one of these families in the region adjacent to the target MustHaveNumQualify : integer; // the min requirement in number of SU for the 4 previous fields (default 1) MustBeHeadOfMidHierarchy : boolean; // the targeted region must be the first listed in the theater the region belongs to MustBeHeadOfHighHierarchy : boolean; // the targeted region must be the first listed in the area state the region belongs to MustBeCapital : boolean; // must be a capital region (of anybody) MustBeColCapital : boolean; // must be a colonial capital/head of area region MustBeOwnedRegion : boolean; // MustNotBeOwnedRegion : boolean // The player must not own the region (i.e he doesn't control the exclusive structures and he is not the one with highest MC). NeedThisStrucAttribAny : string // The RGD can only be played if a structure of any player bears this attribute. (e.g *Grain_reserve*) MustBeLand : boolean; // MustBeWater : boolean; // MinControl : integer; // need at least this control (with friend included) MaxControl : integer; // need at most this control (with friend included) MinLoyalty : integer; // need at least this loyalty (nationality) MaxLoyalty : integer; // need at most this loyalty (nationality) MinCP : integer; // need at least this CP (all factions checked) MaxCP : integer; // need at most this CP (all factions checked) DevLevelMin : integer; // Dev level can't be above this value before the mod DevLevelCap : integer; // Dev level can't be above this value after the mod TrsptLevelMin : integer; // transport level must be at least this value before the mod TrsptLevelMax : integer; // transport level must be at most this value before the mod MustNotBePillaged : boolean; // region must not be ... pillaged OwnMustBeBesieged : boolean; // region must be owned by the selected faction, AND besieged OppMustBeBesieged : boolean; // region must be owned by an opponent of the selected faction, AND besieged MustNotBeBesieged : boolean; // region must not be ... besieged by any faction
CityMinLevel : integer; // Minimum level of city needed AvgCPColonialArea : integer; // minimum average CP to get in all regions of the colonial area OwnerMustBeThisKind : integer; // Owner of the region must be of this faction kind (e.g owner must be disorganized) MustBeUnderRevolt : boolean; // region owner has his tribal revolt active NeedThisAttribSelf : string; // The region must have a decision we own with the attribute listed NeedThisAttribOther : string; // The region must have a decision we don't own with the attribute listed ExcludeThisAttribSelf : string; // The region must not have a decision we own with the attribute listed ExcludeThisAttribOther : string; // The region must not have a decision we don't own with the attribute listed MinMustHaveThisColAreaSelf: integer; // The capital region must be at this min col status for you MaxMustHaveThisColAreaSelf: integer; // The capital region must be at this max col status for you ExclThisColAreaStatusOther: integer; // There must not be this Colonial status (of other) or higher in the colonial area the region belongs to MustBeThisRgnUID : TUID; // The region must be this one only MustBeThisAreaUID : TUID; // the region must be part of this area only Inp_AssetCostAbs : TAssetCost; // cost to trigger the decision (will use the higher of the two) Inp_AssetCostRel : TAssetCost; // relative cost (in % of the base) (will use the higher of the two) SpecialInputCost_Loyalty : integer; // an abs cost (positive number) in loyalty points in the region SpecialInputCost_Control : integer; // an abs cost (positive number) in control points in the region SpecialInputCost_OnArea : boolean; // if true, the special costs apply to the area (mid or high depending of MustBe... fields) SpecialInputCost_OwnKind : integer; // who owns the region for the change to be applied: 0: Self or friend, 1: enemy, 2: both MustBeThisTerrain : TUID; // BaseDecay : integer; // Base % of being removed every turn, can be altered further if hard coded behavior CanAbortPostRequest : boolean; // even if ongoing, can be aborted
Effect_IsOneShot : boolean; // the effects (including cost) only happen at first turn, despite the duration > 1 Effect_PostponeEnd : boolean; // the effect is only triggered when this is the last turn of duration (kind like a count-down) otherwise on first turn Effect_RemoveFromFP : boolean; // when ended (and used for an effect), is removed from FP, not added back. Effect_CPChange : integer; // Col pen change in decision is a success Effect_CPCap : integer; // max CP that can be reached this way (listed as effect but won't prevent usage, useful to maintain a CP while others adverse effects are in the work). Effect_RevealUnknownRgn : boolean; // reveal an unexplored region Effect_ResDiscoverChance : integer; // chance to uncover an existing but hidden resource Effect_RevoltTriggerChance: integer; // chance to trigger a native revolt Effect_RevoltRiskMod : integer; // Change the revolt risk coefficient of the main native of the region (start generally at 100, but can be 50 for a more docile native tribe and 150 or 200+ for very aggressive ones) Effect_RevoltRiskModMin : integer; // The coefficient can't go below this value when using RevoltRiskMod. Effect_DevLevelMod : integer; // Change the dev level of the region Effect_TrsptLevelMod : integer; // Change the transport level of the region Effect_TrsptLevelCap : integer; // transport level can't be above this value after the mod Effect_ChangeLocalPop : integer; // Amount of Pop points changed within the region (don't alter repartition) Effect_ChangePopAsNat : integer; // Amount of Pop points changed within the region if positive, then the pop added has the repartition of the national capital) Effect_StartStructure : TUID; // Start a structure when elapsed (UID/Alias of structure) Effect_RiseOwnColStatusTo : TUID; // Augment the Colonial status (of the CA where the RGD is played) to this level, if CA owner is self Effect_LowerOthColStatusTo: TUID; // Reduce the Colonial status (of the CA where the RGD is played) to this level, if CA owner is not self Effect_Crisis : integer; // chance to trigger a crisis with the owner of the region (if not self) or lowest relation nation, if owner is self Effect_EducationMod : integer; // change to education level Effect_EducationCap : integer; // education level can't be above this value after the mod Effect_Pillage : boolean; // switch the region to pillaged
Effect_Str_CPChange : string; // Message to generate if there is a CP change Effect_Str_RevealUnknown : string; // Message to generate if there is an unknown region revealed Effect_Str_RevoltTrigger : string; // Message to generate if a revolt has been triggered Effect_Str_ResDiscover : string; // Message to generate if a resource has been discovered Effect_Str_DevLevelChg : string; // Message to generate Effect_Str_TrsptLevelChg : string; // Message to generate Effect_Str_LocalPopChg : string; // Message to generate Effect_Str_PopAsNatChg : string; // Message to generate Effect_Str_StartStructure : string; // Message to generate Effect_Str_RiseOwnStatus : string; // Message to generate Effect_Str_LowerOthStatus : string; // Message to generate Effect_Str_Crisis : string; // Message to generate Effect_Str_Success : string; // Message to generate if success (more generic than the others dedicated strings, so not mandatory if you are also adding others strings for the custom effects). Effect_Str_Ongoing : string; // Message to send every turn for postponed RD
Out_AssetGainAbs : TAssetCost; // gain/output of the decision (will use the higher of the two) Out_AssetGainRel : TAssetCost; // gain/output of the decision (in % of the base used) (will use the higher of the two) RelBaseFlatValue : integer; // output base of the base! (0 by default) RelBaseOwnRgnCityLevel : boolean; // output base is regional city level (all bases are added) RelBaseOwnAreaCityLevel : boolean; // output base is sum of area city level (all bases are added) RelBaseUseLoyCoeff : boolean; // end output base is then multiplied by the loyalty or average area loyalty SpecialOutputGain_Loyalty : integer; // an abs gain (positive number) in loyalty points in the region (if neg, its a loss) SpecialoutputGain_Control : integer; // an abs gain (positive number) in control points in the region SpecialOutputGain_OnArea : boolean; // if true, the special gain apply to the area (mid or high depending of MustBe... fields) SpecialOutputGain_OwnKind : integer; // who owns the region for the change to be applied: 0: Self or friend, 1: enemy, 2: both
AI fields
You can check the ROP Gold file for some examples.
AIRelativePickChance : integer; // Relative chance to pick this decision (and then determine it is played) compared to others decisions available AIImprovedCalc : integer; // The improved chance calc (following data) is not used, only based on region value (much faster and much dumber). By default, we don't use all these extra fields (retrocompatibility) AIBaseChance : integer; // Base Chance to play this decision AIMustBeSea : integer; // default no AIModChanceMoneyLevel : integer; // modifier to base chance per money level (0 to 7) AIModChanceWSULevel : integer; // modifier to base chance per WSU or Steel level (0 to 7) AIModChanceConscriptLevel : integer; // modifier to base chance per conscript level (0 to 7) AIModChanceGoodsLevel : integer; // modifier to base chance per Mfg Goods level (0 to 7) AIModChanceMoraleLevel : integer; // modifier to base chance per Morale level (0 to 7) AIModChanceEPChunk : integer; // for each 10 EP, chance is modified by this value AIModChanceVPChunk : integer; // for each 100 VP, chance is modified by this value AIModChanceIsStratRegion : integer; AIModChanceIsObjRegion : integer; // this value if an objective AIModChanceCitylevel : integer; // value per level AIModChanceCutOffCityLevel : integer; // if under or equal this city level, applies value below AIModChanceCutOffCityValue : integer; AIModChanceHarborlevel : integer; AIModChanceCutOffHarborLevel : integer; // if under or equal this harbor level, applies value below AIModChanceCutOffHarborValue : integer; AIModChanceBesiegedOwn : integer; AIModChanceNotBesiegedOwn : integer; AIModChanceBesiegedOpp : integer; AIModChanceNotBesiegedOpp : integer; AIModChanceFortLevel : integer; AIModChanceCutOffFortLevel : integer; // if under or equal this fort level, applies value below AIModChanceCutOffFortValue : integer; AIModChanceLoyaltyChunk : integer; // chunk size is 10 points AIModChanceControlChunk : integer; // chunk size is 10 points AIModChanceNoAdjEnemy : integer; // including this region AIModChanceAdjEnemy : integer; // including this region AIModChancePillaged : integer; AIModChanceNotPillaged : integer; AIModChanceHasEnemy : integer; AIModChanceNoEnemy : integer; AIModChanceEnemyChunk : integer; // chunk size is 100 points AIModChanceFriendlyChunk : integer; // chunk size is 100 points
GameLogic.opt entries
These parameters should appear in GameLogic.opt in \Settings folder
- rgdRemChanceAgainstHostile = 7 // % chance to disapear on hostile ground
- rgdMaxNumMultiplier = 5 // multiplier to the max number we can have at same time (depending of size and type of country)
- rgdMaxIterMultiplier =50 // same, for the test iterations, don't go overboard or slowdown
Scripting commands
A valid faction must exist each time. For the acts, a valid region must be set too.
Evaluations
- Check in the Force Pool if a given region decision meets the test. Example: evaluating that the faction has at most 3 ‘Exploration Party’ decisions in its force pool (the test don’t take into account what is already ‘deployed’, so even if there are 2 explorations parties decisions going on the map, the result will still be the same).
- Evaluate if a decision is present (value = 1) or not (value = 0) in the selected region.
- To be used before adding a decision act to a region, so that all constraints are met.
Actions
- Alter the absolute force pool of the given decision.
- Add a decision to a region, with a date of addition (use CURRENT for the current turn). You can add a decision with a date before the current turn, so ‘set in place’ older decisions. Check that it will be valid before (with IsRgnDecisionActValid).
- Remove a given decision from a region. Check that there is one before (even if this won’t result in a crash).