PDA

View Full Version : New CAI/PiterAI1.0



Piter
09-05-2014, 19:32
PiterAI- artificial intelligence

Works with 2.01.

Download link:

Ver 1.3 (First install version 1.2 (improved system ceasefires and alliances))

http://ge.tt/8jMiae72/v/0

Ver 1.2 (fixed system of alliances)

http://ge.tt/2kZ8jSv1/v/0

alternative link

http://www.speedyshare.com/Y8yRj/CAI-PiterAIEB21.2.rar

Ver. 1.1

http://ge.tt/13Ah2ku1/v/0




Ver. 1.0

http://ge.tt/7ldXszt1/v/0



Reduced income from cities. AI will work much better. (Very difficult economy. Keep the original file if you do not like it)

http://ge.tt/6IiYUv02/v/0


Installation instructions:
unzip in your mods\EBII folder
delete the map.rwm file within the mods\EBII\data\world\maps\base directory

Information


Diplomacy is based on many factors but in short it works as follows:

From the point of view of campaign difficulty level:

VH level – AI considers player as its biggest threat so it tries to form alliances against the player and tends to go to war against the player. The AI factions easily form alliances if they consider the player their biggest threat.

H level – AI considers the player as a threat and tries to form alliances against the player and tends to go to war against the player, but to a more limited extent than on VH level. If an AI faction neighbors a faction that is significantly stronger, it will try to find an alliance against such faction. In such situation AI may propose alliance to the player and be a loyal ally.

N level – AI tries to form alliances against the strong empires (factions that are significantly stronger than AI) and tends to weaken them. If there are no such strong factions, AI will try to go to war against the player. If AI does not border the player, it tries to attack its weakest neighbor (if it tried to attack the weakest neighbor first, the campaign would be rather boring :)).

In general:

If the AI’s invasion priorities (i.e. code command driving AI to invade a given target) do not exceed a minimum threshold, the AI will not attack other factions (except for rebel / neutral provinces).


By using the „opportunistic invasion” command in the options of war and rebel provinces conquer, AI will sometimes ignore its diplomatic priorities. Besides, M2TW AI is bugged anyway.

Alliances – if an alliance is not aimed against an enemy which is the AI priority target, it works as a „non-aggression pact”. The alliance code includes commands which drive AI to attack a common enemy but if it is not the AI perceived “priority enemy”, the chance that such attack will be executed is rather small (especially on VH difficulty).

Preparations for war



The tactics responsible for invasion is rather a slow and “lazy” procedure so the AI will usually gather its armies along the borders before it finally decides to invade. Also AI will train its best available units and agents – do not be surprised when an AI assassin kills your favourite general. For the human player this knowledge is not a big facilitation though, since the fact that AI is gathering its forces along the border does not mean that it is going to invade the player’s faction in the nearest future.


In some circumstances (for instance when the player does not wage a war with its neighbors), a neutral AI faction will also keep its garrisons on the border, just as it waged a war against the (neutral) player. This AI behavior may change when the it is in war with other factions – in such case it may send all its forces to the endangered front.

War


The highest priority of AI is besieging settlements – AI uses almost all its military potential on a given front to besiege settlements. It is probably not the best solution but taking into account the limitations of the M2TW engine it seems to be pragmatic and sufficient – otherwise AI would wander its armies aimlessly over the map.
Then, as a second priority, AI tries to attack the available targets in range, so sometimes when besieging a settlement, another AI army may come to support the siege or even attack a defending player’s army which stands near the besieged settlement (to help defend it in case of assault), while the first AI army still keeps the siege.
Finally, AI tries to do an “opportunistic attack”, which in some circumstances may ignore other AI settings and priorities. But thanks to this “opportunistic” possibility, AI is more “intelligent” and able to use some unexpected situations to its benefit. Since AI tries to besiege settlements, sometimes it may happen that it will spare player’s army standing on the bridge / ford and will walk around to lay a siege to a settlement or spare the closest strongly garrisoned settlement to lay a siege to the weaker one.


- AI trains the troops of good quality, generally better than in the majority of mods I’ve seen and I think even better than in the original EB2 (no offence to the original EB CAI coder) since the troops quality depends mainly on the tactics settings in file descr_campaign_ai_db – I don’t know whether the twc modders know that.


- The additional advantage of such tactics is the AI ability of starving the besieged settlements – AI will not attack until it is certain that it will win (taking into account the result of the autocalc battle).


