View Single Post
  #31  
Old May 28th, 2004, 04:38 PM
Arralen's Avatar

Arralen Arralen is offline
Major General
 
Join Date: Nov 2000
Location: 500km from Ulm
Posts: 2,279
Thanks: 9
Thanked 18 Times in 12 Posts
Arralen is on a distinguished road
Default Re: SUGGESTION: AI troop building algorithm

I'll continue the test game this weekend.
Meanwhile here are some improvements to the (pseudo-)code:

code:
[if there are multiple troops that fit a condition, mix equally,
starting with the most ressource-costly first]
[bless effect=true IF 3 pathes @4 OR 1@6/1@4 OR 1@9 or better]

0) IF ERMOR(Ash, Soul)OR PANGAEA(CarrWoods) GOTO 2)
CALL BUILDCASTLE

IF (availablemoney) STILL >400
BUILD lab where's a special commander(mage) to build
IF (availablemoney) STILL >(templecost*2)
BUILD temple at
- prov. that offers special holy commanders (mages, priest=3, dunno)
- prov. that have a castle
IF (numberofprovinces)>(numberofcastles)*4
AND ((turnnumber)-(numberofcastles)*10)*10%=true SAVEMONEYTURN=true; SKIP 1-3)


1) Build troops at home province
- IF prophet=false BUILD priest-3 or better
- most expensive mage commander (80%:max. 1/2 of available money/ 20%: max.3/4)
- assassin/spy/bard etc. IF ((turnnumber)-5)*10%=true
- priest w/o magic IF (turnnumber)>(numberofpriests)*3
- most heavily armored commander IF (turnnumber)>5 AND 'unusedleadership'<10
- scout (50 - (turnnumber)*2)%

- holy troop IF (bless effect)=true AND 3 pieces possible
- heavy troopsress)>14 with (strat move)>1, best move first IF 2 pieces possible
- heavy troopsress)>14 IF 3 pieces
- medium troops: (ress)>10 IF 3 pieces
- archers: IF Long-/Compound Bow


2) build troops at castles [highest ress value goes first]
- most expensive mage commander (max. 1/2 of available money)
- assassin/spy/bard etc. IF ((turnnumber)-5)*10%=true
- priest w/o magic IF (turnnumber)>(numberofpriests)*3
- most heavily armored commander IF (turnnumber)>5 AND 'unusedleadership'<10
- scout (50%)

- holy troop IF (bless effect)=true AND 3 pieces possible
- heavy troopsress)>14 with (strat move)>1, best move first IF 2 pieces possible
- heavy troopsress)>14 IF 3 pieces
- medium troops: (ress)>10 IF 3 pieces
- archers: IF Long-/Compound Bow


3) Build special troops [in non-fortress prov]
- special commanders IF mage
OR
IF special troops ARE undead, amphibic, flyers, stealthy
- build as many special troops as ressources, (availablemoney)/2, (commandvalue) allows


4) Build patrols at province w/o castle and less than 20 troops on patrol
IF
borders enemy prov.
OR has lab, but no castle
OR has only 2 land neighbours
OR has 3 neighbours, but only 1 owned

THAN BUILD
- most mobile commander IF (numberoftroops)>(commandvalue)
- highest movement troop[for patrol]


5) Build troops at all castled prov. [high ress value first]
- light troops: (ress)>7 IF 3 pieces
- fill with light archers/slingers

6) Build troops in prov
IF
borders enemy prov.
OR has lab, but no castle
OR has only 2 land neighbours
OR has 3 neighbours, but only 1 owned
- heaviest inf (50%)
- archers (no matter what)

__________________
As for AI the most effective work around to this problem so far is to simply use an American instead, they tend to put up a bit more of a fight than your average Artificial Idiot.
... James McGuigan on rec.games.computer.stars somewhen back in 1998 ...
Reply With Quote