Re: Der Agearena - KI - Thread
Verfasst: Samstag 20. November 2010, 10:30
von Björn_Jernside
Der Sammelthread für KI-Fragen in der Agearena. Fragen + Antworten werden aktualisiert und im ersten Post gesammelt
_________________________________________________________________________
1. Frage:
Habe folgende KI
Die KI soll sich und den Verbündeten in der eigenen Stadt verteidigen. Wie stelle ich ein, dass der Spieler nur die gemeinsame Stadt verteidigt??
Frage 2:
Wie sorge ich dafür, dass ein Spieler mit Transportbooten (gefüllt) angreift?
_________________________________________________________________________
1. Frage:
Habe folgende KI
Verborgener Text:
[ki]#load-if-defined DIFFICULTY-MODERATE
(defconst kas1 7)
(defconst kas2 10)
(defconst sch1 7)
(defconst sch2 7)
(defconst sta1 10)
(defconst sta2 5)
(defconst bur1 7)
(defconst waf1 4)
(defconst waf2 3)
(defconst haf1 2)
(defconst haf2 4)
(defconst klo1 3)
(defconst min-Angriffstrupp 15)
(defconst max-Angriffstrupp 25)
(defconst Prozent-Angriff 90)
(defconst Angriffs-Intervall 180)
#end-if
#load-if-defined DIFFICULTY-HARD
(defconst kas1 10)
(defconst kas2 13)
(defconst sch1 10)
(defconst sch2 10)
(defconst sta1 13)
(defconst sta2 7)
(defconst bur1 10)
(defconst waf1 5)
(defconst waf2 5)
(defconst haf1 3)
(defconst haf2 4)
(defconst klo1 3)
(defconst min-Angriffstrupp 15)
(defconst max-Angriffstrupp 25)
(defconst Prozent-Angriff 90)
(defconst Angriffs-Intervall 180)
#end-if
(defrule
(true)
=>
(set-strategic-number sn-maximum-food-drop-distance 0)
(set-strategic-number sn-maximum-wood-drop-distance 0)
(set-strategic-number sn-maximum-gold-drop-distance 0)
(set-strategic-number sn-maximum-hunt-drop-distance 0)
(set-strategic-number sn-maximum-stone-drop-distance 0)
(set-strategic-number sn-food-gatherer-percentage 0)
(set-strategic-number sn-wood-gatherer-percentage 0)
(set-strategic-number sn-gold-gatherer-percentage 0)
(set-strategic-number sn-stone-gatherer-percentage 0)
(set-strategic-number sn-cap-civilian-explorers 0)
(set-strategic-number sn-percent-civilian-explorers 0)
(set-strategic-number sn-percent-civilian-builders 0)
(set-strategic-number sn-cap-civilian-explorers 0)
(disable-self))
(defrule
(true)
=>
(set-strategic-number sn-percent-enemy-sighted-response 100)
(set-strategic-number sn-enemy-sighted-response-distance 100)
(set-strategic-number sn-hits-before-alliance-change 25)
(set-strategic-number sn-percent-attack-boats 0)
(set-strategic-number sn-percent-attack-soldiers 0)
(set-strategic-number sn-task-ungrouped-soldiers 0)
(set-strategic-number sn-consecutive-idle-unit-limit 0)
(set-difficulty-parameter ability-to-maintain-distance 100)
(set-difficulty-parameter ability-to-dodge-missiles 100)
(disable-self))
(defrule
(true)
=>
(set-strategic-number sn-number-explore-groups 0)
(set-strategic-number sn-minimum-explore-group-size 0)
(set-strategic-number sn-maximum-explore-group-size 0)
(disable-self))
(defrule
(true)
=>
(set-strategic-number sn-number-boat-explore-groups 0)
(set-strategic-number sn-minimum-boat-explore-group-size 0)
(set-strategic-number sn-maximum-boat-explore-group-size 0)
(disable-self))
(defrule
(event-detected trigger 2)
=>
(set-goal 10 1)
(disable-self))
(defrule
(goal 10 1)
=>
(set-strategic-number sn-maximum-food-drop-distance 0)
(set-strategic-number sn-maximum-wood-drop-distance 0)
(set-strategic-number sn-maximum-gold-drop-distance 0)
(set-strategic-number sn-maximum-hunt-drop-distance 0)
(set-strategic-number sn-maximum-stone-drop-distance 0)
(set-strategic-number sn-food-gatherer-percentage 0)
(set-strategic-number sn-wood-gatherer-percentage 0)
(set-strategic-number sn-gold-gatherer-percentage 0)
(set-strategic-number sn-stone-gatherer-percentage 0)
(set-strategic-number sn-cap-civilian-explorers 0)
(set-strategic-number sn-percent-civilian-explorers 0)
(set-strategic-number sn-percent-civilian-builders 0)
(disable-self))
(defrule
(goal 10 1)
=>
(set-strategic-number sn-number-explore-groups 0)
(set-strategic-number sn-minimum-explore-group-size 0)
(set-strategic-number sn-maximum-explore-group-size 0)
(disable-self))
(defrule
(goal 10 1)
=>
(set-strategic-number sn-percent-attack-soldiers Prozent-Angriff)
(set-strategic-number sn-attack-intelligence 100)
(set-strategic-number sn-defense-distance 100)
(set-strategic-number sn-sentry-distance 100)
(set-strategic-number sn-target-evaluation-siege-weapon 100)
(set-strategic-number sn-target-evaluation-damage-capability 100)
(set-strategic-number sn-number-attack-groups 2)
(set-strategic-number sn-minimum-attack-group-size min-Angriffstrupp)
(set-strategic-number sn-maximum-attack-group-size max-Angriffstrupp)
(attack-now)
(enable-timer 1 Angriffs-Intervall)
(enable-timer 3 6)
(enable-timer 4 6)
(enable-timer 5 6)
(disable-self))
(defrule
(timer-triggered 1)
=>
(disable-timer 1)
(enable-timer 1 Angriffs-Intervall)
(attack-now))
(defrule
(goal 10 1)
(unit-type-count-total militiaman-line less-than kas1)
(can-train militiaman-line)
=>
(train militiaman-line))
(defrule
(goal 10 1)
(unit-type-count-total spearman-line less-than kas2)
(can-train spearman-line))
=>
(train spearman-line))
(defrule
(goal 10 1)
(unit-type-count-total archer-line less-than sch1)
(can-train archer-line)
=>
(train archer-line))
(defrule
(goal 10 1)
(unit-type-count-total skirmisher-line less-than sch2)
(can-train archer-line)
=>
(train skirmisher-line))
(defrule
(goal 10 1)
(unit-type-count-total knight-line less-than sta1)
(can-train knight-line)
=>
(train knight-line))
(defrule
(goal 10 1)
(unit-type-count-total scout-cavalry-line less-than sta2)
(can-train scout-cavalry-line)
=>
(train scout-cavalry-line))
(defrule
(goal 10 1)
(unit-type-count my-unique-unit-line less-than bur1)
(can-train my-unique-unit-line)
=>
(train my-unique-unit-line))
(defrule
(goal 10 1)
(unit-type-count-total mangonel-line less-than waf1)
(can-train mangonel-line)
=>
(train mangonel-line))
(defrule
(goal 10 1)
(unit-type-count-total scorpion-line less-than waf2)
(can-train scorpion-line)
=>
(train scorpion-line))
(defrule
(goal 10 1)
(unit-type-count-total fire-ship less-than haf1)
(can-train fire-ship)
=>
(train fire-ship))
(defrule
(goal 10 1)
(unit-type-count-total galley-line less-than haf2)
(can-train galley-line)
=>
(train galley-line))
(defrule
(goal 10 1)
(unit-type-count-total monk less-than klo1)
(can-train monk)
=>
(train monk))
[/ki]
(defconst kas1 7)
(defconst kas2 10)
(defconst sch1 7)
(defconst sch2 7)
(defconst sta1 10)
(defconst sta2 5)
(defconst bur1 7)
(defconst waf1 4)
(defconst waf2 3)
(defconst haf1 2)
(defconst haf2 4)
(defconst klo1 3)
(defconst min-Angriffstrupp 15)
(defconst max-Angriffstrupp 25)
(defconst Prozent-Angriff 90)
(defconst Angriffs-Intervall 180)
#end-if
#load-if-defined DIFFICULTY-HARD
(defconst kas1 10)
(defconst kas2 13)
(defconst sch1 10)
(defconst sch2 10)
(defconst sta1 13)
(defconst sta2 7)
(defconst bur1 10)
(defconst waf1 5)
(defconst waf2 5)
(defconst haf1 3)
(defconst haf2 4)
(defconst klo1 3)
(defconst min-Angriffstrupp 15)
(defconst max-Angriffstrupp 25)
(defconst Prozent-Angriff 90)
(defconst Angriffs-Intervall 180)
#end-if
(defrule
(true)
=>
(set-strategic-number sn-maximum-food-drop-distance 0)
(set-strategic-number sn-maximum-wood-drop-distance 0)
(set-strategic-number sn-maximum-gold-drop-distance 0)
(set-strategic-number sn-maximum-hunt-drop-distance 0)
(set-strategic-number sn-maximum-stone-drop-distance 0)
(set-strategic-number sn-food-gatherer-percentage 0)
(set-strategic-number sn-wood-gatherer-percentage 0)
(set-strategic-number sn-gold-gatherer-percentage 0)
(set-strategic-number sn-stone-gatherer-percentage 0)
(set-strategic-number sn-cap-civilian-explorers 0)
(set-strategic-number sn-percent-civilian-explorers 0)
(set-strategic-number sn-percent-civilian-builders 0)
(set-strategic-number sn-cap-civilian-explorers 0)
(disable-self))
(defrule
(true)
=>
(set-strategic-number sn-percent-enemy-sighted-response 100)
(set-strategic-number sn-enemy-sighted-response-distance 100)
(set-strategic-number sn-hits-before-alliance-change 25)
(set-strategic-number sn-percent-attack-boats 0)
(set-strategic-number sn-percent-attack-soldiers 0)
(set-strategic-number sn-task-ungrouped-soldiers 0)
(set-strategic-number sn-consecutive-idle-unit-limit 0)
(set-difficulty-parameter ability-to-maintain-distance 100)
(set-difficulty-parameter ability-to-dodge-missiles 100)
(disable-self))
(defrule
(true)
=>
(set-strategic-number sn-number-explore-groups 0)
(set-strategic-number sn-minimum-explore-group-size 0)
(set-strategic-number sn-maximum-explore-group-size 0)
(disable-self))
(defrule
(true)
=>
(set-strategic-number sn-number-boat-explore-groups 0)
(set-strategic-number sn-minimum-boat-explore-group-size 0)
(set-strategic-number sn-maximum-boat-explore-group-size 0)
(disable-self))
(defrule
(event-detected trigger 2)
=>
(set-goal 10 1)
(disable-self))
(defrule
(goal 10 1)
=>
(set-strategic-number sn-maximum-food-drop-distance 0)
(set-strategic-number sn-maximum-wood-drop-distance 0)
(set-strategic-number sn-maximum-gold-drop-distance 0)
(set-strategic-number sn-maximum-hunt-drop-distance 0)
(set-strategic-number sn-maximum-stone-drop-distance 0)
(set-strategic-number sn-food-gatherer-percentage 0)
(set-strategic-number sn-wood-gatherer-percentage 0)
(set-strategic-number sn-gold-gatherer-percentage 0)
(set-strategic-number sn-stone-gatherer-percentage 0)
(set-strategic-number sn-cap-civilian-explorers 0)
(set-strategic-number sn-percent-civilian-explorers 0)
(set-strategic-number sn-percent-civilian-builders 0)
(disable-self))
(defrule
(goal 10 1)
=>
(set-strategic-number sn-number-explore-groups 0)
(set-strategic-number sn-minimum-explore-group-size 0)
(set-strategic-number sn-maximum-explore-group-size 0)
(disable-self))
(defrule
(goal 10 1)
=>
(set-strategic-number sn-percent-attack-soldiers Prozent-Angriff)
(set-strategic-number sn-attack-intelligence 100)
(set-strategic-number sn-defense-distance 100)
(set-strategic-number sn-sentry-distance 100)
(set-strategic-number sn-target-evaluation-siege-weapon 100)
(set-strategic-number sn-target-evaluation-damage-capability 100)
(set-strategic-number sn-number-attack-groups 2)
(set-strategic-number sn-minimum-attack-group-size min-Angriffstrupp)
(set-strategic-number sn-maximum-attack-group-size max-Angriffstrupp)
(attack-now)
(enable-timer 1 Angriffs-Intervall)
(enable-timer 3 6)
(enable-timer 4 6)
(enable-timer 5 6)
(disable-self))
(defrule
(timer-triggered 1)
=>
(disable-timer 1)
(enable-timer 1 Angriffs-Intervall)
(attack-now))
(defrule
(goal 10 1)
(unit-type-count-total militiaman-line less-than kas1)
(can-train militiaman-line)
=>
(train militiaman-line))
(defrule
(goal 10 1)
(unit-type-count-total spearman-line less-than kas2)
(can-train spearman-line))
=>
(train spearman-line))
(defrule
(goal 10 1)
(unit-type-count-total archer-line less-than sch1)
(can-train archer-line)
=>
(train archer-line))
(defrule
(goal 10 1)
(unit-type-count-total skirmisher-line less-than sch2)
(can-train archer-line)
=>
(train skirmisher-line))
(defrule
(goal 10 1)
(unit-type-count-total knight-line less-than sta1)
(can-train knight-line)
=>
(train knight-line))
(defrule
(goal 10 1)
(unit-type-count-total scout-cavalry-line less-than sta2)
(can-train scout-cavalry-line)
=>
(train scout-cavalry-line))
(defrule
(goal 10 1)
(unit-type-count my-unique-unit-line less-than bur1)
(can-train my-unique-unit-line)
=>
(train my-unique-unit-line))
(defrule
(goal 10 1)
(unit-type-count-total mangonel-line less-than waf1)
(can-train mangonel-line)
=>
(train mangonel-line))
(defrule
(goal 10 1)
(unit-type-count-total scorpion-line less-than waf2)
(can-train scorpion-line)
=>
(train scorpion-line))
(defrule
(goal 10 1)
(unit-type-count-total fire-ship less-than haf1)
(can-train fire-ship)
=>
(train fire-ship))
(defrule
(goal 10 1)
(unit-type-count-total galley-line less-than haf2)
(can-train galley-line)
=>
(train galley-line))
(defrule
(goal 10 1)
(unit-type-count-total monk less-than klo1)
(can-train monk)
=>
(train monk))
[/ki]
Frage 2:
Wie sorge ich dafür, dass ein Spieler mit Transportbooten (gefüllt) angreift?