My obsession

Based on Atomic Games’ award-winning Close Combat series, Close Combat: The Longest Day brings together the classic top-down tactical gameplay from the original series and plenty of new features, expansions, and improvements! The Longest Day remake comes with a brand new Grand Campaign that covers all the airborne and beach landings, expanded map sizes, new hand-drawn historical maps, illumination during night battles and much more!
Post Reply
wallach79
Posts: 10
Joined: Sat Aug 02, 2014 12:12 am

My obsession

Post by wallach79 »

Hi Steve,

and/or anyone else from Matrix who do a favor an answer to me.

I played old CC series from long time, it's the only game that I play. Single-player only. I read all the complaints on this forum about AI's performance before registered here. They are right as I know from experience.

I tried to improve AI's performance using my modding skills. If you enter bgroups file from Data folder of any CC game there are some numbers at each battlegroup with Commanders qualities that sounds very nice in theory. Quote:

The aggression of the BG commander. -5 makes BG commander timid in battle plans, +5 makes for aggressive battle plans. Range = -5 to 5

The caution of the BG commander. -5 makes BG commander hold no reserves, +5 makes BG Commander hold lots of reserves. Range = -5 to 5

The charisma of the BG commander. -5 takes morale away from troops, +5 gives morale to troops-5 takes morale away from troops, +5 gives morale to troops. Range = -5 to 5

The tactics used by the BG commander. -5 means BG commander does not use full tactical plans, +5 means that the BG commander uses all tactical plans. Range = -5 to 5

I played a bit with these values changing them, trying to improve AI's behavior. However, I feel blind because I don't know the algorithm that AI uses with these numbers.

If I know the algorithms (not the code but the way it works) I would understand the "mystery" of much blasphemed AI! E.g. what means "tactical plans" in computer instructions? How is that different from "aggression", etc?

Best regards,
Daniel

User avatar
SteveMcClaire
Posts: 4303
Joined: Mon Nov 19, 2007 9:31 pm

RE: My obsession

Post by SteveMcClaire »

The exact code is complex and goes through several different systems. It also varies version to version. But one thing you want to look at is the 'base battle plans' in campaign.txt. These control the default behavior of one BG vs. another. If you want more attacking from the AI, set all these to '0'

Aggression is how much the commander favors attack over defense. However this is only one factor in deciding whether to attack or not, and how much risk to take when doing so. There is also the base battle plans in campaign.txt that plays a huge role in deciding if a BG attacks or defends on the tactical map. Other factors include the strength of the enemy BG vs. the friendly BG and the overall situation of the campaign.

Caution is used to determine how many and what teams are assigned to the reserve group, if any. It is fairly straightforward. If you want more AI teams on the front line fighting, give them a -5 caution.

Charisma has a minor effect on the morale of teams at the start of the battle. It is usually not significant enough to notice unless you've fought a BG down to near exhaustion. It has no effect on tactics or attack/defense decisions.

Tactical plans are the basic strategies the AI uses -- frontal attack, flanking attack, double envelopment, etc. The worse the commander's tactics score the less of these he has to choose, and the simpler the plans are. Low tactics levels will result in piecemeal attack and defense, or simple 'line up and fight' strategies. This does not effect aggressiveness directly, just what plan is chosen once an 'attack' or 'defend' posture is decided upon.

Steve
wallach79
Posts: 10
Joined: Sat Aug 02, 2014 12:12 am

RE: My obsession

Post by wallach79 »

Thanks for the answer, I think it's a good start to elaborate more and clarifying my understanding of CC AI.

While I know about campaign.txt (and of course, I modified it), I don't know if it influences AI's behaviour only in campaigns or in single battles too? And if you change numbers values during a campaign, they will have an influence on that campaign or they will influence only a new campaign?

Anyway, let's look a bit at AI performance in few situations. Many players complained and I support this that when AI should defend, it's leaving from good defensive ground to be butchered. Even if you set battlegroup behaviour to 3 (defend) in campaign.txt and aggression to -5. So, something isn't right.

On the other hand, the AI is sending many times a few squads only to be butchered in limited or probe attacks. Again, ineffective behaviour.

