Req: different use of unit weighting results regarding AI unit building

Have a feature request for SRU? Post here.

Moderators: Balthagor, Legend, Moderators

Post Reply
User avatar
Zuikaku
General
Posts: 2394
Joined: Feb 10 2012
Human: Yes

Req: different use of unit weighting results regarding AI unit building

Post by Zuikaku »

This is a question for George. :-)
I know this is a bit late in development and I'm not sure how much worki it woul'd require to implement, but I just feel AI needs more build variety when building units. While I had some success regarding this issue in my mod, results are often very limited and hard to achieve.

The way I think unit weighting influence AI build policies is as follows:
- AI individualy weigts every unit available to build
- unit with higher result is selected to be built and all the others are ignored
- variety may only occure when results are very close or the same (range of these is unknown for me) or when AI is in mixed strategic stance ( neither offensive or defensive)
- unit quality as viewed by AI is graphically represented through dots at unit picture (four dark green dots representing high quality units and a single red dot unit of low quality with yellow and light green dots in between).

My suggestions are as follows:
- AI shoul'd build 3 most highly rated units and not only highest rated one
- AI shoul'd build all the newest units available and not the only one with the highest ratings. So if we got 4 units available marked with 4 dark green dots, AI will build all of them. If the highest rated units are 3 units marked with 2 yellow dots, AI will build all 3 of them.

In current system there are these situations (which I have tried to change):
- British AI values Matilda 2 and A9 tank as the best ,but builds A9 only
- Japanese AI values Ki-44, Ki-45 and Ki-43 as the best (4 green dots) but builds Ki-45s only
- German AI values Panther A, Tiger I and Pz IVH as the best, but builds Tiger I only
- US AI values Paratroopers, Rangers, Marines and M3 halftracks as the best, but only builds M3 halftracks

Is it possible at all to implement this change? Is it an easy fix or requires complicated code changes?

Thanks in advance!
Please teach AI everything!
YoMomma
Brigadier Gen.
Posts: 768
Joined: Jun 27 2015
Human: Yes
Contact:

Re: Req: different use of unit weighting results regarding AI unit building

Post by YoMomma »

You guys make this way too difficult. AI only build artillery when they dont have anymore tanks and infantry, THATS an issue.

But yeah also like to see foot infantry, but then again mostly the talk abt 36 game...
Gameplay 1st
User avatar
Uriens
Brigadier Gen.
Posts: 588
Joined: Oct 05 2005

Re: Req: different use of unit weighting results regarding AI unit building

Post by Uriens »

YoMomma wrote:You guys make this way too difficult. AI only build artillery when they dont have anymore tanks and infantry, THATS an issue.

But yeah also like to see foot infantry, but then again mostly the talk abt 36 game...
That's not entirely true, AI build all types of units as specified in AIParams.CSV file.
AI however doesn't send any artillery to help in the attack and this is also because of that file where artillery is not included in attack unit composition. When there are no more units specified in csv file available, then it will send artillery and anti air. This can be changed in the file and I did it successfully so now, in my games, AI will send both artillery and anti air to help other units which makes defensive tactics much more difficult.
This is basically a matter of tweaking that file. I'm already doing it for my mod I'm working on.
User avatar
Zuikaku
General
Posts: 2394
Joined: Feb 10 2012
Human: Yes

Re: Req: different use of unit weighting results regarding AI unit building

Post by Zuikaku »

YoMomma wrote:You guys make this way too difficult. AI only build artillery when they dont have anymore tanks and infantry, THATS an issue.

But yeah also like to see foot infantry, but then again mostly the talk abt 36 game...
It's not that AI is not building artillery. Load any multiplayer gameand you'll see AI building artillery. The problem is that AI sometimes does not use it wisely. To be true, AI artillery is giving me headaches in my games. Sometimes it uses it very, very efficiently to clear fortified locations.
Uriens wrote:
YoMomma wrote: This is basically a matter of tweaking that file. I'm already doing it for my mod I'm working on.
What is ETA of your mod?
I woul'd like to use AI reaction changes of yours in my mod if you allow me to do that.

And AI is not using air force in efficient way (mostly no air support or strategic bombings, only weak air raids here and there).
Please teach AI everything!
User avatar
Uriens
Brigadier Gen.
Posts: 588
Joined: Oct 05 2005

Re: Req: different use of unit weighting results regarding AI unit building

Post by Uriens »

Zuikaku wrote: What is ETA of your mod?
I woul'd like to use AI reaction changes of yours in my mod if you allow me to do that.

