|
|
|
|
|
May 28th, 2004, 04:38 PM
|
|
Major General
|
|
Join Date: Nov 2000
Location: 500km from Ulm
Posts: 2,279
Thanks: 9
Thanked 18 Times in 12 Posts
|
|
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 ...
|
September 23rd, 2004, 03:52 PM
|
|
Major General
|
|
Join Date: Nov 2000
Location: 500km from Ulm
Posts: 2,279
Thanks: 9
Thanked 18 Times in 12 Posts
|
|
Re: SUGGESTION: AI troop building algorithm
I must admit - it's not only Gandalf who can't play as an AI would, strictly follwing the 'build script' .. I can't do it either. After 6..10 turns I simply screw up .. either I overlook something I'm supposed to do, or I start doing things I shouldn't
So if there's anyone out there interested in an AI that does not only build Light Infantry, please test this building script. If it works well, the devs may put something similar into the game, maybe.
__________________
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 ...
|
September 23rd, 2004, 04:43 PM
|
Second Lieutenant
|
|
Join Date: Feb 2004
Posts: 529
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: SUGGESTION: AI troop building algorithm
Where do I get this mod, and how do I install it?
|
September 23rd, 2004, 04:55 PM
|
|
General
|
|
Join Date: Aug 2003
Location: Sweden
Posts: 4,463
Thanks: 25
Thanked 92 Times in 43 Posts
|
|
Re: SUGGESTION: AI troop building algorithm
It's not a mod. It's a suggested AI algorithm. In other words its an attempt at making a strategic manual for the AI. Print it out and play a game with those rules and never take any initiative of your own and you are playing the game acording to the Arralen AI Algorithm. If tested and proven good it might inspire JK to alter the current algorithm. If you come across any problems notify Arralen. He seems to be up for input .
|
September 23rd, 2004, 05:09 PM
|
|
Shrapnel Fanatic
|
|
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
|
|
Re: SUGGESTION: AI troop building algorithm
Its a set of AI rules. People keep saying "broke" but they rarely come up with specific suggestions such as this thread did. There is also another one like it on AI castle building somewhere.
The reason it needs testing is that its not hard to come up with specifics on how Ulm would play better or how Ermor would play better. But there is only (at this time) one AI program. So if you were to write a generic AI using words like infantry, cavalry, archer, mage, priest... then will it make things worse when played by Pangaea, or Caelum, or Atlantis.
__________________
-- DISCLAIMER:
This game is NOT suitable for students, interns, apprentices, or anyone else who is expected to pass tests on a regular basis. Do not think about strategies while operating heavy machinery. Before beginning this game make arrangements for someone to check on you daily. If you find that your game has continued for more than 36 hours straight then you should consult a physician immediately (Do NOT show him the game!)
|
September 23rd, 2004, 06:22 PM
|
|
First Lieutenant
|
|
Join Date: Jul 2004
Location: Albuquerque, NM
Posts: 605
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: SUGGESTION: AI troop building algorithm
I think I'll attempt to test this, so wish me luck; I'm not sure how hard it's going to be.
__________________
Every time you download music, God kills a kitten.
|
September 24th, 2004, 12:34 PM
|
Sergeant
|
|
Join Date: Mar 2004
Location: cali
Posts: 325
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: SUGGESTION: AI troop building algorithm
It seems to me that its more important to have a challenging and entertaining game than a complex AI that can sit in the same seat as a human and do a passable job. Why not script it so whenever the AI plays a nation that nation plays alot like the dead Ermor nations? I've noticed that the AI does a remarkably better job when the infantry is auto-generated and it can focus more on the commanders and construction. Could it not be set up so that the AI gets a smaller percentage of the money it should be recieving, but also gets free thematic troops that will keep its army looking national instead of independant, then it could focus more on the other things and probably be a good deal more challenging. I am far more interested in the way the game plays than whether or not the AI is playing fairly.
|
September 25th, 2004, 06:50 PM
|
Colonel
|
|
Join Date: Apr 2002
Location: Near Paris, France
Posts: 1,566
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: SUGGESTION: AI troop building algorithm
Cheezeninja,
I do like your suggestion very much I don't care if the AI plays by the same rules than the players, and like you would prefer to have AI field "nice" armies !
By the same token AI armies should be starvation-protected.
|
September 25th, 2004, 09:10 PM
|
|
Shrapnel Fanatic
|
|
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
|
|
Re: SUGGESTION: AI troop building algorithm
Quote:
PDF said:
Cheezeninja,
I do like your suggestion very much I don't care if the AI plays by the same rules than the players, and like you would prefer to have AI field "nice" armies !
By the same token AI armies should be starvation-protected.
|
I liked that, since the AI cant do reasonable planning based on low or high supply provinces. But then I thought about it and realized that it would be a major thorn to Ermor and other death scales which count on creating large rings of non-supply to aid in their defense.
Not that I ever liked that. I wouldnt mind seeing it get nerfed but it IS a plus factor of theirs which would be cut down. Something to consider but I cant quite decide if it knocks the suggestion out or not. Opinions?
__________________
-- DISCLAIMER:
This game is NOT suitable for students, interns, apprentices, or anyone else who is expected to pass tests on a regular basis. Do not think about strategies while operating heavy machinery. Before beginning this game make arrangements for someone to check on you daily. If you find that your game has continued for more than 36 hours straight then you should consult a physician immediately (Do NOT show him the game!)
|
October 23rd, 2004, 07:28 PM
|
|
Major General
|
|
Join Date: Nov 2000
Location: 500km from Ulm
Posts: 2,279
Thanks: 9
Thanked 18 Times in 12 Posts
|
|
Re: SUGGESTION: AI troop building algorithm
Quote:
The_Tauren13 said:
I think I'll attempt to test this, so wish me luck; I'm not sure how hard it's going to be.
|
Any results so far?
I'm not shure if it makes sense anymore, though.
With DOM3 in development, will the DOM2 AI be tweaked any more?
However, I started a test game myself and already did some tweaks to the pseudocode:
Code:
[bless effect=true IF 3 pathes @4 OR 1@6/1@4 OR 1@9 or better]
[IF there are multiple troops that fit a condition,
mix equally, starting with the most ressource-costly first]
[IF there are multiple troops that fit a condition ressource-wise (Troop-Type),
but only building one of them would fit the whole condition,
build only that troop : applies to (1i) especially]
-------------------------------------------------------------------
0) IF ERMOR(Ash, Soul)OR PANGAEA(CarrWoods) GOTO *X*)
IF money>(castle cost) CALL BUILDCASTLE
*------------------------------------------------*
BUILDCASTLE
IF money=1.5*(castle cost) OR desirabilty>7
CHOOSE prov with highest "desirability points"
a) has indie _troop_ with (ress. cost)>14 2pts
b) will give (combinedress)>66 [BASE w/o scales]
AND isn't next to another castle 1 pt
OR (combinedress)>99 2 pts
c) has site with allows special troops 1 pt
has site with allows special commanders 2 pts
d) has 4 land neighbours, of which 2 are not owned
AND not neighbouring owned provinces 1 pt
e) would have 1 castle neighbours -1 pt
would have 2 castle neighbours -2 pts
*------------------------------------------------*
*X* 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) a) IF prophet=false BUILD priest-3 or better, no matter where
Build troops at home province
b) assassin/spy/bard etc. IF (turnnumber-5)*10)[Max30]% = true
c) priest w/o magic IF (turnnumber)>(numberofpriests)*3
d) most heavily armored commander possible
IF (turnnumber)>5 AND 'unusedleadership(=set to defend)'<5
e) scout (50 - (turnnumber)*2)%
f) most expensive mage commander possible
(80%:max. 1/2 of available money/ 20%: max.3/4)
g) holy troop IF (bless effect)=true AND 3 pieces possible
h) heavy troopsress)>14 with (strat move)>1, best move first
IF 2 pieces
i) heavy troopsress)>14 IF 3 pieces
k) medium troops: (ress)>10 IF 3 pieces
l) archers: IF Long-/Compound Bow
2) Build troops at castles [highest ress value goes first]
a) scout (50%)
b) assassin/spy/bard etc. IF (turnnumber-5)*10)[Max30]% = true
c) priest w/o magic IF (turnnumber)>(numberofpriests)*3
d) most heavily armored commander possible IF (turnnumber)>5 AND 'unusedleadership'<5
e) most expensive mage commander possible (max. 1/2 of available money)
f) holy troop IF (bless effect)=true AND 3 pieces possible
g) heavy troopsress)>14 with (strat move)>1, best move first IF 2 pieces possible
h) heavy troopsress)>14 IF 3 pieces
i) medium troops: (ress)>10 IF 3 pieces
k) archers: IF Long-/Compound Bow
3) Build special troops [in non-fortress prov]
a) special commanders IF mage
OR
IF special troops ARE undead, amphibic, flyers, stealthy
b) build as many special troops as ressources, (availablemoney)/2, (commandvalue) allows
4) On turn 9,12,15 ... 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
a) most mobile commander IF (numberoftroops)>(commandvalue)
b) highest movement troop[for patrol]
5) Build troops at all castled prov. [high ress value first]
a) fill with light archers/slinger and light troopsress)>3 (60%/40%)
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
a) heaviest inf (50%)
b) 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 ...
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is On
|
|
|
|
|