I believe a problem is (and now I am quoting you) that 'the exact code is complex and goes through several different systems'. Complexity and the fact that it goes through different systems may cause conflicts between AI instructions and the result is that AI neither attacks well, nor defends good.

I think simplicity rules. So, instead of five base battle plans in campaign.txt (all out attack, limited attack, probe attack, defend and survive) I would choose only two: all out attack and defend or survive. The intermediary plans (limited attack and probe attack) result only in wasting AI resources in weak attacks.

I am curious about algorithms in CC.TLD because conflicts can exist even between commanders qualities. Which is the sequence of decision between them, because if AI is full of tactical plans (5) but its aggression is -5, it will be logically to don't apply so many tactical plans but defend more static. Btw, tactical plans notion makes sense just in rereleases because in CC5 I never saw such subtleties as 'flanking attack, double envelopment, etc' from AI's side. I really don't know what was the point of this quality in CC5 when AI was so rudimentary then.

I try to understand the details for these shortcomings to be reduced and the game to be more challenging even against AI.

Daniel
User avatar
SteveMcClaire
Posts: 4303
Joined: Mon Nov 19, 2007 9:31 pm

RE: My obsession

Post by SteveMcClaire »

Yes, battle plans settings will influence single battles, and they will influence a campaign already in progress.

It is not really practical for me to try and explain the AI in detail -- first, it is a lot of information, and second, explaining the internal workings of the AI (which you cannot modify) would not help you with what you want to do.

The things you can modify in the data files will allow you to either make the AI more aggressive or less aggressive, in general. You cannot modify it to be both more and less aggressive on a conditional basis. Sorry.

The closest thing I can think of is to try setting commander tactics to -5 and see if the limited number of battle plans the AI can choose from at this level is closer to what you want.

Steve
wallach79
Posts: 10
Joined: Sat Aug 02, 2014 12:12 am

RE: My obsession

Post by wallach79 »

First, thank you for what you've told me so far.

I didn't expect of course to explain me ALL AI in detail because, obviously, is a lot of information. However, I think an example of how AI works (in detail[:)]) would not kill anyone.

Maybe from such change of opinions could result a new patch with an improved AI, I believe. The AI was improved from old CC5 but it is still a (big!) room for improvement.

If I were from Matrix team I would discuss with passionate players even in detail how to improve AI.

Those were my two cents.

Daniel
User avatar
SteveMcClaire
Posts: 4303
Joined: Mon Nov 19, 2007 9:31 pm

RE: My obsession

Post by SteveMcClaire »

Daniel,

I appreciate your enthusiasm. To give you a complete example of how the AI works I would basically need to explain it all, however. If there are specific aspects of the AI you'd like to understand better, I can probably give you a general idea how bits and pieces work without it getting too long and involved.

And of course you're welcome to give your thoughts and feedback on the AI for future versions of the game.

Steve
wallach79
Posts: 10
Joined: Sat Aug 02, 2014 12:12 am

RE: My obsession

Post by wallach79 »

Steve,

I am glad you appreciate my enthusiasm. I don't know how long or involved our discussion will go but I want to be a pleasant one not a torture.

I will concentrate on a single problem per post because, as you know, AI is an elephant.

First, which is the basic percent or basic number of teams that AI will use to attack in the case of each base battle plan if we don't take into account commanders qualities?

I want to know something like:
1. all out attack - 100% - 15 teams
2. limited attack - 66% - 10 teams
3. probe attack - 33% - 5 teams
4. defend - 0% - 0 teams
5. survive - ?

Asking to much?[8|]

Daniel

User avatar
SteveMcClaire
Posts: 4303
Joined: Mon Nov 19, 2007 9:31 pm

RE: My obsession

Post by SteveMcClaire »

The attack/defend decision is based on the strength of the force, which is a value arrived at by evaluating all the teams for each side. A Panther tank is worth far more than a sniper team, for example. So the exact number of teams isn't the primary factor.

The initial state is the base battle plan from Campaign.txt, for the given BG matchup (i.e. infantry vs. armor, etc.)