And AI is not using air force in efficient way (mostly no air support or strategic bombings, only weak air raids here and there).
No ETA - got a lot of work to do before I even announce it. I can however release AI file although I'm still tweaking it on daily bases. The problems I'm dealing with now is with anti air preferences, to be more exact, with AI preference for common missile AA units being too low. Seems that tweaking this file also changes how units are ordered in the research and probably affects AI decision on what unit designs to research. Right now I suggest to either wait until I find solution to this or to use the file but copy paste AA unit part from original to replace AA unit preference (its 2 lines in the file basically).
I didn't tackle aircraft unit's yet but I have seen some AI regions actually have some strategic bombers. However, they just sit in their bases and do nothing. I'll definitely take a look at those once I've dealt with land units. Naval seems to be fine, at least for my needs.
YoMomma
Brigadier Gen.
Posts: 768
Joined: Jun 27 2015
Human: Yes
Contact:

Re: Req: different use of unit weighting results regarding AI unit building

Post by YoMomma »

Uriens wrote:
YoMomma wrote:You guys make this way too difficult. AI only build artillery when they dont have anymore tanks and infantry, THATS an issue.

But yeah also like to see foot infantry, but then again mostly the talk abt 36 game...
That's not entirely true, AI build all types of units as specified in AIParams.CSV file.
kk of the 10 units 6 are artillery, 2 aa, 1 tank and 1 inf. The tank and inf get send on a suicide mission/confused MM, so effictively, no they dont train new tank and inf.
Gameplay 1st
User avatar
Uriens
Brigadier Gen.
Posts: 588
Joined: Oct 05 2005

Re: Req: different use of unit weighting results regarding AI unit building

Post by Uriens »

Ok, here is the file. Still looking at anti-air but it has no big deal atm. Also all naval/air parameters are on default values. I didn't touch those yet. For the purpose of using artillery/anti-air with other attack units, this works properly. Also, the key part for it is in the &&AIREQRESPONSE area. Others mostly have effects on build queues and what units to prioritize. If someone want's to use their own build priorities but want artillery/aa change, just copy/paste &&AIREQRESPONSE line and everything below it and REPLACE the one in your AIParams.CSV file. Don't forget that verifying cache and possibly updating game via Steam will overwrite this file and you will be back to default values.

Code: Select all

// Build class sequences: [land-air-sea][defense-mixed-offense][16-class seq],,,,,,,,,,"// Add 128 for 'mobile preference'; Add 64 for 'missile preference', 32 for 'engineer preference'",,,,,,,,,,,,,,,,,,,,
&&BUILDSEQUENCE,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
0,3,2,1,0,4,3,5,4,0,0,1,3,0,5,6,,// Land-Defense,,,,,,,,,,,,,
0,1,128,2,128,3,0,4,0,5,131,132,2,133,1,6,,// Land-Mixed,,,,,,,,,,,,,
128,1,128,2,128,131,128,132,128,133,128,2,128,2,131,6,,// Land-Offense,,,,,,,,,,,,,
7,11,9,7,9,11,7,9,10,7,9,12,7,9,13,14,,// Air-Defense,,,,,,,,,,,,,
7,11,9,7,9,7,10,11,9,7,9,10,12,9,13,14,,// Air-Mixed,,,,,,,,,,,,,
7,11,9,7,10,7,11,10,9,7,9,10,12,13,14,10,,// Air-Offense,,,,,,,,,,,,,
18,19,18,18,17,17,15,18,17,83,82,81,15,79,20,16,,// Naval-Defense,,,,,,,,,,,,,
18,17,18,18,17,17,19,18,17,83,82,81,15,79,20,16,,// Naval-Mixed,,,,,,,,,,,,,
18,17,18,18,17,17,15,15,17,83,82,81,15,79,20,16,,// Naval-Offense,,,,,,,,,,,,,

&&END

