AI Utility

Download scenarios and talk about scenario design.

Moderators: Slitherine Core, BA Moderators

Post Reply
acarhj
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 101
Joined: Wed Feb 27, 2008 3:20 am

AI Utility

Post by acarhj »

Hi all,

I understand how the AI is codified with the exponential numbers. However, I am wondering how these interact when they are combined. Lets say you combine the "guard position" code with the "seek out the enemy" code. Will the unit guard the position and only move when it has contact with the enemy or will it always stay put? Any other insights on AI combinations would be appreciated.

John
Merr
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 903
Joined: Mon Aug 16, 2010 2:00 pm

Post by Merr »

acarhj,

I think your combination would only work if there was a script to change the Teams Aggression .... There appears to only be some logical combo's, but your's won't work by itself (I think)...

Guard position (or stay dug in) is 64, whilst "seek out the enemy" is 0 ... so adding them together results in 64.
Now, the value of 16 shows "seek @ destroy" but I don't know if that's good anymore... All the seek @ destroy code examples(I've seen) show a 0 value for aggression.

Ok, now some good examples of "combo's" ... 1st, the PLUGIN for Victory Points has a script, where the enemy will stay put (64), but when a hostile VP is on the board, it will change to a 34 ...
... That's ... stay together(2) + use threat to look smarter(32) = 34. It appears that the AI will "do nothing" if there's no hostile VP, or if it captures the hostile VP it was going for, so it kind of "waits around" for another hostile VP to go after ... but, perhaps in the meantime it will "move around to stay together" ... It's really hard to judge.

Now, there are other functions that use Reative AI and such ... most examples can be found in the Functions.BSF ... such as, FUNCTION ReactiveAI(side).
This will ... Set idle units to "seek & destroy" when detected.

For the most part, I really haven't played with alternate combo's ... Sometimes during some tests it's hard to tell what the AI's thinking.
You'll have to drop some units on a blank map and twiddle the numbers a bit.

Merr
acarhj
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 101
Joined: Wed Feb 27, 2008 3:20 am

Post by acarhj »

Merr wrote:acarhj,

I think your combination would only work if there was a script to change the Teams Aggression .... There appears to only be some logical combo's, but your's won't work by itself (I think)...

Guard position (or stay dug in) is 64, whilst "seek out the enemy" is 0 ... so adding them together results in 64.
Now, the value of 16 shows "seek @ destroy" but I don't know if that's good anymore... All the seek @ destroy code examples(I've seen) show a 0 value for aggression.

Ok, now some good examples of "combo's" ... 1st, the PLUGIN for Victory Points has a script, where the enemy will stay put (64), but when a hostile VP is on the board, it will change to a 34 ...
... That's ... stay together(2) + use threat to look smarter(32) = 34. It appears that the AI will "do nothing" if there's no hostile VP, or if it captures the hostile VP it was going for, so it kind of "waits around" for another hostile VP to go after ... but, perhaps in the meantime it will "move around to stay together" ... It's really hard to judge.

Now, there are other functions that use Reative AI and such ... most examples can be found in the Functions.BSF ... such as, FUNCTION ReactiveAI(side).
This will ... Set idle units to "seek & destroy" when detected.

For the most part, I really haven't played with alternate combo's ... Sometimes during some tests it's hard to tell what the AI's thinking.
You'll have to drop some units on a blank map and twiddle the numbers a bit.

Merr
Thanks for the info Merr. I plan on starting the first scenario in a week or so. I've been a little ill as of late (nothing serious) so my gaming has slowed somewhat.

John
Merr
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 903
Joined: Mon Aug 16, 2010 2:00 pm

Post by Merr »

You're quite welcome ... You are not alone when it comes to figuring out what's going on.

If you're planning on your RF scenario's to be solo, then I might suggest you skip the AI and look towards MP scenarios. My reasoning is that you can spend days, weeks, and months trying to sort out the AI which pulls you away from the scenario design. I'm a horrible scenario designer but I have crazy concepts that I can only release "as is".

Besides, reading the MP threads, those guys are itching for new MP material .... perhaps your RF scenario's might be "up their alley".

Rob

Hope ya feel better!
pipfromslitherine
Site Admin
Site Admin
Posts: 9929
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

I'm pretty sure that setting the stay put flag will override anything else. Most of the values can be combined, but they tend to only work to give the AI a single behaviour, i.e. moving or holding firm, but not to move or stay put depending on the situation.

On the other hand, you can always rewrite the AI script logic ;)

Cheers

Pip
junk2drive
BA Moderator
BA Moderator
Posts: 1478
Joined: Sun May 23, 2010 4:47 pm
Location: Arizona USA -7GMT

Post by junk2drive »

Working on a square map. Human Axis in one corner, and the middle. AI Allies in the opposite corner, team 1, and middle team 0. Set team 1 to 16, search and destroy, with a point in the middle, team 0 to 64, stay put.

Start battle. Several turns later a few AI troops appear heading to the point. No AFVs.

Edit battle to team 1 at 0 aggression. Start battle. Within a few turns all the team 1 units are appearing, heading to the point.

I'm not sure what 16 is supposed to do but I looks like a setting of 0 is best if you want the AI to attack.
You can call me junk - and type that with one hand.
pipfromslitherine
Site Admin
Site Admin
Posts: 9929
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

Do you want them to seek and destroy, or head to a given point? If you want them to head to a given point, you need to give them a destination.

Cheerrs

Pip
junk2drive
BA Moderator
BA Moderator
Posts: 1478
Joined: Sun May 23, 2010 4:47 pm
Location: Arizona USA -7GMT

Post by junk2drive »

I gave them both, I guess that was the problem. I wanted them to seek and destroy, on their way to the point.

I guess it works to set them at 0 and give them a point. They will fight along the way.
You can call me junk - and type that with one hand.
pipfromslitherine
Site Admin
Site Admin
Posts: 9929
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

Yes - you can also tell them to stick together, or avoid the enemy, etc, while they move.

Cheers

Pip
acarhj
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 101
Joined: Wed Feb 27, 2008 3:20 am

Post by acarhj »

Before I placed VP locations on the board using the VP tool, my troops were staying dug in (as they should). After adding the VP tool, all of the units in 2 of three groups started moving about the board as if to search and engage the enemy. I double checked and all of them were set to "stay dug in". I have not tried removing the VP locations yet.

While I am asking...what does the last entry in the AI bar do? I see that it has a number that you can change and it seems to go up to infinity if you like. There is no description of it in the information button. I believe it is the fourth line of the arrow bars. Default is set to 0.
pipfromslitherine
Site Admin
Site Admin
Posts: 9929
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

The final data segment is flexible - you can use it for anything you like (as you can strictly with the others, but we label them for ease of use with the general AI). You can write an entirely different AI script if you want, and that would use the various data in any way you want.

The AI units will move to take any VPs if they are set as such in the VP plugin. Check that their teams are toggled off in the plugin (potentially try toggling on then off if they are still misbehaving?).

Cheers

Pip
acarhj
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 101
Joined: Wed Feb 27, 2008 3:20 am

Post by acarhj »

I figured it out. The template script has default AI behaviors for team 0, 1 and 2. Lucky me. Team 0 had a setting of 48 and team 2 had a setting of 32. Both would cause them to move about. Team 1 had a setting of 64 and they stayed dug in. I also had a team 3 which behaved appropriatly.

John
junk2drive
BA Moderator
BA Moderator
Posts: 1478
Joined: Sun May 23, 2010 4:47 pm
Location: Arizona USA -7GMT

Post by junk2drive »

Glad you figured it out. Did my guides help at all?

The worst part is figuring something out, then not being able to remember what you did months later.
You can call me junk - and type that with one hand.
Merr
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 903
Joined: Mon Aug 16, 2010 2:00 pm

Post by Merr »

I don't know if anyone else has seen this, but ....

If a unit is set to "Seek and Destroy" and there is no enemy unit in sight on the entire board it will run for the board edge, then stop.

You would generally see this in small, user created scenarios with no other AI scripting (I've seen this in the Plugin, but that's still kind of new anyway).

Not a problem (for the most part) but it's good to know the "flexible" value that Pip mentioned earlier.
acarhj
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 101
Joined: Wed Feb 27, 2008 3:20 am

Post by acarhj »

junk2drive wrote:Glad you figured it out. Did my guides help at all?

The worst part is figuring something out, then not being able to remember what you did months later.
Hi,

Your tutorials are a great help in general. I thank you for that.

This particular solution I stumbled upon when I was trying to figure out the script structure.

John
Post Reply

Return to “Battle Academy : Scenario Design”