Jump to content

A concern related to AI scripting


Recommended Posts

This may be a bug, or I just need some education:

I have been spending a little time learning about groups, map zones, orders etc. in the Editor, using one of the included scenarios has my test bed (using the Scenario Editor mode for running the scenario). It's obvious how easy it can be to handicap the AI if you aren't pretty careful will all of those things.

However: the order options are Dash, Quick, Advance, Assault, Max Assault. AFAICT, none of these orders will cause the AI units to employ Move or Hunt (contrary to the manual, which implies that Advance will use these). In the case of Advance, those units that can use Assault do so, and the other units (except Mortars and perhaps other exceptions) use Quick, at about the same time. As a result, HQs and various teams such as bazookas end up at the next map zone before everyone else (unless they are killed on the way). This, I am sure, is why I have seen these units leading everyone else into the combat zone (as noted in another thread). It appears that when Assault is the order, the HQs, etc., will wait and move when things are a safer. I have not yet totally figured out how Assault and Max Assault differ, but that's for the future.

In any event, I think something is wrong with the Advance order. But I am prepared to be educated. :)

Link to comment
Share on other sites

A second concern has to do with deployable weapons. Not sure what types of units are affected by this, but I notice that when I set a mortar to be undeployed, so that it can move out with its platoon right away, the AI always deploys it immediately and later undeploys to move. The result is that the mortar will frequently get out of C2 until it catches up with the platoon.

I think it's possible that this behavior is intentional. If so, I just wanted to point out a drawback.

Edit: Actually the behavior here isn't consistent (perhaps is different if the mortar comes in as reinforcement). And the mortar seems to stay put for a long time even if undeployed. So that is probably intentional.

Link to comment
Share on other sites

In addition to the above, the AI apparently does not have the programming to keep a mortar or bazooka unit out of a building. If an AI platoon is on the move, and the map zone includes a building plus open space, the mortar and/or bazooka unit is likely to end up in the building. There is no work around except to create separate groups for them, which is an impractical level of micromanagement.

There is also no programming to keep a unit from slow crawling until it is too fatigued to fight. This was also true in CM1, but may be a more common problem if the AI scripting calls for maximum assault.

And the mortar crews take way too long to catch up to their platoons when they are on the offensive. A 90 second to 2 minute delay is not uncommon (using the Quick order). It's possible that this problem would go away if the Advance order worked differently.

Link to comment
Share on other sites

Its really a question of getting used to the scenario editor and what it can and can't do, paying attention to what orders you give, giving the AI enough time to move its troops, paying attention to the area you order them to (for example, not letting the objective area be a building for mortars). You can approximate a human response, but it will never be perfect.

It does require some micro management, but once you get used to it, setting up the AI plans is usually not the most time consuming factor in scenario creation, usually creating the map in the first place takes the most time.

On your specific questions, I never really noticed any difference between Assault and Max Assault, both are supposed to emphasize combat over movement, but in my experience the AI moves too slowly for my taste. Advance is usually the best compromise to get the AI to move where you want it too.

IMHO, the biggest problems in the scenario editor now are, first, the fact that the number of AI groups is limited to 8, which makes it hard to structure the AI plan as finely as I would like and second, the lack of triggers, where for example the player reaching a certain objective would trigger the implementation of a AI plan. Right now if want to, say, provide for a counter attack by the AI, you have to guess where the player will be after a certain time. Both are on the wish list, if and when the editor is revised.

Link to comment
Share on other sites

Advance is usually the best compromise to get the AI to move where you want it too.

So you are saying that Advance is working correctly? You are saying that it's OK that there is no AI Plan order which directs the AI to use Move or Hunt (meaning AI units can only use Fast, Quick, or Assault)? You are saying that it's OK that Advance causes HQs, bazooka teams, etc., to rush ahead to the next Map Zone even when that zone is subject to enemy fire? You are saying it's OK for mortar crews and bazooka teams to end up in buildings?

I'm just repeating some things in my previous posts, because I am still hoping to get specific answers to questions such as this. So far, I have to been unable to see any way to make a logical AI Plan when the AI is on the attack, at least with infantry. But I am willing to be educated. I have not yet investigated how all of this works with armor.

Link to comment
Share on other sites

Keeping AI plans simple is important but with that said we do need more groups then we could control hqs better by asigning them to a group.