- AI is able to hire the mercenaries, which I did not observe frequently using other M2TW CAIs,


- Of course AI can spam agents in some circumstances (especially the pesky merchants but these are no longer in EB2),


- When AI declares a war, it can – especially when the border is long – attack simultaneously with several armies in different places along the border, which can demolish a careless player (I hope you don’t use the unhistorical “reload”).


- AI uses its agents better,


- AI can successfully strike with a really good sea invasion. This part of the code is perhaps not perfect but in my view it is quite good in comparison to other M2TW CAIs - I would like to see a CAI code which does it better.


Defence:


- Here I coded the AI in such a way that it is not so easy to conquer the settlements by attacking an army standing near the settlement and wiping out the settlement garrison that joins the battle as reinforcements (AI tries to place its armies a bit farther from settlements).

If the total strength ratio on a given front is unfavorable to AI, it will not attack openly but will rather sit in garrisons or try to defend based on bridges / fords and prepare ambushes in forests. On some occasions AI fooled me with the following scheme: I see a weak army near the forest, attack, the AI withdraws to the forest, I attack… and then I am ambushed by significantly stronger AI army. This is not very frequent but the AI in the old M2TW can show some tricks – it’s a pity that the original authors made so weak use of the AI potential in the vanilla game.

Even on N difficulty if an AI faction concludes that it no longer have common interests with the player and at the same time the AI faction is not in war against any of its neighbours, it may break the alliance with the player. In such case only relations 10/10 or 9/10 can protect the player from breaking the alliance by the AI. If AI is in war with a non-neighbouring faction, it does not count as a war and AI may break the alliance as soon as its common interests with the player end.

Thank you for the translation Polehammer.

Thanks for Araven for help in testing.

mmiki
09-05-2014, 19:46
This isn't really informative. What does this CAI do that makes it better?

Piter
09-05-2014, 20:15
This isn't really informative. What does this CAI do that makes it better?

everything :) It's hard to explain by google translator :) Play and Review :)

Sassem
09-05-2014, 20:29
haha ...you so funny

Piter
09-05-2014, 20:35
haha ...you so funny



Why this spam?

- A new way of moving AI armies on strategic map, more efficient AI attacks,
- AI factions can do efficient sea invasions,
- AI trains more agents and uses them more efficiently,
- AI uses terrain features for placing its armies to defend better (such as bridges, fords etc.),
- Diplomacy tends to balance the AI factions, AI factions try to make alliances against stronger enemies,
- Sometimes AI faction may propose peace,
- AI factions build strong armies alongside the borders before they decide to attack,
- Innovative diplomacy based on several dozen factors,
- New vassallage system

Antigonos Karchedonios
09-05-2014, 20:44
I think people are suspicious when they do not have enough information. You said in the other thread that you do not speak English very well. Maybe if you try nontheless (no Oxford English required ;)). Or if not possible, which languages do you speak? Maybe someone can help translating.

joshmahurin
09-05-2014, 22:06
Yeah people are just suspicious of random download links without an explanation. But thanks for putting this out there! GRANTO might want to look at it

GRANTO
09-05-2014, 22:33
im playing with it now.

Nightshift
09-06-2014, 23:25
I'll give it a try as well.

GRANTO
09-07-2014, 11:57
Download link:


http://ge.tt/7ldXszt1/v/0



Installation instructions:
unzip in your mods\EBII folder
delete the map.rwm file within the mods\EBII\data\world\maps\base directory


Need new campaigni liked it Piter , its good..i learn a lot from it. thank you.:2thumbsup:

QuintusSertorius
09-07-2014, 16:30
Need new campaign

You don't need a new campaign, but you need to generate a new game in order for the changes to take effect (and generate a new map.rwm).

Piter
09-07-2014, 17:35
You don't need a new campaign, but you need to generate a new game in order for the changes to take effect (and generate a new map.rwm).

True, but not for all modes so it works.

Rovert
09-07-2014, 23:43
Trying This Now , hope its better than the other 1.

Ok so they AI dosent seem dumb aggressive , the agents are a little over kill , there is spys and diplomats everywhere LOL , The AI seems to focus on whats important then to just attack you savagely just cause there bordered with you. I also have 2 alliances that are holding over 40 turns , best so far usally they will siege your port like tards and give up the trade revenue.

Just so any1 knows if you become a vassel it costs tribute and a lot , really hard on the small factions