This base plan will be adjusted up or down one level of aggressiveness based on the aggressiveness of the commander, the 'depth' of the battlegroup (how many teams it has left in its force pool), the strength ratio of the two sides, and whether or not the enemy is winning the operation/campaign.

In addition to this, there is a final check that is made -- if the battlegroup is /just/ entering the map this turn, it will always start with a minimum of a limited attack, to try and take territory. If a battlegroup is in position on a map and the enemy has just moved onto it, the battlegroup will start with a maximum of 'defend' aggressiveness.

Steve



wallach79
Posts: 10
Joined: Sat Aug 02, 2014 12:12 am

RE: My obsession

Post by wallach79 »

ORIGINAL: Steve McClaire

The attack/defend decision is based on the strength of the force, which is a value arrived at by evaluating all the teams for each side. A Panther tank is worth far more than a sniper team, for example. So the exact number of teams isn't the primary factor.

I wasn't referring how AI decides whether to attack or defend but how many teams it will use for this aim in a base battle plan. E.g. The number of teams that it uses to attack in a limited attack scenario. Which are these numbers in the base battle plans if we don't take into account other factors?
ORIGINAL: Steve McClaire

The initial state is the base battle plan from Campaign.txt, for the given BG matchup (i.e. infantry vs. armor, etc.)

This base plan will be adjusted up or down one level of aggressiveness based on the aggressiveness of the commander, the 'depth' of the battlegroup (how many teams it has left in its force pool), the strength ratio of the two sides, and whether or not the enemy is winning the operation/campaign.

I really discover new information. I knew some of these factors but others I would not have guessed. So even the force pool has an influence on AI decision to attack! After AI takes into account all these variables will ultimately fall into one of the five base battle plans, the only differences remaining the caution and tactics, right?

ORIGINAL: Steve McClaire

In addition to this, there is a final check that is made -- if the battlegroup is /just/ entering the map this turn, it will always start with a minimum of a limited attack, to try and take territory. If a battlegroup is in position on a map and the enemy has just moved onto it, the battlegroup will start with a maximum of 'defend' aggressiveness.


I didn't know that, either.

Thank you, Steve. I am waiting further details.

Daniel
User avatar
SteveMcClaire
Posts: 4303
Joined: Mon Nov 19, 2007 9:31 pm

RE: My obsession

Post by SteveMcClaire »

ORIGINAL: wallach79
I wasn't referring how AI decides whether to attack or defend but how many teams it will use for this aim in a base battle plan. E.g. The number of teams that it uses to attack in a limited attack scenario. Which are these numbers in the base battle plans if we don't take into account other factors?

The AI divides its teams into internal groups. A recon group, a support group, a reserve group, and 1-3 combat groups. Some of these groups may have zero teams in a weak battle group. The higher the commander's caution, the more teams he will want in his reserve group. So -5 caution would cause the maximum number of teams to be committed at the start. Otherwise you can't directly influence what team goes in what group save by team selection on the battle group screen (recon teams, armored cars, etc. will tend to be used in the recon group. HMGs and mortars go in the support group. etc.)

Steve
wallach79
Posts: 10
Joined: Sat Aug 02, 2014 12:12 am

RE: My obsession

Post by wallach79 »

ORIGINAL: Steve McClaire

The AI divides its teams into internal groups. A recon group, a support group, a reserve group, and 1-3 combat groups. Some of these groups may have zero teams in a weak battle group. The higher the commander's caution, the more teams he will want in his reserve group. So -5 caution would cause the maximum number of teams to be committed at the start. Otherwise you can't directly influence what team goes in what group save by team selection on the battle group screen (recon teams, armored cars, etc. will tend to be used in the recon group. HMGs and mortars go in the support group. etc.)

Steve

What if you set both aggression and caution to -5 ? Wouldn't be that a somewhat conflicting setting for AI ? How it will read this setting ?

Daniel
User avatar
SteveMcClaire
Posts: 4303
Joined: Mon Nov 19, 2007 9:31 pm

RE: My obsession

Post by SteveMcClaire »