The other thingy that needs to change is the assignment of specialist or single vehicles down to company HQs and Platoon HQs, Right now they are assigned to Battalion HQ.

Link to comment
Share on other sites

So you are saying that Advance is working correctly? You are saying that it's OK that there is no AI Plan order which directs the AI to use Move or Hunt (meaning AI units can only use Fast, Quick, or Assault)? You are saying that it's OK that Advance causes HQs, bazooka teams, etc., to rush ahead to the next Map Zone even when that zone is subject to enemy fire? You are saying it's OK for mortar crews and bazooka teams to end up in buildings?

I did not say that, I said Advance will get them to move more or less where you want more or less when you want them to, although not in any useful tactical formation. The AI is not good in attacking. If you break it down in many AI groups, you can control more or less how they advance, so some will provide overwatch, some will attack, some will stay back. The biggest problem is the limited number of AI groups.

If you want those of us who have designed scenarios to help you figure out how to get the most out of the scenario editor in its current form, adopting an aggressive tone is not the way to go.

Link to comment
Share on other sites

Hmmm ... This isn't working, but perhaps I need to give a specific example:

If I have a group consisting of a infantry platoon, and in the AI Plan I give that group an Advance order to another Map Zone, this is what happens:

1. The Squads all move using Assault. Which is slow and tiring and usually inappropriate to the situation on the map.

2. The HQ and other teams, such as mortars and bazooka, all move using Quick.

3. They all start moving at the same time, except for the mortar(s).

4. The HQ and the bazooka team outrun the squads and arrive at the new Map Zone first. This usually means they get shot at first.

5. There are no units (AFAICT) that will move using Move or Hunt, no matter what order you give for that group.

6. So far, I have not been able to see any place in a scenario where Advance, as I have described it, is useful.

7. I think the Advance Order may not be working as designed, but perhaps it is only in the Mac version of the game.

If the game is working as designed, then my conclusion is that 95% of the time the only useful orders are Quick and Assault. But I have not been able to script the AI to produce good results using just those orders most of the time. I got into this investigation because I noticed some strange behavior by the AI when it was the attacker, so I wanted to figure out why that was. One of the key reason, I believe, is that the AI Plan was using the Advance command quite frequently.

I hope that doesn't sound aggressive. :)

Edit: Checking out a couple more scenarios makes me think that what I am seeing is not a Mac-specific issue. For example, the American Tanks in Barkmann's Corner move using Quick even though they are given the Advance order in the AI Plan -- so they move the same way as if they had been given the Quick order.

2nd Edit: Actually, Tanks given the Advance order use Fast -- Advance = Dash. Tanks given the Assault order use to a combination of Fast and Quick. As with infantry, there is no way to get the tanks to use Move or Hunt. Which is why Barkmann's Corner turns into such a turkey shoot for the Germans.

Link to comment
Share on other sites

SteveP, thanks for testing this.

I have only followed what the Manual says, and never looked into it further, even while making several different QB maps and giving them AI plans. My playtest consisted of me playing one side or the other, and in general things happened on time and as scripted...more or less...but I never experimented with any orders other than "Advance", and assumed they used, er..."Advance" most of the time. I never watched, say, a whole platoon or company execute their plan from beginning to end. Thanks to this thread, I will this weekend, just to see how Assault and Quick actually do execute those orders.

Link to comment
Share on other sites

SteveP, I PMd you my email address, send me your scenario and I will see what the problem is and report back. I have an idea what the problem is, but it will be quicker if I can check it out.

This can also be useful, the manual just brushes the surface of what you can do with the scenario editor.

http://homepage.mac.com/gibsonm1/CMSF/FileSharing24.html

Always glad to help out. :)

Link to comment
Share on other sites

Edit: Checking out a couple more scenarios makes me think that what I am seeing is not a Mac-specific issue. For example, the American Tanks in Barkmann's Corner move using Quick even though they are given the Advance order in the AI Plan -- so they move the same way as if they had been given the Quick order.

This is not Mac-specific. The Windows and Mac versions are identical in this regard.

The differences between AI movement types are subtle and situational.

Link to comment
Share on other sites

Keeping AI plans simple is important but with that said we do need more groups then we could control hqs better by asigning them to a group.

The other thingy that needs to change is the assignment of specialist or single vehicles down to company HQs and Platoon HQs, Right now they are assigned to Battalion HQ.