I am 75 turns in so far , I will update when I am further along , so far its great , I also tired moving the AI to save policy , all the little factions aren't sweeping across taking everything now , I have 4 allies and they are holding , this mod is really good .
150 turns nobody is dead , allies are holding for everybody , AI expansion is much slower , Rome is still trying to become Germany , guess that will never change , they wanted to be Germany so bad in EB1 also.

https://i61.tinypic.com/vf88qe.jpg

im trying as the brit faction its most out of the way , I hope I get better troops cause these guys suck , naked spear guys just don't seem like a reliable line troop.

https://i57.tinypic.com/8xla1t.jpg

https://i58.tinypic.com/28v6g41.jpg

https://i62.tinypic.com/2q03fa9.jpg

Majasprat
09-08-2014, 20:19
I tried this but can't say that I liked it too much. As soon as I got it one of my allies declared war on me. After that my other ally declared war on me. The diplomacy was bugged because I would sue for peace with one of the allies (and then remake them into an ally) and the very next turn they would declare war on me, I could do this over and over. I went back to the CAI v.2 and one of the allies came back to my side and didn't declare war on me. They just seemed way too aggressive to me. Rome (one of the allies) had five or so other enemies and they decided to attack me. They seemed to be more competent with there armies and knew where to attack.

Piter
09-08-2014, 20:29
I tried this but can't say that I liked it too much. As soon as I got it one of my allies declared war on me. After that my other ally declared war on me. The diplomacy was bugged because I would sue for peace with one of the allies (and then remake them into an ally) and the very next turn they would declare war on me, I could do this over and over. I went back to the CAI v.2 and one of the allies came back to my side and didn't declare war on me. They just seemed way too aggressive to me. Rome (one of the allies) had five or so other enemies and they decided to attack me. They seemed to be more competent with there armies and knew where to attack.

You played a very hard? :)

AI avoids fighting on several fronts. If AI do not bordered by an enemy that does not work.


On VH difficulty level AI considers the player its biggest threat. AI tries to destroy the player's faction and forms alliances against the player.

On the H level the AI behaviour is similar but to a more limited extent.

On the N level, AI considers a strong neighbouring faction its biggest threat. AI makes alliances against it and tries to weaken it. When there is no significantly stronger neighbouring faction, AI tries to destroy its weakest neighbour.

On the N level AI frequently sends its armies to support the allied human player (sometimes it can even send a relief army to attack the besieging army and end the siege). On the H level this may also happen but less frequently.

On the VH level the AI is just rude.

The VH level is designed to be "Very Hard" and not to play alliances.

QuintusSertorius
09-08-2014, 21:01
What's the difference between 1.0 and 1.1?

Piter
09-08-2014, 21:12
What's the difference between 1.0 and 1.1?

The difference is small. AI is a little better fight.

Antigonos Karchedonios
09-08-2014, 22:10
Thank you for the explanation. I'll give it a try on M/M then as soon as I have the time!

Jikot
09-09-2014, 10:42
I'd like to try this, but is there a way to go back to "vanilla" easily?

Jikot
09-09-2014, 10:53
You don't need a new campaign, but you need to generate a new game in order for the changes to take effect.

Meaning what exactly?

Piter
09-09-2014, 14:04
Sam alliance reduces the chance of an attack. The Alliance also improves our relationship. With each higher level relationships reduce the chances of invasion. When relations 9/10 and 10/10 AI almost never reveals. You also need to skillfully manage garrisons on the border so that the AI ​​does not feel that he can start a war, easily winning several provinces.

Nightshift
09-09-2014, 19:19
150 turns with sweboz now and I really like it so far. difficulty is on hard. I am allied with Lugones and they even went through my sparsely defended territory to help me against Gauls and Brits. They are allies as well and have only attacked after I raided Britain for some money. Brits landed troops reasonably on mainland europe shores.. Boii became vassal to Rome and Aedui to Averni or what they are called now.
Very interesting campaign but I cant compare it to the other CAI because when I tried them (on different PC, different Windows, etc.) game crashed every 5 turns. I took some pics but have to convert them first. If you want I can post them here.

->Piter: Danke!/ Dziękuję!

Really have to wach out for assassins and getting full stack armys bribed away.

Piter
09-09-2014, 21:33
I took some pics but have to convert them first. If you want I can post them here.

Yes :)


->Piter: Danke!/ Dziękuję!