Cautions controls only the number of teams held in the reserve group. Higher aggression makes the AI more likely to attack, and more likely to make an all-out attack when it does so. Low aggression makes the AI more likely to defend, and more likely to use a limited attack when it does attack.

-5 Caution = keep the smallest possible number of teams in reserve.

-5 Aggression = Be defensive in most situations and make only cautious attacks.

Steve
wallach79
Posts: 10
Joined: Sat Aug 02, 2014 12:12 am

RE: My obsession

Post by wallach79 »

1. My query was how AI can be defensive (-5) when it keeps the smallest possible number of teams in reserve (-5)? If it defends it must keep most if not all its forces in reserve.

2. What is the difference between DEFEND and SURVIVE battle plans from campaign.txt for AI?

Daniel
User avatar
SteveMcClaire
Posts: 4303
Joined: Mon Nov 19, 2007 9:31 pm

RE: My obsession

Post by SteveMcClaire »

The reserve is simply the teams in a reserve group. Defensive posture with a small reserve simply means most of the teams are forward to meet the enemy at the start.

DEFEND = Try to hold as many of your VLS as you can.
SURVIVE = Only try to hold your exit VL so you can retreat off the map.

Steve
wallach79
Posts: 10
Joined: Sat Aug 02, 2014 12:12 am

RE: My obsession

Post by wallach79 »

ORIGINAL: Steve McClaire

The reserve is simply the teams in a reserve group. Defensive posture with a small reserve simply means most of the teams are forward to meet the enemy at the start.

Could I think from your explanation that AI is placing teams on map forward or behind according to commander's caution ? I mean the position BEFORE the start of battle not how it uses the teams according to caution DURING the battle. If it does this than it's smarter than I thought.
ORIGINAL: Steve McClaire

DEFEND = Try to hold as many of your VLS as you can.
SURVIVE = Only try to hold your exit VL so you can retreat off the map.

Thanks for this clarification too. Your explanations are reasonable from a human point of view and I only wish AI to be so proficient as these imply.

Now, if I know the difference between Defend and Survive battle plans, could you tell me what 'probe attack' and 'limited attack' mean in AI's behaviour? I don't ask about 'all out attack' battle plan because I think is obvious.

Daniel
User avatar
SteveMcClaire
Posts: 4303
Joined: Mon Nov 19, 2007 9:31 pm

RE: My obsession

Post by SteveMcClaire »

ORIGINAL: wallach79
Could I think from your explanation that AI is placing teams on map forward or behind according to commander's caution ? I mean the position BEFORE the start of battle not how it uses the teams according to caution DURING the battle. If it does this than it's smarter than I thought.

That is correct.
Now, if I know the difference between Defend and Survive battle plans, could you tell me what 'probe attack' and 'limited attack' mean in AI's behaviour? I don't ask about 'all out attack' battle plan because I think is obvious.

When attacking the AI will choose a Victory Location as its ultimate objective. For an 'All Out Attack' this will (generally) be the VL the AI wants to use to leave the map. So it will attack all the way across the map from where it started. A 'Limited Attack' tends to aim for capturing VLs near the center of the map. A 'Probing Attack' means the AI wants to capture one VL near its starting locations.

Steve
wallach79
Posts: 10
Joined: Sat Aug 02, 2014 12:12 am

RE: My obsession

Post by wallach79 »

Hi Steve,

Thanks for the last clarifications. You can edit campaign.txt file in new releases of CC series but if you don't know in details what really AI does, it wouldn't help you too much. I did't read this info in any game manual.

I understand now better from your statements that there are many factors involved. I'm playing now Kharkov mod for CC:TLD. I will try to use well your info to tweak it a bit in my campaign.

Daniel

User avatar
SteveMcClaire
Posts: 4303
Joined: Mon Nov 19, 2007 9:31 pm

RE: My obsession

Post by SteveMcClaire »

The ability to mod values was given so that mod makers would have the ability to mod aspects of the game they never could before (like these AI settings). Modding is a small but important part of the CC community, but the ability to mod the game has never been an official 'feature' of any CC release. It's an unofficial 'bonus' and a nod to the modding community.

