![]() |
Re: SUGGESTION: AI troop building algorithm
Quote:
</font><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">That would be great, but.... GalCiv has been built entirely with AI as the goal. It started on OS/2 and was mentioned in any discussion on AI for many years before PC's and Windows caught up to handling the multi-threading it does. Now its on PC and other people are hearing of it. Dominions was built on multiple humans playing in PBEM. Thats not to say that such an improvement would be impossible but it would be a large rewrite from the "single-thread AI for all the nations" which was tossed into the game. Especially since AI doesnt seem to be the Illwinter programmers idea of fun, it would be mostly a solo-player improvement, it would never be good enough, and would take alot from other projects. Personally Im 95% a solo player and would love to see improvement in this. In fact Id prefer if it went player scriptable. But I think small logic tweaks is the most likely to get patched in. |
Re: SUGGESTION: AI troop building algorithm
I would love to test your algorithm out, but unfortunately, between my thesis and exams, I wouldn't be free until after the 28th... So if you still need tester then, drop me a line. ^_^
-Gateway103 |
Re: SUGGESTION: AI troop building algorithm
It could be just me thinking this but isn't dom2 quite suited to having different AI strategys. Something like giving the pretenders personality in form of different play and recruit styles. The game just needs a few archtypes to seleckt
from,and then the AI would not be that predicteble, and hopefully also more challenging. the pseudocode in this exsample could be one, change the prioritys a bit and we have another. |
Re: SUGGESTION: AI troop building algorithm
Quote:
Im not sure if psuedo-coding a change in the linear AI code will get put in either, it just seems more likely. |
Re: SUGGESTION: AI troop building algorithm
Hi!
I don't get this one: - priest w/o magic IF turnnumber*3 < numberofpriests If you have no priests, this condition will always be false and you'll never build any. Isn't that supposed to be a >? In general, I'm afraid these rules will let you build too many units that resist fights well and not enough fodder if you need fodder. It also won't adapt to the opponents. I don't like rules which don't adapt themselves to the context. In my own game, I programmed the ai to adapt itself to the opponent. This means it tries to have a certain distribution of forces, based not on types of units -not moddable- but on unit abilities. So I basically say I want a distribution of f.e. 20% archers, 20% fast units, 40% heavy infantry, 10% leaders, 5% fortresses, 3% labs, 2% temples, and the ai looks at the current distribution of units it's got and builds new units in order to be able to reach that goal. This means you have a 'fitness' function evaluated for each unit you coudl build: If you need more priests, the system will pick a priest. If you need more mages, it will build a mage. If you need both, it will build a priest that also has magic powers. I included fortresses, labs, etc. in the distribution because I see it as distribution of the money to be spent (and yes the figures are silly - you probably need more temples than labs). That way if you have a lot of troops and only one fortress, the fitness of building a fort somewhere will be huge, while building any kind of troop will be low. This one may be tricky since you can always do something with more troops but not with more fortresses, so you may want to exclude fortresses from the list. However, the original proposal of building fortresses once every ten turns if some conditions effectively means fortresses have a weight of 10% of all money spent. I'd also suggest budgeting in advance: You plan to build this or that next turn, with a set priority. This lets you build up money for buildings when necessary. Note it's possible or even desirable to use the enemies' distribution of forces as your own target if you can't think of a distribution yourself. In particular if you are swarmed with crappy light infantry, you may want o build more crappy troops yourself so your heavy infantry won't exhaust itself to death against huge hordes. Or decide that known enemies of type 'light infantry' means you must build more of the type 'archer', and 'undead' requires more 'priests'. I coded something like that in my own game. You can check a more thorough explanation of the algorithm this: link if you are interested. |
Re: SUGGESTION: AI troop building algorithm
Looks like no-one liked the idea that much that he put some time into testing it. As my time is severly limited, I didn't get very far in my test game 'til now.
Here's the result - I tried to move/attack in a fashion I've seen the AI doing it : turn 0_______________________________________________ sidhe war godess water6, earth 4, death 1 growth, luck, magic +1, DOM 4 fortified city .. 6 points left against difficult AIs: Abysia, Ulm, C'tis, Caelum, Pangaea, Vanheim, Jotunheim, Machaka on Karan w/o waterways indies 7, rare random events, rest standard prov tax set to (100-unrest)% each turn __________________________________________________ __ turn 1 start: prov. 123, inc. 190, ress 80 treas. 400, inc. 190, upk. 17 builds: sidhe lord 280/16 2 danoine sidhe 35/16 2 cu sidhe 16/1 1 longbow remain: 6 gold/24 ress. __________________________________________________ turn 2 treas. 165, inc 190 (123) ress 80 declares prophet builds: bard 75/5 2 danoine sidhe 1 cu sidhe remain: 4 gold/42 ress. __________________________________________________ _ turn 3 treas. 165, inc 190 (123) ress 80 random: witch Branwen A2S2N3 assembles for attack on neigbouring prov (50 militia & LI): Castellan, 15 HI, 6 LongB (fire achers) Sidhe War Godess (5x Cast, Attack nearest) Sidhe Lord prophet (divine bless, cast) 4 danoine sidhe (fire nearest) 3 cu sidhe (hold, attack rearmost: flank) set up in middle of map builds: bard 2 danoine sidhe 1 cu sidhe remain: 4 gold/42 ress. __________________________________________________ __ turn 4 fight in (128) 5 archer(3), 20 militia (3), 10 light inf (6), 3 commander (11) LOSSES: 1 MI spearman(9) random: 28 unrest in man treas: 95, inc. 90, upk 36 (123) inc 84, ress 74 (128) inc 6, ress 12 attack on next prov (121): 40 LI, Crossb, HI builds: (123) monk 30/1 4 tower guards 1 slinger (128) nothing remain: 6 gold/3 ress __________________________________________________ _ turn 5 research Alt1, Evo1 fight in (121) 11 crossbow(5), 7 HI(13), 15 Jav(9), 3 Com(13) LOSSES: 1 Longb, 3 HI, danoine sidhe retreat (2 danoine sidhe go to 128, I'll leave them there) treas. 63, inc 125, upk 38 (121) inc 5, ress 25 (123) inc 112, ress 105 (128) inc 8, ress 12 army goes back to (123) builds: def 2 in all prov (123) forester 1 cu sidhe 1 Longb (121),(128) nothing remain: 4/92 ______________________________________________ turn 6 research Alt1,Evo2 treas 88, inc 158, upk 41 (121) inc 5, ress 26 (123) inc 142, ress 111 (128) inc 11, ress 13 priest moves to 121 to build temp army assembles for attack on neigbouring prov 116 (50 LI, Crossb, HI): Castellan, 11 HI, 6 LongB (fire achers) Sidhe War Godess (5x Cast, Attack nearest) 4 tower guards Sidhe Lord prophet (divine bless, cast) 4 danoine sidhe (fire nearest) 5 cu sidhe (hold, attack rearmost: flank) set up in middle of map builds: (123) castellan 1 danoine sidhe 1 cu sidhe 1 slinger (121,128) nothing remain: 0 gold, 42 ress __________________________________________________ ___ turn 7 power ranking provinces: 1 / forts: - / income: 6 / gem inc.: - /research: 6 /dominon: 6 / army size: 8 research Con1, Alt1, Evo2 treas 135, inc 185, upk 45 (116) 17, 11 (121) 6, 27 (123) 152,126 (128) 10, 13 priest builds temple in 121 random: Beothric, knight of Stone lead-75 Jotunheim sighted in 86 2nd castellan set out to gather dainone sidhe from 128 armies attacks 106 [to cut of Jotunheims advance - as the AI always does] (60 woodsmen, blowpipes) builds: castellan (116,121,128) nothing remain: 2 gold ___________________________________________ turn 8 treas 169, inc 223, upk 45 (106) 23, 19 (116) 22, 12 (121) 7, 28 (123) 116,132 (128) 10, 13 fight in (106): 2 LOSSES: HI prophet builds temple in 106 (next to Jotunheim prov.) SWGss searches for sites army sits idle 3rd castellan moves up with 1 d-/1cu sidhe builds: (123) castellan 1 d-sidhe (106,116,121,128) nothing remain 1 gold ___________________________________________ turn 9 treas 176, inc 249, upk 48 .... I think it does quite fine 'til now, maybe it is a little bit fond of building castellans. Even bulding much more scouts wouldn't do that much good, so maybe I'll put in a %tage (growing with turns elapsed) that, if no mage is build, NO commanders is build unless there's a dire need for leadership. Other suggestions? |
Re: SUGGESTION: AI troop building algorithm
Something I would change is the unrest part of that idea.
Taxes should be lowered by 20% for each 5 points of unrest in the Province. This results in 0 Unrest in the Province the next turn (assuming 25 or less Unrest) so that the Tax Rate can be raised back to 100%. Since unrest itself lowers the income of the province, this is preferable IMO than waiting for it to resolve itself. |
Re: SUGGESTION: AI troop building algorithm
Hmm, it's a bit difficult to follow without graphical representation. I should test it when I get some spare time.
|
Re: SUGGESTION: AI troop building algorithm
Quote:
http://forum.shrapnelgames.com/images/icons/icon9.gif Now Im feeling guilty. I KNOW I have more free time than you do. |
Re: SUGGESTION: AI troop building algorithm
Ah, so anyone came up with any good ideas so far in this topic?
|
All times are GMT -4. The time now is 08:36 AM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.