Proszę :)

Nightshift
09-10-2014, 12:11
Ok first pic you can see how my Lugoni allies go through my provinces, while honouring our alliance to conquer scandinavia. You can see how they wait for reinforcements because Hleifpoz was defended by a full stack.
14339

What I did was to rush there and initiate the attack before they would. I kept the savegame and will try as to when and how they will attck on their own but they usually only wait if the need more troops to attack.

And may Wodan/odin forgive me when the battle started I just broke up the gate on my front and took a nap when I woke up settlement was in my hands with no casualties. :quiet:

14340

Next one shows roman army after start of first punic war. I have no comparison to other CAIs but if you have maybe you can compare army stack sizes and decide..

14341

And lastly my returning raiding party gets their way home cut off by an angry Pritanoi faction leader - I'm sure it's just coincidence but it felt so good for roleplaying!! (couldn't land them directly at home because of pirate threat wich allready killed my first fleet after landing them on british coast - and hunted my second one, the one that brought my party back all the way to Ireland/ Hibernia).

Just before the battle started they assasinated my general. I took their faction leader as prisoner in return, his ransom would have doubled the income of my raiding adventure (+17000 mnai), unfortunatly they were broke :(

14342

maybe it was just the remains of this party:
14343
Don't know if these pics are making judgement about CAI possibly but I had a blast so far.

PS. posted the minmap pics in the faction progression thread

Rovert
09-10-2014, 15:39
https://i60.tinypic.com/w7fxxw.jpg

well not sure how this is gonna turn out , so far expansion seems weird and the allies are hilarious

still trying to figure how to do this pic crap

https://i60.tinypic.com/w7fxxw.jpg

https://i60.tinypic.com/59ympe.jpg

https://i62.tinypic.com/m7uxqa.jpg

Nightshift
09-10-2014, 15:47
I only accepted one alliance when I thought I really need that help and have one flank secure. Never allied with factions on the opposite site of the map. Maybe thats one consession you have to make. And I didn't ally with my factions I expected to raid/ attack in foreseeable future.

Anyway pleas tell us what happens once you start war and allies have to decide for one side or another! Would be interesting to see how they choose..

Piter
09-10-2014, 18:47
https://forums.totalwar.org/vb/attachment.php?attachmentid=14340&d=1410346879

hahahha, you bastard :P

3 armies attacked? I am proud of him :D


"well not sure how this is gonna turn out , so far expansion seems weird and the allies are hilarious

still trying to figure how to do this pic crap"

Balance at the beginning of the economic potentials strongly interferes with diplomacy. In addition, only fractions bordering the rebels may disrupt the operation of alliances. On the mod for which I did the rebellion was not in 30 turns.


Do not worry. How it will be exotic alliances, it would attack you :* I set a desire to conclude an alliance against the rebels "-99999", can the righteous :) Or completely breaks down :D

Please assessed after 200 rounds, not 20 :)

Piter
09-10-2014, 19:53
I fixed diplomacy. None of you will not be he liked. ;)


Only the enemy of my enemy offered me an alliance. (I play Rome 25 turns)

Rovert
09-10-2014, 21:00
getting the new version now , ill put up some updates after

Piter
09-10-2014, 21:10
getting the new version now , ill put up some updates after


Works on saves. So this is not a problem.

adishee
09-15-2014, 16:53
I'm on turn 36 of a VH/M Pergamon campaign. I got a ceasefire with the Ptolemies, and secured trade rights with them with a deal for about 1000 minai for 2 turns. I have an alliance with the Selukids. Pontus offered me an alliance in exchange for about 700 minai, which I did not take (I can see conflict with them in the future and I don't want to sully my reputation). Ptolemy also offered me an alliance but I didn't take it, because they are enemies of the Selukids. I know the Selukids would betray me if I moved my main army away from Pergamon (they have in previous PiterAI campaign), but I don't want to temp them to do so by allying with the Ptolemies. I have Bithynia and am currently besieging Byzantium. The Selukids have been messing about in Galicia with an almost-full stack for a few turns. A small rebel army just popped up in the north of Mysia. The AI have been very placid to each other -- No Greek cities have been taken by any faction, other than Thermon by the Epirots (they have lost Taras to Rome). The Selukids and the Ptolemies are not fighting in Asia Minor as far as my scouts see -- I can't speak to the Levant, they may be. Makedon has not really ventured into Thracia.