// Weighting of each of 30 vars for each class, for defense & offense,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
//1.spotting, 2.initiative, 3.moverange, 4.speed, 5.specfeat, 6.miscap, 7.attsoft, 8.atthard, 9.attfort, 10.attclosea, 
//11.attmida, 12.atthigha, 13.attsurf, 14.attsub, 15.resvd, 16.resvd, 17.defgnd, 18.deftacair, 19.defindir, 20.defclose, 
//21.attclose, 22.transpcap, 23.crew, 24.rangegnd, 25.rangeair, 26.rangesurf, 27.rangesub, 28.cost, 29.builddays,
&&UNITWEIGHTING,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
//    1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
0.0,0.1,0.5,0.5,5.0,0.0,0.0,1.0,1.0,0.1,0.0,0.0,0.0,0.1,0.0,0.0,0.0,1.0,0.5,1.0,3.0,8.0,0.0,0.5,0.0,0.0,0.0,0.0,0.5,10.0,// Infantry - Defense
0.0,0.1,0.5,1.5,1.0,0.0,0.0,1.0,1.0,0.1,0.0,0.0,0.0,0.1,0.0,0.0,0.0,1.0,0.5,1.0,4.0,7.0,0.0,0.5,0.0,0.0,0.0,0.0,0.5,1.0,// Infantry - Offense
0.0,3.0,1.0,3.0,2.0,0.0,0.0,1.0,1.0,0.1,0.0,0.0,0.0,0.1,0.0,0.0,0.0,1.0,0.5,1.0,3.0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.0,0.5,2.0,2.0,0.2,2.0,2.0,0.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,2.0,2.0,2.0,2.0,1.0,1.6,// Destroyer - Offense
0.0,1.0,2.0,1.0,1.0,0.0,1.0,0.5,0.5,0.1,1.0,1.0,0.0,1.0,1.0,0.0,0.0,1.0,0.5,0.5,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,2.0,// Frigate - Defense
0.0,1.0,2.0,2.0,2.0,0.0,1.0,1.0,1.0,0.5,2.0,2.0,0.2,2.0,2.0,0.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,2.0,2.0,2.0,2.0,1.0,1.6,// Frigate - Offense
0.0,1.0,1.0,1.0,1.0,0.0,1.0,0.5,0.5,0.1,1.0,1.0,0.0,1.0,1.0,0.0,0.0,1.0,0.5,0.5,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,2.0,// Patrol - Defense
0.0,2.0,1.5,2.0,2.0,0.0,1.0,1.0,1.0,0.5,2.0,2.0,0.2,2.0,2.0,0.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,2.0,2.0,2.0,2.0,1.0,1.6,// Patrol - Offense
0.0,1.0,0.0,1.0,1.0,2.0,0.0,0.0,0.0,0.0,0.5,0.5,0.0,0.0,0.0,0.0,0.0,1.0,1.0,0.2,0.0,0.0,2.0,0.0,0.0,0.5,0.5,0.0,1.0,2.0,// Transp Sea - Defense
0.0,1.0,0.0,1.5,2.0,4.0,0.0,0.0,0.0,0.0,0.5,1.0,0.0,0.0,0.0,0.0,0.0,1.5,1.5,1.0,0.0,0.0,4.0,0.0,0.0,1.0,1.0,0.0,1.0,2.0,// Transp Sea - Offense
0.0,,0.0,,,0.0,0.0,,,,,,,,,0.0,0.0,,,,,,,,,,,,,,// (upgrades)
0.0,,0.0,,,0.0,0.0,,,,,,,,,0.0,0.0,,,,,,,,,,,,,,// (upgrades)
&&END
                
// Missile build weighting - the filtering of what launch-platform types to build is set in build code.  Here we just worry about the targets.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
// Uses same weighting as above, except lines are for:  target naval - defense, offense; target land - defense, offense; target fortification - defense, offense; target indirect - defense, offense",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
//,spotting,initiative,moverange,speed,specfeat,miscap,attsoft,atthard,attfort,attclosea,attmida,atthigha,attsurf,attsub,resvd,resvd,defgnd,deftacair,defindir,defclose,attclose,transpcap,crew,rangegnd,rangeair,rangesurf,rangesub,cost,builddays,
&&MISSILEWEIGHTING,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
0.0,0.0,0.0,2.0,0.1,0.0,0.0,0.1,0.1,0.0,0.0,0.0,0.0,4.0,0.0,0.0,0.0,0.5,0.5,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,3.0,// Target Naval - Defense
0.0,0.0,0.0,5.0,0.2,0.0,0.0,0.1,0.1,0.0,0.0,0.0,0.0,2.0,0.0,0.0,0.0,1.0,0.5,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,3.0,// Target Naval - Offense
0.0,0.0,0.0,3.0,0.1,0.0,0.0,3.0,3.0,0.0,0.0,0.0,0.0,0.1,0.0,0.0,0.0,0.5,0.5,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,3.0,// Target Land - Defense
0.0,0.0,0.0,5.0,0.2,0.0,0.0,1.5,2.0,0.0,0.0,0.0,0.0,0.1,0.0,0.0,0.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,3.0,// Target Land - Offense
0.0,0.0,0.0,3.0,0.1,0.0,0.0,0.1,0.1,2.0,0.0,0.0,0.0,0.1,0.0,0.0,0.0,0.5,0.5,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,3.0,// Target Fort - Defense
0.0,0.0,0.0,5.0,0.2,0.0,0.0,0.1,0.1,1.5,0.0,0.0,0.0,0.1,0.0,0.0,0.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,3.0,// Target Fort - Offense
0.0,0.0,0.0,3.0,0.1,0.0,0.0,3.0,1.5,1.0,0.0,0.0,0.0,0.1,0.0,0.0,0.0,0.5,0.5,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,3.0,// Target Indirect - Defense
0.0,0.0,0.0,5.0,0.2,0.0,0.0,2.0,1.0,1.0,0.0,0.0,0.0,0.1,0.0,0.0,0.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,3.0,// Target Indirect - Offense
&&END

