Setting The Aggressiveness of Bots
Moderator: Moderators
- SHOOT ME DEAD !
- Private Recruit
- Posts: 22
- Joined: Wed Jun 17, 2009 10:53 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Contact:
Setting The Aggressiveness of Bots
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.
- YTGTangerine
- Command Sergeant Major

- Posts: 270
- Joined: Sat Aug 16, 2008 7:53 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Aw man I can't think of anything creative...
Re: Setting The Aggressiveness of Bots
Is this in the addme LUA? Where is it?
- Fiodis
- Master of the Force

- Posts: 4145
- Joined: Wed Nov 12, 2008 9:27 pm
- Projects :: Rannoch + Tientia + Tools Programming
Re: Setting The Aggressiveness of Bots
I'd assume this is all in the map's mode's LUA file.
- Frisbeetarian
- Jedi

- Posts: 1233
- Joined: Wed Sep 12, 2007 3:13 pm
Re: Setting The Aggressiveness of Bots
Doesn't mention the same function, but this is a better way in my opinion.
http://www.secretsociety.com/forum/down ... culty.html
http://www.secretsociety.com/forum/down ... culty.html
- Eggman
- Master Bounty Hunter

- Posts: 1516
- Joined: Mon Jul 16, 2007 1:30 pm
- Projects :: Battlefront Chronicles
- Location: Las Vegas
Re: Setting The Aggressiveness of Bots
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.
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.
-
Commander_Keller
- Master Sergeant

- Posts: 171
- Joined: Sun Apr 16, 2006 1:16 pm
Re: Setting The Aggressiveness of Bots
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.
-
Taivyx
- 2008 Best Games Related Avatar
- Posts: 1706
- Joined: Thu Jun 07, 2007 3:34 pm
- Projects :: Terra Strife - discontinued
- xbox live or psn: No gamertag set
- Contact:
Re: Setting The Aggressiveness of Bots
QFT, this is a FAQ Must-Have.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.
-
RogueKnight
- Space Ranger
- Posts: 2512
- Joined: Sat Nov 22, 2008 1:50 pm
- Projects :: Life. Work.
- xbox live or psn: No gamertag set
- Location: Washington, US
Re: Setting The Aggressiveness of Bots
Definitly FAQ this.
- Frisbeetarian
- Jedi

- Posts: 1233
- Joined: Wed Sep 12, 2007 3:13 pm
Re: Setting The Aggressiveness of Bots
It's already part of the docs on psych0fred's site, why does it need to be in the FAQ a second time?
In the doc I already linked to, you must have missed it.Eggman wrote:DisableAIAutoBalance is explained somewhere on Psych0fred's site as well
- YTGTangerine
- Command Sergeant Major

- Posts: 270
- Joined: Sat Aug 16, 2008 7:53 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Aw man I can't think of anything creative...
Re: Setting The Aggressiveness of Bots
This isn't in my game modes LUA.
-
Taivyx
- 2008 Best Games Related Avatar
- Posts: 1706
- Joined: Thu Jun 07, 2007 3:34 pm
- Projects :: Terra Strife - discontinued
- xbox live or psn: No gamertag set
- Contact:
Re: Setting The Aggressiveness of Bots
Add the functions you want in after/under
Code: Select all
function ScriptPostLoad()- Eggman
- Master Bounty Hunter

- Posts: 1516
- Joined: Mon Jul 16, 2007 1:30 pm
- Projects :: Battlefront Chronicles
- Location: Las Vegas
Re: Setting The Aggressiveness of Bots
Whoops, you're right, I had actually just been looking at it too as I typed that.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?
In the doc I already linked to, you must have missed it.Eggman wrote:DisableAIAutoBalance is explained somewhere on Psych0fred's site as well
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.