Very quiet AI so far this campaign. I wonder when it will blow up -- or if it will.

Piter
09-16-2014, 07:41
I'm on turn 36 of a VH/M Pergamon campaign. I got a ceasefire with the Ptolemies, and secured trade rights with them with a deal for about 1000 minai for 2 turns. I have an alliance with the Selukids. Pontus offered me an alliance in exchange for about 700 minai, which I did not take (I can see conflict with them in the future and I don't want to sully my reputation). Ptolemy also offered me an alliance but I didn't take it, because they are enemies of the Selukids. I know the Selukids would betray me if I moved my main army away from Pergamon (they have in previous PiterAI campaign), but I don't want to temp them to do so by allying with the Ptolemies. I have Bithynia and am currently besieging Byzantium. The Selukids have been messing about in Galicia with an almost-full stack for a few turns. A small rebel army just popped up in the north of Mysia. The AI have been very placid to each other -- No Greek cities have been taken by any faction, other than Thermon by the Epirots (they have lost Taras to Rome). The Selukids and the Ptolemies are not fighting in Asia Minor as far as my scouts see -- I can't speak to the Levant, they may be. Makedon has not really ventured into Thracia.

Very quiet AI so far this campaign. I wonder when it will blow up -- or if it will.


Thanks for the feedback. In the fight, the AI is certainly aggressive as medieval2.





I congratulate Piter. For such an awesome AI. I am still on EB 2.00 As i am scared that Piter will not work on 2.01. Piter AI seriously makes game so much more immersive. I allied with the Getai And made our relations good (Im pontus btw) and the getai actually fought and destroyed an army of makedones that were trying to make their way to me in histria.
https://forums.totalwar.org/vb/showthread.php?148106-AI-Campaign-behaviour-Is-there-any-way-to-prevent-reduce-fragmentation-of-forces


Thanks a lot, works with 2.01.

adishee
09-17-2014, 03:47
Thanks for the feedback. In the fight, the AI is certainly aggressive as medieval2.

Thanks a lot, works with 2.01.

Actually, one thing, I think I might have forgotten to delete the map file. I did it now, so the AI is def on now. Turn 59. I'm honestly not sure if the AI was on before, so please disregard my feedback until now. :/

Sarkiss
10-24-2014, 21:12
Reduced income from cities. AI will work much better.

http://ge.tt/6IiYUv02/v/0
this isnt having as much effect on the AI as on human player. i think its overdone (wish i backed up the original file!)
i cannot sustain a half stack made of levies with 6 fully developed provinces under my belt. i literally have no more building left to build in all of my cities (playing past turn 200) still it makes little difference to my income. it makes building infrastructure unnessecary and kills this aspect of the game. whatever time and money you invest in upgrading your economic base, it isnt making much of difference at all. AI on the other hand still fields multiple full stacks and ive seen a few of those marching pass my territories (the Bosporan Greeks and Pontus).

Piter
10-25-2014, 08:11
this isnt having as much effect on the AI as on human player. i think its overdone (wish i backed up the original file!)
i cannot sustain a half stack made of levies with 6 fully developed provinces under my belt. i literally have no more building left to build in all of my cities (playing past turn 200) still it makes little difference to my income. it makes building infrastructure unnessecary and kills this aspect of the game. whatever time and money you invest in upgrading your economic base, it isnt making much of difference at all. AI on the other hand still fields multiple full stacks and ive seen a few of those marching pass my territories (the Bosporan Greeks and Pontus).

http://ge.tt/3dq6PQ22/v/0


Thank you.
What are your revenue from cities?
Could you show ranking military and territorial factions?

Sarkiss
10-25-2014, 19:50
http://ge.tt/3dq6PQ22/v/0


Thank you.
What are your revenue from cities?
Could you show ranking military and territorial factions?
playing as Hayastan. all of my cities generate under 800 mnai (except Armavir), and thats with everything upgrated - ports, mines, industries and taxes on high. i had a Pontic campaign where 3 supposedly well-off coastal cities Amaseia + Trapezus + Sinop, could not maintain 4 units (plus a few FMs) these generated arout 400-500 each per turn, but that was without any infrastructure upgrades (had no money for it even after disbanding the army). it took me over 60 turns to climb out of debt (and thats with no additional units recruited, only the starting army), so the game turns into dull click fest.:-( militarily, im always the weakest faction. i will try to take some screenshots whenever i get some time to play.

thanks~:)