You can assign individual vehicles and specialist teams to any HQ level. When you select the specialist sections you will see a little arrow on the command level you are assigning the team to. If you select a platoon commander the arrow will point to a platoon commander and your specialist team or vehicle will be assigned to that platoon.

Link to comment
Share on other sites

SteveP, I PMd you my email address, send me your scenario and I will see what the problem is and report back. I have an idea what the problem is, but it will be quicker if I can check it out.

No need. As I said in my first post, I am using one of the included scenarios (Vierville) and doing small edits to see what happens with the included script and with slightly different scripts. You can take any of the scenarios. Check out the groups and the AI plan for a group, so that you see which ones have Advance orders and where. Then use Scenario Author Test mode. Set it to Show All Paths. Click on any of the AI run units, and you will see all of the paths for all the AI units. Look what paths you get when a group attempts to execute an Advance order.

While you are at it, you can attempt to see any evidence that an AI-run unit ever uses Move or Hunt. I have never seen it, but I'm willing to be agnostic on it. :)

Link to comment
Share on other sites

The differences between AI movement types are subtle and situational.

I believe that what I am seeing happens every time, in every scenario and QB. I am sure that, at some point, people will start to check this out for themselves. If anyone sees contrary results, I will be happy to try and figure it out why that might be the case.

Link to comment
Share on other sites

Hmmm ... This isn't working, but perhaps I need to give a specific example:

If I have a group consisting of a infantry platoon, and in the AI Plan I give that group an Advance order to another Map Zone, this is what happens:

1. The Squads all move using Assault. Which is slow and tiring and usually inappropriate to the situation on the map.

That all depends upon how far apart your waypoints are. The main thing about waypoints is that the AI is at it's most vulnerable to the player when moving between waypoints.

2. The HQ and other teams, such as mortars and bazooka, all move using Quick.

Yes

3. They all start moving at the same time, except for the mortar(s).

Hmm, sometimes they do, but not always.

4. The HQ and the bazooka team outrun the squads and arrive at the new Map Zone first. This usually means they get shot at first.

Platoon HQs usually lag way behind. Small units like scout teams, independent bazooka teams, HQ support, and XO teams generally will lead the way - that's true. I suspect this is to allow small units to sniff out ambushes rather than having an entire squad get ambushed.

5. There are no units (AFAICT) that will move using Move or Hunt, no matter what order you give for that group.

Yes, that's true. I suspect that it's because the AI isn't smart enough to know when the enemy will engage them, so if your group gets surprised in between waypoints your truppen will continue on to the next waypoint regardless of what the player is doing to them. So if you gave your truppen a 'walk' command and the player ambushed them, well the AI would just keep on walking while getting annihilated. At least if they are doing some bounding overwatch they have an opportunity to return fire while getting annihilated. edited to add that the Hunt command as currently designed cancels the order when the truppen make contact. Obviously with the AI a cancelled order wouldn't work too well since the truppen who were hunting would then just sit in place after making contact for the rest of the scenario.

6. So far, I have not been able to see any place in a scenario where Advance, as I have described it, is useful.

Depends on what you are trying to do

7. I think the Advance Order may not be working as designed, but perhaps it is only in the Mac version of the game.

I think it's safe to say that it's working as designed. It's just not designed to do what you would like it to do. ;)

If the game is working as designed, then my conclusion is that 95% of the time the only useful orders are Quick and Assault. But I have not been able to script the AI to produce good results using just those orders most of the time. I got into this investigation because I noticed some strange behavior by the AI when it was the attacker, so I wanted to figure out why that was. One of the key reason, I believe, is that the AI Plan was using the Advance command quite frequently.

I hope that doesn't sound aggressive. :)

Edit: Checking out a couple more scenarios makes me think that what I am seeing is not a Mac-specific issue. For example, the American Tanks in Barkmann's Corner move using Quick even though they are given the Advance order in the AI Plan -- so they move the same way as if they had been given the Quick order.

2nd Edit: Actually, Tanks given the Advance order use Fast -- Advance = Dash. Tanks given the Assault order use to a combination of Fast and Quick. As with infantry, there is no way to get the tanks to use Move or Hunt. Which is why Barkmann's Corner turns into such a turkey shoot for the Germans.