// Response Unit Classes to AI Requests eight for each; repeat if using less),,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
// Flags, mtype, class, Y/N, mtype, class, Y/N, mtype, class, Y/N, mtype, class etc,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
// (Note: mtype no longer used or required in update 7; column now unused),,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
// Flags:  0x01 : mobile units only (ground) / mission units only (air); 0x02: No attack str check,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
// Flags,mtype,class,m/m,mtype,class,m/m,mtype,class,m/m,mtype,class,m/m,mtype,class,m/m,mtype,class,m/m,mtype,class,m/m,mtype,class,,,,,,,
&&AIREQRESPONSE,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
2,,3,2,,0,2,,4,2,,5,2,,3,2,,0,2,,4,2,,5,,,,,,,//0 AIREQGARRISON Request to Garrison a hex for defense
2,,0,2,,3,2,,4,2,,5,2,,6,2,,4,2,,3,2,,4,,,,,,,//1 AIREQDEFENSE Request defensive-oriented units for area
1,,0,1,,2,1,,3,N,,0,1,,2,N,,7,1,,2,N,,0,,,,,,,//2 AIREQASSISTANCE Request 'assistance', for instance if a battle is going badly
2,,14,2,,6,2,,14,2,,6,2,,14,2,,6,2,,14,2,,6,,,,,,,//3 AIREQSUPPLIES Request resupply
1,,9,1,,11,1,,10,N,,7,1,,9,1,,11,1,,10,N,,7,,,,,,,//4 AIREQAIRSUPPORT Request air support for ground units
2,,6,2,,14,2,,6,2,,14,2,,6,2,,14,2,,6,2,,14,,,,,,,//5 AIREQLANDTRANSPORT Request transport units to be dispatched
2,,20,2,,20,2,,14,2,,20,2,,20,2,,14,2,,20,2,,20,,,,,,,//6 AIREQSEASUPPLY Request Sea resupply
N,,17,N,,18,N,,15,N,,18,N,,15,N,,19,N,,19,N,,18,,,,,,,//7 AIREQSEAATTACK Request Naval attack units
1,,0,1,,2,N,,4,1,,0,1,,2,N,,4,N,,5,1,,2,,,,//8 AIREQATTACK Request (on land) attack units
N,,0,1,,2,N,,4,N,,7,N,,10,N,,11,N,,5,2,,6,,,,,,,//9 AIREQBATTLESUPPORT Request support for a land battle (not used by AI at present)
N,,0,1,,2,N,,0,1,,2,N,,7,N,,5,N,,0,N,,1,,,,,,,//10 AIREQCITYRESCUE Requested by Cities taken over if loyalty is to us
1,,9,1,,9,1,,9,1,,11,1,,9,1,,9,1,,11,1,,9,,,,,,,//11 AIREQAIRINTERCEPT Request intercept of airspace violation
1,,2,N,,0,1,,2,N,,0,N,,3,N,,4,N,,7,N,,4,,,,,,,//12 AIREQCITYLOST City was lost, request attempt to retake it
1,,2,1,,2,N,,4,N,,0,N,,7,N,,0,1,,2,N,,4,,,,,,,//13 AIREQBASELOST Base was lost
N,,3,2,,0,2,,4,2,,3,1,,2,N,,1,2,,3,2,,1,,,,,,,//14 AIREQINDUSTRYLOST Industrial complex was lost
1,,1,2,,1,N,,1,N,,3,N,,1,N,,7,N,,1,N,,6,,,,,,,//15 AIREQLANDLOST Land in general was lost
&&END
// Land units
//  0 Infantry
//  1 Recon
//  2 Tank
//  3 Anti-Tank
//  4 Artillery / MLRS / Launch Vehicle / Mortar
//  5 Air Defense
//  6 Transport/Bridging
// Air Units
//  7 Helicopter
//  9 Fighter/Interceptor
//  10 Fighter/Bomber
//  11 Fighter/Multi Role
//  12 Strategic Bomber
//  13 Patrol/AWACS / Recon/Surveillance / Surveillance / ECM/Recce
//  14 Transport / Tanker
// Naval Units
//  15 Submarine
//  16 Carrier
//  17 Battleship / Cruiser / Destroyer
//  18 Frigate / Corvette
//  19 Patrol/Recon
//  20 Transport/Support
User avatar
Zuikaku
General
Posts: 2394
Joined: Feb 10 2012
Human: Yes

