mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-28 22:55:41 +00:00
Documents which quests the AI proactively attempts to complete via FulfillQuestsCommandSelector and which quests are not handled. Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
5.1 KiB
5.1 KiB
AI Quest Completion Behavior
This document describes which quests the AI attempts to complete proactively to recruit unaffiliated heroes.
Overview
The AI attempts to complete quests via FulfillQuestsCommandSelector, which is invoked by MidGameAIClient.chosenFulfillEasyQuestsCommand. The AI only considers quests from unaffiliated heroes in provinces ruled by a faction leader.
Quests the AI Actively Completes
Diplomacy Quests
| Quest | Handler | Conditions |
|---|---|---|
AllianceQuest |
AllianceQuestCommandChooser |
Target faction must meet trust conditions for alliance and not already be in an alliance |
TruceWithFactionQuest |
TruceWithFactionQuestCommandChooser |
Target faction must meet trust conditions for truce |
TruceCountQuest |
TruceCountQuestCommandChooser |
Picks a random faction that meets trust conditions and isn't already in a truce/alliance |
Resource Giving Quests
| Quest | Handler | Notes |
|---|---|---|
AlmsToProvinceQuest |
AlmsToProvinceQuestCommandChooser |
Gives food to the specified province |
AlmsAcrossRealmQuest |
AlmsAcrossRealmQuestCommandChooser |
Gives food from the province with the largest surplus |
GiveToHeroesInProvinceQuest |
GiveToHeroesInProvinceQuestCommandChooser |
Gives gold to the hero with the lowest loyalty in the specified province |
GiveToHeroesAcrossRealmQuest |
GiveToHeroesAcrossRealmQuestCommandChooser |
Gives gold from the province with the most gold available |
Province Development Quests
| Quest | Handler | Notes |
|---|---|---|
ImproveAgricultureQuest |
ImproveQuestCommandChooser |
Issues an Improve command with Agriculture type |
ImproveEconomyQuest |
ImproveQuestCommandChooser |
Issues an Improve command with Economy type |
ImproveInfrastructureQuest |
ImproveQuestCommandChooser |
Issues an Improve command with Infrastructure type |
Other Quests
| Quest | Handler | Conditions |
|---|---|---|
DismissSpecificVassalQuest |
DismissSpecificVassalCommandChooser |
Only if province has more than 2 heroes AND the unaffiliated hero's power >= target hero's power * RequiredPowerMultiplierForDismiss |
Quests the AI Does Not Attempt to Complete
The following quests have no handler in FulfillQuestsCommandSelector and must be completed naturally through gameplay:
Combat/Military Quests
DefeatFactionQuest- Defeat a specific factionGrandArmyQuest- Accumulate a large number of troopsUpgradeBattalionQuest- Upgrade a battalion to minimum armament/trainingWinBattleOutnumberedQuest- Win a battle while outnumberedWinBattlesQuest- Win a number of battlesRescueImprisonedLeaderQuest- Rescue an imprisoned leader from another faction
Expansion Quests
ExpandToProvincesQuest- Expand to control a certain number of provincesSpecificExpansionQuest- Conquer a specific provinceBorderSecurityQuest- Have troops in a border province
Prisoner Quests
ExecutePrisonerQuest- Execute a specific prisonerExilePrisonerQuest- Exile a specific prisonerReleasePrisonerQuest- Release a specific prisonerReturnPrisonerQuest- Return a prisoner to their factionReleaseAllPrisonersQuest- Release all prisoners
Province Order Quests
DevelopProvincesQuest- Maintain provinces in Develop order for monthsMobilizeProvincesQuest- Maintain provinces in Mobilize order for monthsRestProvinceQuest- Use the Rest command in a specific province
Reconnaissance Quests
ReconProvincesQuest- Reconnoiter a number of provincesReconSpecificProvincesQuest- Reconnoiter specific provinces
Economic Quests
TotalDevelopmentQuest- Achieve total development level in a provinceWealthQuest- Accumulate gold and foodSpendOnFeastsQuest- Spend gold on feastsSendSuppliesQuest- Send food to a specific provinceRepairDevastationQuest- Repair devastation
Special Event Quests
SuppressRiotByForceQuest- Suppress a riot by forceFightBeastsAloneQuest- Fight beasts aloneStartBlizzardQuest- Start a blizzard in a provinceStartEpidemicQuest- Start an epidemic in a provinceApprehendOutlawQuest- Apprehend an outlaw hero
Miscellaneous
BattalionDiversityQuest- Have diverse battalion typesSwearBrotherhoodWithHeroQuest- Swear brotherhood with a specific heroBetrayAllyQuest- Betray an allied faction
Implementation Details
The quest completion logic is located in:
FulfillQuestsCommandSelector.scala- Main entry point, iterates through choosersquest_command_selectors/- Individual quest handlers
Each chooser extends either:
QuestCommandChooser- For quests requiring randomnessDeterministicQuestCommandChooser- For quests with deterministic command selection
The AI prioritizes quests in the order they appear in FulfillQuestsCommandSelector.choosers:
- Alliance
- TruceWithFaction
- Improve (Agriculture/Economy/Infrastructure)
- AlmsToProvince
- GiveToHeroesInProvince
- AlmsAcrossRealm
- GiveToHeroesAcrossRealm
- TruceCount
- DismissSpecificVassal