Different waypoint location choices might make it less of a turkey shoot too. Perhaps if the American tanks stopped just after the hedgerow and delayed for five minutes rather than moving straight up to the buildings your result might be different. You're going to get out of the AI what you put into it. If you want to put something together that's quick and dirty it's going to be easy to defeat. If you spend a lot of time with it you will get an AI plan that's a little more robust.

Link to comment
Share on other sites

ASL Vet, just to keep confusion at a minimum, I assume by waypoints you mean the orders "painted" on the map, right?

No, I think he hasn't been following this thread correctly. I have to assume he thinks I am talking about giving commands during a battle. But, of course, I am talking about scripting the AI Plan when creating a scenario or a QB.

That's OK. I just don't have any way to respond to his post. :)

Link to comment
Share on other sites

No, I think he hasn't been following this thread correctly. I have to assume he thinks I am talking about giving commands during a battle. But, of course, I am talking about scripting the AI Plan when creating a scenario or a QB.

That's OK. I just don't have any way to respond to his post. :)

No, I understood your post correctly. By waypoints I am indeed referring to the points painted onto the map. They are considered waypoints because those are the 'waypoints' that direct the AI's direction of movement and the timing thereof (using the before and after orders which you have apparently not discovered yet). Steve P, maybe when you've spent more time with the AI we can have an informed discussion about it. I have amassed many hours of time working with the AI over the last couple of months and I'm just trying to give you some friendly pointers in making it work for you. If you choose to ignore my assistance then that's obviously your choice.

Link to comment
Share on other sites

Just to expand a bit on the Hunt command. You have to think about it a bit, but you will get there. First, let's just assume for the sake of argument that there is a hunt command for the AI to use. On the way to the next waypoint the AI becomes engaged and stops moving. Great, now what happens? All the AI knows is that it wants to get to the next waypoint - it may be engaging the enemy but as far as the AI plan goes that's irrelevant. The AI just wants to get to the next "painted on the map at whatever size you choose to paint waypoint" This waypoint can be fifty actions spots big, but as far as the AI is concerned it's just a waypoint - I hope that's clear.

Okay, so your truppen have stopped with the hunt command, what happens next? Do they then hunt again and stop immediately when the next enemy shot comes? You see, the problem with the hunt command for the AI is that the AI is situationally dumb other than what you are telling it to do by going to painted on the map zone x. So as long as the AI truppen haven't reached that point it will continue to try to reach it. With a hunt command that obviously ends that movement and perhaps would cause a logic loop. Would it be nice if the AI could be given orders on how to react to the enemy when between waypoints? Sure it would. That's not how it is right now though. The AI only thinks in terms of waypoints - it's either on a waypoint or trying to get to one. That's it.

Link to comment
Share on other sites

By waypoints I am indeed referring to the points painted onto the map.

OK. The manual, etc., calls them Map Zones. Waypoints generally refer to something else in the manual. It's difficult to respond when you use different terminology.

Link to comment
Share on other sites

However:

That all depends upon how far apart your waypoints are. The main thing about waypoints is that the AI is at it's most vulnerable to the player when moving between waypoints.

No, from my tests, the distance is not a factor

Yes

OK, we agree.

Hmm, sometimes they do, but not always.

Well, in my tests they move close to the same time.

Platoon HQs usually lag way behind. Small units like scout teams, independent bazooka teams, HQ support, and XO teams generally will lead the way - that's true. I suspect this is to allow small units to sniff out ambushes rather than having an entire squad get ambushed.

Using the Advance Order, the movement is always the same. Platoon HQs are always the first ones to get to the next Map Zone.

Yes, that's true. I suspect that it's because the AI isn't smart enough to know when the enemy will engage them, so if your group gets surprised in between waypoints your truppen will continue on to the next waypoint regardless of what the player is doing to them. So if you gave your truppen a 'walk' command and the player ambushed them, well the AI would just keep on walking while getting annihilated. At least if they are doing some bounding overwatch they have an opportunity to return fire while getting annihilated. edited to add that the Hunt command as currently designed cancels the order when the truppen make contact. Obviously with the AI a cancelled order wouldn't work too well since the truppen who were hunting would then just sit in place after making contact for the rest of the scenario.

This part I think is not related to the AI Plan scripting, or at least I can't think of how to respond to it.

Depends on what you are trying to do

Well, OK, but I was inviting someone to tell me how they would fruitfully use the Advance Order, as I described it.

