Seite 1 von 1

Re: ich bin zu dumm für 'ne KI

Verfasst: Freitag 3. September 2004, 14:21
von Björn_Jernside
...
helft mir!
ki1: nur holzfällen, felder bauen und ernten , verteidigen
ki2: angreifen, rohstoffe sammeln
ki3: nur bauern
ki4: veteidigen , nach ki-signal angreifen
ki5: verteidigen

Re: ich bin zu dumm für 'ne KI

Verfasst: Freitag 3. September 2004, 15:48
von Günter
Das ist aber ganz schön viel :eek: ... und etwas zu ungenau.
... aber holzfällen und Felder bauen ist einfach :
<pre style="color:green">
(defrule
(building-type-count mill less-than 1)
(can-build mill)
=>
(build mill))
(defrule
(building-type-count lumber-camp less-than 1)
(can-build lumber-camp)
=>
(build lumber-camp))
(defrule
(true)
=>
(set-strategic-number sn-maximum-food-drop-distance 10)
(set-strategic-number sn-maximum-wood-drop-distance 20)
(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 50)
(set-strategic-number sn-wood-gatherer-percentage 50)
(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)
(disable-self))
(defrule
(sheep-and-forage-too-far)
(idle-farm-count less-than 1)
(can-build farm)
=>
(build farm))
(defrule
(true)
=>
(set-strategic-number sn-percent-civilian-builders 30)
(disable-self))
</pre>
ki 2 : Wieviel Rohstoffe? Wozu werden die Rohstoffe benötigt?

ki 1,4,5 : wer soll verteidigen? Sollen dazu Units ausgebildet werden?

ki 2.4 : wer soll angreifen? Units ausbilden?

ki 3 müsste so aussehen:
<pre style="color:green">
(defrule
(building-type-count mill less-than 1)
(can-build mill)
=>
(build mill))
(defrule
(true)
=>
(set-strategic-number sn-maximum-food-drop-distance 10)
(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 100)
(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)
(disable-self))
(defrule
(sheep-and-forage-too-far)
(idle-farm-count less-than 1)
(can-build farm)
=>
(build farm))
(defrule
(true)
=>
(set-strategic-number sn-percent-civilian-builders 30)
(disable-self))
(defrule
(wood-amount less-than 500)
=>
(cc-add-resource wood 1000)) ;damit das Holz nicht ausgeht ;)
</pre>
ki 4 : Welches KI-Signal ?

Re: ich bin zu dumm für 'ne KI

Verfasst: Freitag 3. September 2004, 23:00
von Björn_Jernside
ki2: unendlich viele Rohstoffe zum Einheiten ausbilden, die dann angreifen
ki4: Einheiten sind vorhanden
ki5: Einheiten sind vorhanden

Re: ich bin zu dumm für 'ne KI

Verfasst: Samstag 4. September 2004, 17:38
von Günter
ok, dann probier das mal:

ki 2 :
<pre style="color:green;">
(defconst min-attack 5)<span style="color:grey; font-style:italic;">;der Wert, wieviel vorhandene Einheiten mindestens angreifen sollen</span>
(defconst max-attack 10)<span style="color:grey; font-style:italic;">;der Wert, wie gross der Angriffstrupp maximal sein soll</span>
(defconst percent-attack 100)<span style="color:grey; font-style:italic;">;der prozentuale Wert, wieviele Soldaten der Gesamtmiliz angreifen sollen</span>
(defconst attack-timer 300)<span style="color:grey; font-style:italic;">;das Intervall, in dem Angriffe gestartet werden</span>

(defrule
(building-type-count mill less-than 1)
(can-build mill)
=>
(build mill))
(defrule
(building-type-count lumber-camp less-than 1)
(can-build lumber-camp)
=>
(build lumber-camp))
(defrule
(building-type-count mining-camp less-than 1)
(can-build mining-camp)
=>
(build mining-camp))
(defrule
(true)
=>
(set-strategic-number sn-maximum-food-drop-distance 20)
(set-strategic-number sn-maximum-wood-drop-distance 20)
(set-strategic-number sn-maximum-gold-drop-distance 20)
(set-strategic-number sn-maximum-hunt-drop-distance 20)
(set-strategic-number sn-maximum-stone-drop-distance 20)
(set-strategic-number sn-cap-civilian-explorers 0)
(set-strategic-number sn-percent-civilian-explorers 0)
(disable-self))
(defrule
(food-amount less-than 300)
=>
(set-strategic-number sn-food-gatherer-percentage 40)
(set-strategic-number sn-wood-gatherer-percentage 25)
(set-strategic-number sn-gold-gatherer-percentage 25)
(set-strategic-number sn-stone-gatherer-percentage 10)
(disable-self))
(defrule
(wood-amount less-than 300)
=>
(set-strategic-number sn-food-gatherer-percentage 25)
(set-strategic-number sn-wood-gatherer-percentage 40)
(set-strategic-number sn-gold-gatherer-percentage 25)
(set-strategic-number sn-stone-gatherer-percentage 10)
(disable-self))
(defrule
(gold-amount less-than 300)
=>
(set-strategic-number sn-food-gatherer-percentage 25)
(set-strategic-number sn-wood-gatherer-percentage 25)
(set-strategic-number sn-gold-gatherer-percentage 40)
(set-strategic-number sn-stone-gatherer-percentage 10)
(disable-self))
(defrule
(sheep-and-forage-too-far)
(idle-farm-count less-than 1)
(can-build farm)
=>
(build farm))
(defrule
(true)
=>
(set-strategic-number sn-percent-civilian-builders 30)
(disable-self))

(defrule
(true)
=>
(enable-timer 1 attack-timer)
(disable-self))
(defrule
(timer-triggered 1)
=>
(disable-timer 1)
(set-strategic-number sn-percent-attack-soldiers percent-attack)
(set-strategic-number sn-attack-intelligence 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 1)
(set-strategic-number sn-minimum-attack-group-size min-attack)
(set-strategic-number sn-maximum-attack-group-size max-attack)
(attack-now)
(enable-timer 1 attack-timer)
(disable-self))
</pre>

Re: ich bin zu dumm für 'ne KI

Verfasst: Samstag 4. September 2004, 17:49
von Günter
ki 4 :
<pre style="color:green;">
(defconst min-attack 5)
(defconst max-attack 10)
(defconst percent-attack 100)
(defconst attack-timer 300)

(defrule
(event-detected trigger <span style="color:red;">"hier dein KI-Scriptziel eintragen"</span>)
=>
(enable-timer 1 attack-timer)
(disable-self))

(defrule
(timer-triggered 1)
=>
(disable-timer 1)
(set-strategic-number sn-percent-attack-soldiers percent-attack)
(set-strategic-number sn-attack-intelligence 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 1)
(set-strategic-number sn-minimum-attack-group-size min-attack)
(set-strategic-number sn-maximum-attack-group-size max-attack)
(attack-now)
(enable-timer 1 attack-timer)
(disable-self))
</pre>

Das müsste eigentlich klappen :rolleyes: ;) .

zum Verteidigen muss man in der ki nicht unbedingt etwas angeben, das macht der Compi durch die "default"-Einstellungen von selbst.

Re: ich bin zu dumm für 'ne KI

Verfasst: Donnerstag 14. Juli 2005, 19:47
von pike
Das kannst du aber gut Günter :Respekt:
Mein Rekord ist ein ACHTZEILER!!!!!!!!!!!!