Setting The Aggressiveness of Bots
Posted: Thu Jun 18, 2009 11:20 am
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.
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.