Page 1 of 1

Setting The Aggressiveness of Bots

Posted: Thu Jun 18, 2009 11:20 am
by SHOOT ME DEAD !
Looking around I didnt see much mention of the SetTeamAggressiveness() function, and its something I messed around with so I'll pass on what I think about it.

You see references in pasted code, but it appears people aren't playing around with it too much. You typically see calls to the funtion in hunt levels, for example you can see the aggressiveness of the empire snipers toned down to 0.7 for Endor Hunt. This is probably becaise if the defaults were used the snipers would be unrealisticly shooting ewoks through the bushes with really good aim. Also, we need to give the stone throwers a bit of help.

SetTeamAggressiveness(ALL, 1.0)
SetTeamAggressiveness(IMP, 0.7)

When this code is not present the default values are used, which after messing around with it are something like 0.95 for regular bots, and 0.97 for elite bots.

What this function seems to actually do is

1) make the bots aim better
2) affect the distance at which they engage you

And since my theory is "do more with less bots" I typically find a setting of 0.98 or 0.99 to work well. You dont really want to go as high as 1.0 because the sniper bots are a little too good and kind of ruin it.

But on the other hand I set my jedis to 1.99. This seems to make the jedis ignore the bots and come after the humans from a greater distance. I know they do that anyways, but this seems to make them notice you from farther away, which is kind of creepy and fun. Jedis having better aim is inconsequential, so for them its just about the distance. I know the value is supposed to be between 0.0 and 1.0, but a seeting of 1.0 just doesnt cut it, and the function seems to continue affecting the jedis at values over 1.0. Weird but helpful.

I read somewhere (i think in reference to battlefront 1) that the SetTeamAggressiveness() function is deprecated, well..... it works for me, lol.

The next issue about aggressive bots is the sniper distance.

AISnipeSuitabilityDist(30)

A Setting of 30 is ideal and you dont want to go any higher than that unless it really is a sniper battle, and in that case I still would not go over 40. What you dont want is the bot snipers pwning you from so far away that you can hardly even see them even when your double scoped. I use a distance of 30 and find the snipers to act very much like snipers.

Ok now for the SetDenseEnvironment()....

Theres probably varying opinions on what this setting should be, and what it claims to do rather than what it actually does. All I can say is try it out both ways, "True" and "False" and see which you like better. I have come to think of this function not as "set dense environment" but "set dense bots", because in my opinion whenever the setting is true thats what the bots do... act dense, lol. The default setting is "True" and I almost always use "False". But just mess with it.

Continuing with the "do more with less" premise, another simple way to make bots a bit harder to kill is to up their speeds just a tiny bit. This makes it harder to hit them when they are dodging. You can go into the odf file "com_inf_default" (which is elusively located in the common/odf folder of you munged world and not located in the mod tools assets) and see that the default values for infantry are

MaxSpeed = 7.0 // base forward speed
MaxStrafeSpeed = 5.25 // base right/left speed
MaxTurnSpeed = 5.0 // base turn speed

and then of course the sniper is going to be a bit faster and the wookie is going to be a bit slower.

You can just set the speeds for the classes at runtime in the ScriptPostLoad() and just up them by something like 10 or 15%.

SetClassProperty("all_inf_rifleman", "MaxSpeed", 8.0)
SetClassProperty("all_inf_rifleman", "MaxStrafeSpeed", 6.0)
SetClassProperty("all_inf_rifleman", "MaxTurnSpeed", 5.5)

and just do that for each class. Note : this will not work for dark trooper

Or if you already have some odfs then that works too, lol.

The last thing I do out of habit when configuring my bots is disable the auto balance.

DisableAIAutoBalance()

I dont know if this actually disables any auto balance, but just in case the bots that are winning start acting dumb as an auto balance, I disable it. Bots are dumb enough as it is, we dont need to give them another reason. It honestly doesnt seem to make a difference.

So anyways, next time your modding take a minute to mess with these settings before you release it. And remember that its nice to have at least one warning shot before you get smoked by a bot.

Re: Setting The Aggressiveness of Bots

Posted: Thu Jun 18, 2009 6:26 pm
by YTGTangerine
Is this in the addme LUA? Where is it?

Re: Setting The Aggressiveness of Bots

Posted: Thu Jun 18, 2009 6:27 pm
by Fiodis
I'd assume this is all in the map's mode's LUA file.

Re: Setting The Aggressiveness of Bots

Posted: Thu Jun 18, 2009 7:36 pm
by Frisbeetarian
Doesn't mention the same function, but this is a better way in my opinion.
http://www.secretsociety.com/forum/down ... culty.html

Re: Setting The Aggressiveness of Bots

Posted: Thu Jun 18, 2009 8:01 pm
by Eggman
I personally use the method Frisbeetarian mentioned, although I'm not sure they do exactly the same thing.

SetDenseEnvironment is explained on Psych0fred's website: http://www.secretsociety.com/forum/down ... _Notes.txt

Basically what you said; it makes small adjustments to AI behavior so they don't move around quite as much as they would in an open setting.

DisableAIAutoBalance is explained somewhere on Psych0fred's site as well (again, basically what you described it as). Its effects won't be too noticeable unless you sit around and just watch the AI really closely, but it does work. It's useful for objective-based modes.

Anyway, there are a lot of simple functions like these that put the polish on a map, and it's good to make use of them.

Re: Setting The Aggressiveness of Bots

Posted: Thu Jun 18, 2009 8:51 pm
by Commander_Keller
i hope this is making it into the FAQ section sometime. okay, it is not yet enough new information although to me it is all brand new. quite useful in my humble opinion.

Re: Setting The Aggressiveness of Bots

Posted: Thu Jun 18, 2009 9:47 pm
by Taivyx
Commander_Keller wrote:i hope this is making it into the FAQ section sometime. okay, it is not yet enough new information although to me it is all brand new. quite useful in my humble opinion.
QFT, this is a FAQ Must-Have.

Re: Setting The Aggressiveness of Bots

Posted: Thu Jun 18, 2009 11:37 pm
by RogueKnight
Definitly FAQ this.

Re: Setting The Aggressiveness of Bots

Posted: Thu Jun 18, 2009 11:51 pm
by Frisbeetarian
It's already part of the docs on psych0fred's site, why does it need to be in the FAQ a second time?
Eggman wrote:DisableAIAutoBalance is explained somewhere on Psych0fred's site as well
In the doc I already linked to, you must have missed it.

Re: Setting The Aggressiveness of Bots

Posted: Fri Jun 19, 2009 11:10 am
by YTGTangerine
This isn't in my game modes LUA.

Re: Setting The Aggressiveness of Bots

Posted: Fri Jun 19, 2009 11:30 am
by Taivyx
Add the functions you want in after/under

Code: Select all

 function ScriptPostLoad()

Re: Setting The Aggressiveness of Bots

Posted: Fri Jun 19, 2009 11:51 am
by Eggman
Frisbeetarian wrote:It's already part of the docs on psych0fred's site, why does it need to be in the FAQ a second time?
Eggman wrote:DisableAIAutoBalance is explained somewhere on Psych0fred's site as well
In the doc I already linked to, you must have missed it.
Whoops, you're right, I had actually just been looking at it too as I typed that. :P

I agree that this doesn't really need to be in FAQ. Yes, it's useful information, but it has been covered before. There's already a list of every LUA function we know of, and these particular ones are explained elsewhere.