I
think this should fix most issues with the AI troopbuilding.
I dunno how squad assembly or troop gathering from provinces work, so maybe this has to be tweaked accordingly.
Could anyone else than me use this algorithm in a test game to see if it works out? Could be that I'm quite biased and don't see obvious weeknesses...
for
call buildcastle go here
BUILDCASTLE
code:
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 (numberofprovinces)>(numberofcastles)*4
AND ((turnnumber)-(numberofcastles)*10)*10%=true SAVEMONEYTURN=true
1) Build troops at castles in following order
- 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)*3<(numberofpriests)
- most heavily armed commander IF (turnnumber)>5
- scout
- holy troop IF (bless effect)=true
- heavy troopsress)>14 with (strat move)>1, best move first IF 2 pieces possible
- heavy troopsress)>14 IF 3 pieces
- medium troops: (ress)>11 IF 3 pieces
- archers: IF Long-/Compound Bow
- light troops: (ress)>7 IF 3 pieces
- fill with light archers
[if there are multiple troops that fit a condition, mix equally]
[bless effect=true IF 3 pathes @4 OR 1@6/1@4 OR 1@9 or better]
2) Build special troops
- special commanders IF mage
OR
IF special troops ARE undead, amphibic, flyers
- build as many special troops as ressources, (availablemoney)/2, (commandvalue) allows
3) 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 (troopnumber)>(commandvalue)
- highest movement[for patrol]
edited:
if you have trouble deciphering the "code" part, use the font size option of your browser. There's no way I could fiddle with it using the BB code here...
***!!, *URL* tag doesn't work within *code* tag, so I had to put the URL for the castle buildind algorithm seperatly
[ April 16, 2004, 06:45: Message edited by: Arralen ]