Re: Req: different use of unit weighting results regarding AI unit building

Post by Zuikaku »

thank you! I have tested your file a bit.

AI is agressive and gives a good fight ,at least untill the first battle is lost. It seems that AI tends to send every single unit into attack leaving the whole territorry undefended. I've seen UK and US stripped of every unit. Mexico can simply overrun undefended US.

Stock file AI seems to send only surplus units into attack using the rest for defense, resulting in slower offensives and longer wars. Not really sure what is better :-?
Please teach AI everything!
User avatar
Uriens
Brigadier Gen.
Posts: 588
Joined: Oct 05 2005

Re: Req: different use of unit weighting results regarding AI unit building

Post by Uriens »

I'm doing a lot of testing while working on my mod. AI seems to overcommit when it's set to aggressive. If it isn't on aggressive, it will have defenses on key points (usually high population cities and military bases). What AI uses depends a lot on what mode hes currently on. If hes losing, he will be on defensive and only sending reactive troops to incursions. I've set recon and mobile anti-tank units to be react units so that AI doesn't spend real offensive units on that task. Also, AI will try to build up forces before committing to another attack, which basically makes him set up offensives. That is not a bad strategy. He should also go defensive if he lost his main force and while defensive he will use different build queue then when hes using normal military buildup. For defensive he won't care so much about mobility but speed of production should have high priority. That basically means that, if AI is on defensive, it should build fast to produce units.
Much can be done about AI performance in game by changing its aggression levels. For example, North Korea on default tends to charge all in (probably because of greater numbers advantage) only to be slaughtered by fortified long range artillery and heavy K2 tanks and superior infantry from South Korea. After that South Korea just does a mopup of what remains and ends the war with great numbers, experienced troops and strong units. Very often they expand into China, India and take over pretty much most of Asia. All that because of North Korea doing stupid thing at the start of the game. In all my tests on unmoded Koreas, it was always South Korea that won. 100% of the times, no exception. However, after I changed only one thing to North Korea, it started winning some of her wars. Only thing I changed is that it goes defensive just before it declares war. When going defensive it never overcommits to an attack thus maintaining strong force while still doing minor attacks on its own. However, this time its South Korea that gets more aggressive, sometimes using some of it's artillery while attacking North Korea. Every time South Korea gets too close to take one of the cities, North Korea gets in with great numbers and repels the attacker usually inflicting great loses. This becomes basically an attrition war that very often lasts over a year. This actually suits North Korea most as they have cheap and fast to produce units while South Korean K2's and heavy infantry are actually hard to replace if killed. From my testing, this war can now end both ways, either North Korea manages to reduce South Korean forces enough to be able to win the war or South Korea does manage to inflict enough loses on North Korea and eventually push north and win. It's anyone's game and that's exactly how I want it. All that by changing only one setting. In my experience, going aggressive makes a region commit nearly everything in the massive offensive which can work great if that region has large military advantage over the enemy. However, if smaller nation, going aggressive can be a suicide so setting that nation to defensive can actually work much better. I'm currently testing some conditional events that should allow me to set a nation to conquest/aggressive if that nation is not in any war, go opportunistic/aggressive if it's in one war and go opportunistic/defensive if in two or more wars. First results actually look promising. Come to think of it, in my latest games I had in my mod, I didn't really see any nation lose everything in their attacks, so I guess some changes I made did help the issue.

It should be noted that there are 2 different 'defensive modes' I'm referring to. First one is AI stance setting that can be, aggressive, defensive, normal, passive, and unpredictable. This thing can be changed via events (which is how I do it). Other 'defensive mode' is actually chosen by AI minister that mostly depends on what the situation is or what settings you use for the minister if played by human. This is what AI will use if it's currently losing the war, for example. It will also use different build queues set in that AI file I posted.
Post Reply

Return to “Suggestions - SRU”