Things that go in [ai] ====================== - [engine] - [stage] - [aspect] - [goal] - simplified aspects, eg [attacks], [avoid] - key-value aspects, eg aggression, caution - (maybe) simplified goals, eg [target], [protect_unit], [protect_location] - defaults for simplified aspects - time_of_day= and turns=; maybe add engine=? - ai_algorithm= - this seems to be unrelated to anything else? - description, id, version - these seem to be intended for AIs made available from the lobby [engine] ======== - name - one of cpp, lua, or fai - code - only for lua/fai, not for cpp - id - generally unused, maybe allows you to remove the engine later? - engine - no idea what this is supposed to be, it seems to be either "cpp" or "" - [formula_ai] - ??? = [data] - probably for internal use? [stage] ======= - id - a unique identifier - name - this appears to be some sort of reference used to locate the code for the stage? - [candidate_action] - engine - one of cpp, lua, fai - id - a unique identifier - score, max_score - name - reference used to locate code for cpp engine? Not sure what it is for lua/fai. - evaluation, execution - code used for lua/fai engine - enabled, type, [state] - probably meant for internal use by the AI, not sure [aspect] ======== - engine - one of cpp, lua, fai - id - one of the value aspect names - name - seems to always be "composite_aspect"? - the four invalidate_on_ keys - [facet] - same keys as above (engine, id, name, invalidate), but id can be anything; name seems to always be "standard_aspect" - time_of_day, turns - value or [value] - [filter_own], [filter_enemy] - though I feel like these should belong under [value]? Possible aspects are: - advancements, aggression, attack_depth (unused?), attacks, avoid - caution, grouping - leader_aggression, leader_goal, leader_ignores_keep, leader_value - number_of_possible_recruits_to_force_recruit (unused?) - passive_leader, passive_leader_shares_keep - recruitment, recruitment_diversity, recruitment_ignore_bad_combat - recruitment_ignore_bad_movement (unused?), recruitment_instructions, recruitment_more - recruitment_pattern, recruitment_randomness, recruitment_save_gold - scout_village_targeting, simple_targeting, support_villages - village_value, villages_per_scout The following aspects require composite values: - avoid, leader_goal, recruitment, recruitment_instructions, recruitment_save_gold The attacks aspect contains no value - neither value= nor [value] are required. Examples of aspect simplification ================================= aggression ---------- The fully verbose syntax (minus the invalidate_on_ keys): [aspect] engine=cpp id=aggression name=composite_aspect [facet] engine=cpp id= name=standard_aspect time_of_day= turns= value=0.765 [/facet] [/aspect] Simplified tag syntax: [aggression] engine=cpp id= name=standard_aspect time_of_day= turns= value=0.765 [/aggression] Super-simplified attribute syntax: aggression=0.765 recruitment ----------- Fully verbose syntax: [aspect] id=recruitment [facet] [value] name=ai_default::recruitment [limit] type=Swordsman max=1 [/limit] [limit] type=Bowman max=2 [/limit] [/value] [/facet] [/aspect] Simplified syntax: [recruitment] [value] name=ai_default::recruitment [limit] type=Swordsman max=1 [/limit] [limit] type=Bowman max=2 [/limit] [/value] [/recruitment] Further simplified: [recruitment] name=ai_default::recruitment [limit] type=Swordsman max=1 [/limit] [limit] type=Bowman max=2 [/limit] [/recruitment] Super-simplified attribute syntax: recruitment=Swordsman:1,Bowman:2 attacks ------- Fully verbose: [aspect] id=attacks [facet] invalidate_on_gamestate_change=yes [filter_own] type=Elvish Sorceress,Elvish Enchantress,Elvish Sylph [/filter_own] [filter_enemy] race=undead [/filter_enemy] [/facet] [/aspect] Simplified: [attacks] invalidate_on_gamestate_change=yes [filter_own] type=Elvish Sorceress,Elvish Enchantress,Elvish Sylph [/filter_own] [filter_enemy] race=undead [/filter_enemy] [/attacks] avoid ----- Fully verbose: [aspect] id=avoid [facet] [value] terrain=*^F* [/value] [/facet] [/aspect] Simplified: [avoid] [value] terrain=*^F* [/value] [avoid] Further simplified: [avoid] terrain=*^F* [/avoid] leader_goal ----------- Fully verbose: [aspect] id=leader_goal [facet] id=my_id [value] x,y=3,3 auto_remove=yes id=my_id # This is the ID used by auto_remove. max_risk=1 [/value] [/facet] [/aspect] Simplified: [leader_goal] id=my_id # This is the [facet] ID [value] x,y=3,3 auto_remove=yes id=my_id # This is the ID used by auto_remove. max_risk=1 [/value] [/leader_goal] Further simplified: [leader_goal] x,y=3,3 auto_remove=yes id=my_id # This key belongs both to the [facet] and to the leader_goal aspect max_risk=1 [/leader_goal]