I think it's safe to say that it's working as designed. It's just not designed to do what you would like it to do. ;)

No, I do not think it's safe to assume that. I would like an Order that caused the AI to use Move or Hunt. In that respect you are correct.

Different waypoint location choices might make it less of a turkey shoot too. Perhaps if the American tanks stopped just after the hedgerow and delayed for five minutes rather than moving straight up to the buildings your result might be different. You're going to get out of the AI what you put into it. If you want to put something together that's quick and dirty it's going to be easy to defeat. If you spend a lot of time with it you will get an AI plan that's a little more robust.

No, it's a turkey shoot, because the tanks rush up to the Panther, when I think the scenario designer thought they would Hunt their way up there. And I have spent a lot of time with the AI Plan scripting feature. More time than I have spent playing the game. :)

Link to comment
Share on other sites

Steve P, with all due respect you aren't 'getting it'. What you aren't getting is the fact that there are no triggers for the AI. The AI is either on a waypoint / mapzone or whatever you want to refer to it as, or it's trying to get to one. The AI doesn't have the capability to create it's own new randomly generated 'mapzone' upon contact with the enemy so the AI isn't going to stop moving in between mapzones for any reason. Period. If you don't understand this fundamental fact about the AI then you will always struggle with getting it to do what you want it to do.

A hunt command would require a trigger. Anything that involves something like "If X happens, then Y should be done" is going to be trigger based. There are no triggers currently available for the AI.

Link to comment
Share on other sites

I've only been testing plans since release, but it appears to me from what I understand of this thread that Max Assault and an Ambush setting is what SteveP MAY be looking for.

The truppen seem to crawl and engage more often(sit/terrain dependant ofc) than with other oders.

Ambush will have them engage only targets that are likely to impede their progress.

So, they won't stop every time they see a twig snap, but they will stop and fight relevant targets, while taking their time about it.

The terrain is a huge variable, and if you are tying yourself to a historical representation, then you may be tying your hands as well.

If you want your AI troops to accomplish something in a certain way... you may have to tweak the map to your needs. Your HQs WILL go to their deaths if you do not have the zones match the amount of units and terrain. Little space up front... HQ takes up little space ... you do the math. ;)

The spacing between, as well as the size and shape of each and every map zone in your plan will affect how your groups travel to and from each zone. THIS is probably the most granular part of the editor for getting your boys to do(more or less) what you want.

By adjusting the spacing, size and shape of your zones... you can turn a disorganised rabble into a formation that performs in an orderly, proficient and military manner. :D But be prepared for the vehicle 'criss-cross' maneuver that I have yet to find a solution for. Two or more vehicles in a combined arms group + any movement order to any close zone in any fashion = criss-cross flank-showing idiocy.

Link to comment
Share on other sites

It's interesting how difficult these things can be sometimes. :)

Don't worry about what you think I am "trying to do".

Thank about what the Advance order in an AI Plan is supposed to do (if you know). Then look at an actual battle using Scenario Author Test mode and see what the troops actually do when they are executing an Advance order.

That's just for starters, but it's a good place to start.

I am not going to respond any more to people who are telling me that I not seeing what I am seeing, or that I don't understand what I am seeing. Check it for yourself or decide that I'm delusional and move on to another thread. :)

Link to comment
Share on other sites

AI orders is something of a black art, even to the old hands. You open scenarios by different designers and find entirely different 'personalities' to their AI orders sets. Some fill all the slots in the AI orders set with finely choreographed troops movements. Others paint with a broad brish (quite literally) and rely on the AI's situational responses to drive the action.

An example are those mortar crew and HQ sometimes moving ahead of the main force. I tend to reserve AI group 1 for stationary units - spotters, AT & mg teams that you've placed where you want and don't want to move. No setup zones or movement orders - lock 'em in place. Second AI set might be units you want to keep in contact with the main force but not accompany them. Vehicles, HQ units, support weapons. Specific destinations and hard Exit After/Exit Before numbers so you know where they are and how long they're going to be there. The main force you can be as loose or as strick as you want. Attack as a horde with broad brush AI movement orders and default Exit After/Exite Before times. Or construct a highly choreographed plan thats mutually supporting, coordinated movement times, tailored to specific unit type and the nature of the terrain.

Frankly you can dash off a simple AI plan and have a great success or you can labor over it and come up with a stinker. All I can say is practice and test. :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...