привет, @Genastrat, Продолжать ИИ
Я плохо говорю по-русски.
descr_pathfinding
version_info
{
68
}
изменение
version_info
{
1
}
регенерировать descr_pathfinding.db
max_paths/total_nodes
подразделение основа. нет армия.
использовать 0.
наблюдение.
обраща́ть внима́ние, в бегство подразделение. не будет двигаться.
scheduler_configuration
{
; low load config
load low
{
max_paths 0 ; maximum paths till shifting to the next loading
total_nodes 0 ; total nodes allocated across all paths
}
; medium load config
load medium
{
max_paths 0 ; maximum paths till shifting to the next loading
total_nodes 0 ; total nodes allocated across all paths
}
; high load config
load high
{
max_paths 0 ; maximum paths till shifting to the next loading
total_nodes 0 ; total nodes allocated across all paths
}
; low priority config
priority low
{
budget 0 ; percentage of budget for these paths
max_nodes 0 ; maximum nodes per path
max_zone_nodes 0 ; maximum zone nodes per path
}
; medium priority config
priority medium
{
budget 0 ; percentage of budget for these paths
max_nodes 0 ; maximum nodes per path
max_zone_nodes 0 ; maximum zone nodes per path
}
; high priority config
priority high
{
budget 0 ; percentage of budget for these paths
max_nodes 0 ; maximum nodes per path
max_zone_nodes 0 ; maximum zone nodes per path
}
; real time priority config
priority real_time
{
budget 0.0 ; percentage of budget for these paths
max_nodes 0 ; maximum nodes per path
max_zone_nodes 0 ; maximum zone nodes per path
}
; quick test priority config
priority quick_test
{
budget 0.0 ; percentage of budget for these paths
max_nodes 0 ; maximum nodes per path
max_zone_nodes 0 ; maximum zone nodes per path
}
}
подразделение атака
нет армия атака.
нет
; Movement configuration
movement_configuration
{
formation_hold_distance 25.0 ; formations update after the last point - Unit Charge (Running Attack) Formation
}
преимущество в местности.
infantry
{
min_slope 10 ; minimum slope before penalty applies
max_slope 60 ; maximum slope the unit can handle
[b]penalty 0.999[/b] ; modifier per degree, helps AI with slope
min_width 1.0 ; minimum width = 1m
max_width 1.5 ; maximum width = 1.5m
descr_formations_ai
Другие способ
monitor_conditions I_InBattle
and I_ConflictType Normal
if I_BattleEnemyArmyNumberOfAttribute rome_gen > 0
unit_group_order_change_group_formation Enemy ordered_triple_line_1
end_if
if I_BattlePlayerArmyNumberOfAttribute rome_gen > 0
unit_group_order_change_group_formation Allies ordered_triple_line_1
end_if
end_monitor
descr_formations
15:10:48.409 [game.script.exec] [trace] exec <[b]unit_group_order_change_group_formation[/b]> at line 755 in mods/EBII/data/scripts/show_me/background_script.txt
This part is too complex explain in my bad russian so I use english.
Config files in XML (config_ai_battle). XML is an extensible language, semantics will be defined by the exe. AI will interpret, but will not interpret battle config. Only config_ai_battle.
In exe instructions to read strings (Data in config_ai_battle)
Exe code (XML) loaded into computer RAM
Once code is placed in RAM, code (config_ai_battle) is interpreted by the AI and translated/applied into: front, right, left, rear on battlefield. Decisions made around battle direction.
Formations are used in points on battle field, check use show_cursorstat command in console. Use on battlefield.
0,0 = center of battle field. Battlefield is like a graph. x,y graph. Formations move on graph. AI formation centered on a single point (create battle script and execute move command to confirm for yourself) but is dependent on descr_formations_ai relative_pos.
AI uses information in configuration (config_ai_battle) decides where to move.
Observe defensive AI behaviour, fight near a hill. Change values in absurd ranges. AI will make absurd moves onto the hill or off the hill and away from main army.
<defend-line>
<tracking-tolerance>125.0</tracking-tolerance>
<formed-percentage>20.0</formed-percentage>
<defend-terrain>
<radius>1500</radius>
</defend-terrain>
<threat-assessment>
<unit>
<!-- default threat contribution -->
<contribution-general>20</contribution-general>
<!-- threat contribution when attacker is moving towards unit -->
<contribution-targetted>30</contribution-targetted>
<!-- rate at which the threat fades per metre (flankers) -->
<horizontal-fade>0.025</horizontal-fade>
<!-- rate at which the threat fades per metre (for hills) -->
<vertical-fade>0.05</vertical-fade>
<!-- rate at which threat fades per metre (from the battleline) -->
<general-fade>0.1</general-fade>
</unit>
</threat-assessment>
x, y position in descr_formations_ai
begin_block 0
unit_type phalanx 1.0
default_melee_state defend
unit_formation phalanx
unit_density close
min_unit_width 30
max_unit_width 30
block_formation line
[u][b]block_relative_pos 0 0.0 0.0[/b][/u]
inter_unit_spacing 3.0
priority 1.0
end_block
Formations moved on battle field according to position.
Exe translated decision starting from unit position into direction AI attack (front, right, left, rear). Cavalry must be on sides to flank or will attack directly front.
I hope you understand and continue modding the AI.
Your formations ai file is very interesting, I will look at it thank you. Actually I had not thought there was a way without a script, so it is impressive you managed to make that way work.
скоро 2.2.