|
|
|
 |

April 16th, 2004, 04:21 PM
|
 |
Lieutenant General
|
|
Join Date: Dec 2000
Posts: 2,555
Thanks: 5
Thanked 3 Times in 3 Posts
|
|
Re: SUGGESTION: AI castle building algorithm
Quote:
Originally posted by Arralen:
Build castle
IF money=1.2*(castle cost) OR desirabilty>7
CHOOSE prov with highest "desirability points"
|
It's not bad idea, but I was thinking about something a little different here.
1) Limit amount of gold spent on non-castle provinces (relative value, maybe 30% or even less). That way if AI has enough gold income and too few castles he will generate surplus in gold and wont spent it all on weak easy-to-lose units (Militia, LI). That will allow him to build as much national units as he can and still be able to generate some surplus to build new castles. If AI spends all money on national troops and can’t afford new castle, then he doesn't build new one anyway at least with his current income.
I believe Jasper proposed something like this in LI thread and I like this idea better simply because it will maximize production of national troops without going too deep into unit production scripting.
2) When AI has enough gold to build castle he should decide where to do it. Your proposal is quite good, so I would add only 1 thing there. When deciding for where to build castle AI should take into account ALL neighbors, not only the ones he controls. That way he will be building forts on bordering provinces if they are good, without need for special algorithms.
As for slowdowns, I don't think they should be significant since AI revalue his provinces only when he has enough gold to build castle, not every turn.
[ April 16, 2004, 15:23: Message edited by: Daynarr ]
|

April 16th, 2004, 05:56 PM
|
 |
Sergeant
|
|
Join Date: Oct 2000
Posts: 295
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: SUGGESTION: AI castle building algorithm
Quote:
Originally posted by Arralen:
This is a part of the troop building suggestion
------------------------------------------------
Build castle
IF money=1.2*(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 1pt
has site with allows special commanders 2pts
d) has 4 land neighbours, of which 2 are not owned AND not neighbouring owned provinces 1pt
f) would have 2 castle neighbours -2 pts
------------------------------------------------
|
A few comments:
- For a, are you counting commander units? *Many* standard indy commanders have a res cost > 14. Even aside from that, 2 pts seems to place a lot of desirability on having high-resource indep troops. I think this should probably be more nation-dependent. Ie: An indy province that produces heavy cav may not be much of a benefit for a nation that already has some good heavy cav units.
- I think that b above has a potential hole where it could build new castles that share provinces with one or more other castles, thereby reducing *those* castles resources to unfortunate levels even though the new castle meets the criteria. Perhaps a check that all bordering provinces of the prospective castle site should have <= 100% admin after factoring in the new castle, or -2 pt desirability rating
- I tend to emphasize putting castles at/near stable enemy borders. In d, I'm not sure what you mean by "... AND not neighboring owned provinces" ... neighboring what - enemies? I don't know if I'm missing the point, but I think I'd scratch that part so it could put castles on its borders.
- Is there no point e on your list?
- It might also be worth somehow factoring in some desirability for building castles at/near "where the action is". IE: The AI is probably better off building a castle near where its current main army is engaged than at some place on the other side of its empire.
- Another thing to consider is that if the AI does start building castles anywhere near its enemies is that it should make sure it is capable of defending the province while the castle is under construction (to protect its investment), and will be able to defend the castle after it's built. It would be a bad thing if the AI starts building undefended or marginally defended castles that opponents could easily take and use for themselves to support their advance.
- It might be worth setting some castle-to-province ratios, at which castle building becomes greater and greater priorities. Say:
code:
if (ctp-ratio < 0.1) // if less than 1 castle per 10 provinces
save_income_percentage_for_castle(0.2) // save 20% of income towards castle
else if (ctp-ratio < 0.05) // 1 castle per 20 provinces
save_income_percentage_for_castle(0.5) // save half of income towards castle
etc.
The numbers above are arbitrary, but you get the idea. This could allow a gradually increasing priority for castles as the AI expands, and also would allow the AI to save up for castles rather than just building them when it happens to have enough money or relying on occasional money-saving turns.
|

April 16th, 2004, 06:06 PM
|
 |
Lieutenant Colonel
|
|
Join Date: Jan 2004
Posts: 1,276
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
Re: SUGGESTION: AI castle building algorithm
Quote:
Originally posted by Gandalf Parker:
I wonder how much "thinking" this would take. I usually comment that it doesnt matter how long it takes a turn to process because its a "pass turn file to host" type game. But AI improvements mostly affect solo players and improving the AI would do any good if it changes the game to something too slow to hold their attention.
|
As an SP nerd, I would gladly pay 400% in turn generation time for better AI without blinking, and probably 800% if it were pretty decent. But that is just my sole opinion.
Go Arralen go!
|

April 17th, 2004, 07: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 castle building algorithm
I think Castle building is more important to an AI win than the spread of units purchased. And the formula would be easier to test. In fact if you turn on --scoredump you get an html with numbers for everything which would make the math much easier in later games (not have to count provinces and such)
__________________
-- 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!)
|

April 17th, 2004, 11:53 PM
|
Second Lieutenant
|
|
Join Date: Feb 2004
Posts: 529
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: SUGGESTION: AI castle building algorithm
You mean it would be possible to download a mod that improves the AI and lets it build castles?! When can I download it?
|

April 18th, 2004, 12:19 AM
|
 |
Shrapnel Fanatic
|
|
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
|
|
Re: SUGGESTION: AI castle building algorithm
Quote:
Originally posted by splooger:
You mean it would be possible to download a mod that improves the AI and lets it build castles?! When can I download it?
|
No the modding doesnt support directly changing the AI. Im just saying that we are more likely to get a small change to the linear AI than ever getting a complete rewrite.
There are some MODs in the work which might make a difference but as far as I can see they will have to be a mod for each nation you want AI'd. They would do things like make castles cheaper and remove the light units that the AI loves.
There are also some MAPs which strengthen the AIs.
[ April 17, 2004, 23:48: Message edited by: Gandalf Parker ]
__________________
-- 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!)
|

May 9th, 2004, 05:54 PM
|
Corporal
|
|
Join Date: Sep 2003
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: SUGGESTION: AI castle building algorithm
All right, imho the AI should build castles like this:
code:
Province
Province - Castle & Province - Province
Province
Province - Castle & Province - Province
Province
Just multiply it in all directions.
[ May 09, 2004, 16:54: Message edited by: MStavros ]
|
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
|
|
|
|
|