Steve
wallach79
Posts: 10
Joined: Sat Aug 02, 2014 12:12 am

RE: My obsession

Post by wallach79 »

I made a summary based on your answers until now. It serves to my understanding and maybe to others interested in CC AI.

About AI in CC rereleases

Battle plans

The initial state is the base battle plan from Campaign.txt, for the given BG matchup (i.e. infantry vs. armor, etc.)

This base plan will be adjusted up or down one level of aggressiveness based on:
1.the aggressiveness of the commander
2.the 'depth' of the battlegroup (how many teams it has left in its force pool)
3.the strength ratio of the two sides, which is a value arrived at by evaluating all the teams for each side. A Panther tank is worth far more than a sniper team, for example.
4.whether or not the enemy is winning the operation/campaign.
5.in addition to this, there is a final check that is made -- if the battlegroup is /just/ entering the map this turn, it will always start with a minimum of a limited attack, to try and take territory. If a battlegroup is in position on a map and the enemy has just moved onto it, the battlegroup will start with a maximum of 'defend' aggressiveness.

When attacking the AI will choose a Victory Location as its ultimate objective.
1.For an 'All Out Attack' this will (generally) be the VL the AI wants to use to leave the map. So it will attack all the way across the map from where it started.
2.A 'Limited Attack' tends to aim for capturing VLs near the center of the map.
3.A 'Probing Attack' means the AI wants to capture one VL near its starting locations.
4. Defend = Try to hold as many of its VLS as it can.
5. Survive = Only try to hold its exit VL so it can retreat off the map.

Commander's qualities

Aggression is how much the commander favors attack over defense. Higher aggression makes the AI more likely to attack, and more likely to make an all-out attack when it does so. Low aggression makes the AI more likely to defend, and more likely to use a limited attack when it does attack.

Eg. -5 Aggression = Be defensive in most situations and make only cautious attacks. Defensive posture with a small reserve (-5 Caution) simply means most of the teams are forward to meet the enemy at the start.

Caution is used to determine how many and what teams are assigned to the reserve group, if any. The higher the commander's caution, the more teams he will want in his reserve group .

Eg.If you want more AI teams on the front line fighting, give them a -5 caution. So -5 caution would cause the maximum number of teams to be committed at the start.

Charisma has a minor effect on the morale of teams at the start of the battle. It is usually not significant enough to notice unless you've fought a BG down to near exhaustion. It has no effect on tactics or attack/defense decisions.

Tactical plans are the basic strategies the AI uses -- frontal attack, flanking attack, double envelopment, etc. The worse the commander's tactics score the less of these he has to choose, and the simpler the plans are. Low tactics levels will result in piecemeal attack and defense, or simple 'line up and fight' strategies. This does not effect aggressiveness directly, just what plan is chosen once an 'attack' or 'defend' posture is decided upon.

AI Internal Groups

The AI divides its teams into internal groups:
1.a recon group,
2.a support group
3.a reserve group
4.1-3 combat groups.
Some of these groups may have zero teams in a weak battle group.

Daniel

PS. "If a battlegroup is in position on a map and the enemy has just moved onto it, the battlegroup will start with a maximum of 'defend' aggressiveness." Nevertheless, AI's infantry battlegroup attacked my armour battlegroup in the first turn, losing its only Stug III.
User avatar
SteveMcClaire
Posts: 4303
Joined: Mon Nov 19, 2007 9:31 pm

RE: My obsession

Post by SteveMcClaire »

PS. "If a battlegroup is in position on a map and the enemy has just moved onto it, the battlegroup will start with a maximum of 'defend' aggressiveness." Nevertheless, AI's infantry battlegroup attacked my armour battlegroup in the first turn, losing its only Stug III.

The initial battle plan of the BG should be 'defend', but the battle plan is re-evaluated by the AI as the game goes on. If the Infantry BG had a large advantage of strength/depth and/or an aggressive commander it could decide to switch over to the attack after a few minutes.

Steve

Post Reply

Return to “Close Combat: The Longest Day”