Understanding the Coop Game Mode Limits

This will cover BF2 COOP settings for a LAN game.

by Oldrick

(COOP over the internet is possible but requires settings for Port Forwarding in the computer and in the Router as well as options for the computer's firewall which will not be covered here.)

Some simple Firewalls can not be set to allow the COOP Server to work properly. If any one of the computers on the LAN can not be made to work through their Firewall you should disconnect the entire network used for the COOP game from the internet to avoid any Malware. Then turn OFF the Firewall to play the COOP game.
Make certain to turn all Firewalls Back On before reconnecting to the internet.

BF2 is a Single-Threaded program. It will only use one core of a multi-core CPU. To get the best results the Server computer should be the one with the Highest Single-Threaded rating.
(ie. If you have an i5 at 3.1 GHz and an i3 at 3.4 GHz use the i3 as the server. Its Single-Threaded rating is the higher of the two.)

BF2 is a RAM hungry program. You should have a Minimum of 3 GB of RAM in the server. Anything less will result in poor game play.

These settings are for a "Serve and Play" server. With the BF2 client running select your user account and then from the top menu click [MULTIPLAYER]. Click [CREATE LOCAL]. Under the "AVAILABLE MAPS" change the GAME MODE to COOP. When you do that the "REVIVE TIME" option will disappear and the options BOT RATIO, NUMBER OF BOTS, and BOT DIFFICULTY will appear.

The BF2 Engine has a few quirks to it. The Engine is rigged to work with a maximum of 64 "Soldiers". But, this number is the combined total of Players and Bots. And the Engine is also set to base calculations on a maximum of 48 Bots. The number of MAX PLAYERS is subtracted from 64 to get the allowed number of Bots. The default configuration, for a COOP game, is set to have 32 Players. So 64 "Soldiers" minus 32 MAX PLAYERS gives a "leftover count" of 32 for the NUMBER OF BOTS. If the number of MAX PLAYERS goes up then you subtract more from the 64 value and you get fewer Bots. And the reverse is true. As the number of MAX PLAYERS is reduced the "leftover count" for Bots goes up. Until you get down to 16 MAX PLAYERS. At 16 MAX PLAYERS you will get the maximum of 48 Bots. If you go lower than 16 you will still only get 48 Bots.

For the following section "AUTO BALANCE" is turned OFF. (ie. The option box does not have an X in it.) If "AUTO BALANCE" is on then the game will always make the teams equal in size.
The BOT RATIO is a percent value that assigns that part from the NUMBER OF BOTS to the Bots on Team 1. (Team 1 is normally the "Not-Americans" but server settings can swap the "armies" of Team 1 and Team 2.) So if you have 32 Bots and the BOT RATIO is 50 (50%) then you will get 50% of the Bots assigned to Team 1 or 16 Bots. If MAX PLAYERS is reduced to 16 then the NUMBER OF BOTS will rise to 48 and with the BOT RATIO at 50 you will get 24 Bots on Team 1. But there is a "rounding" adjustment if the calculation does not come out as a whole number. Any decimal fraction higher than a whole number will cause the game Engine to "Round Up" to the next whole number. For example: If the NUMBER OF BOTS is 48 and the BOT RATIO is set to 78 the calculation will give 37.44 as a result. But, the game Engine will Round Up that value from 37.44 to 38 which is the next higher whole number.

\*\*\* The following information assumes that there is no init.con file in the mod or in the map that will over-ride the configuration.
(If the mod or the map uses it's own bot settings then this stuff is not going to be used.)

Now that the basics a covered let's get to the Weird Stuff.

In the game's configuration for a mod (plain BF2 is treated as a mod by the game engine.) there is a special file named: AIDefault.ai

It's normally located under the AI folder of the mod.
Plain BF2 has it located in:
\Program Files\EA GAMES\Battlefield 2\mods\bf2\AI

mods will have it under:
\Program Files\EA GAMES\Battlefield 2\mods\<mod name>\AI

In AIDefault.ai there are "option" settings we can manipulate.

aiSettings.setMaxNBots 64
aiSettings.maxBotsIncludeHumans 1

Option "aiSettings.setMaxNBots 64" is NOT where the 64 "soldiers" comes from under the default settings. The 64 "soldiers" is actually part of the game Engine.
But the option "aiSettings.maxBotsIncludeHumans 1" is why when you have more than 16 players you start subtracting bots.

There is another option which is not normally used:

aiSettings.overrideMenuSettings

When this option is missing (ie. not there or REM-arked out) from the series of commands in the AIDefault.ai file it's the same as the setting:
aiSettings.overrideMenuSettings 0 (0 means it's OFF)

When you select COOP as the GAME MODE the sliders on the screen (Below the SERVER NAME) are:
TIME LIMIT
MAX PLAYERS
SPAWN TIME
TICKET RATIO
BOT RATIO
NUMBER OF BOTS
BOT DIFFICULTY

Only the MAX PLAYERS, BOT RATIO, and NUMBER OF BOTS affect the distribution of Bots.

These examples will show how the settings in AIDefault.ai and the sliders combine to give the results in the number and distribution of Bots.
In all examples \*only\* one human player joins the game.

(Notice that the Combined value of 64 "soldiers" still affects the results no matter what the other settings are.)

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
(This is mostly like the factory settings)
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

- AIDefault.ai
aiSettings.setMaxNBots 30
aiSettings.maxBotsIncludeHumans 1
aiSettings.overrideMenuSettings 0 <- in the default setup this option is missing but setting it to 0 is the same.

- Sliders
MAX PLAYERS 8
BOT RATIO 100
NUMBER OF BOTS 40
AUTO BALANCE [ ] (off)

Team 1 40 bots
Team 2 1 human

###### =============

- AIDefault.ai
aiSettings.setMaxNBots 30
aiSettings.maxBotsIncludeHumans 1
aiSettings.overrideMenuSettings 0 <- in the default setup this option is missing but setting it to 0 is the same.

- Sliders
MAX PLAYERS 26
BOT RATIO 100
NUMBER OF BOTS 38 (auto limit: 64-26=38)
AUTO BALANCE [ ] (off)

Team 1 38 bots
Team 2 1 human

###### =======

- AIDefault.ai
aiSettings.setMaxNBots 100
aiSettings.maxBotsIncludeHumans 1
aiSettings.overrideMenuSettings 0 <- in the default setup this option is missing but setting it to 0 is the same.

- Sliders
MAX PLAYERS 8
BOT RATIO 100
NUMBER OF BOTS 40
AUTO BALANCE [ ] (off)

Team 1 40 bots
Team 2 1 human

###### =============

- AIDefault.ai
aiSettings.setMaxNBots 100
aiSettings.maxBotsIncludeHumans 1
aiSettings.overrideMenuSettings 0 <- in the default setup this option is missing but setting it to 0 is the same.

- Sliders
MAX PLAYERS 26
BOT RATIO 100
NUMBER OF BOTS 38 (auto limit: 64-26=38)
AUTO BALANCE [ ] (off)

Team 1 38 bots
Team 2 1 human

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
Change the AIDefault.ai option aiSettings.maxBotsIncludeHumans to off.
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

- AIDefault.ai
aiSettings.setMaxNBots 30
aiSettings.maxBotsIncludeHumans 0
aiSettings.overrideMenuSettings 0

- Sliders
MAX PLAYERS 8
BOT RATIO 100
NUMBER OF BOTS 40
AUTO BALANCE [ ] (off)

Team 1 40 bots
Team 2 1 human

###### =============

- AIDefault.ai
aiSettings.setMaxNBots 30
aiSettings.maxBotsIncludeHumans 0
aiSettings.overrideMenuSettings 0

- Sliders
MAX PLAYERS 26
BOT RATIO 100
NUMBER OF BOTS 38 (auto limit: 64-26=38)
AUTO BALANCE [ ] (off)

Team 1 38 bots
Team 2 1 human

###### ============

- AIDefault.ai
aiSettings.setMaxNBots 100
aiSettings.maxBotsIncludeHumans 0
aiSettings.overrideMenuSettings 0

- Sliders
MAX PLAYERS 8
BOT RATIO 100
NUMBER OF BOTS 40
AUTO BALANCE [ ] (off)

Team 1 40 bots
Team 2 1 human

###### =============

- AIDefault.ai
aiSettings.setMaxNBots 100
aiSettings.maxBotsIncludeHumans 0
aiSettings.overrideMenuSettings 0

- Sliders
MAX PLAYERS 26
BOT RATIO 100
NUMBER OF BOTS 38 (auto limit: 64-26=38)
AUTO BALANCE [ ] (off)

Team 1 38 bots
Team 2 1 human

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
Change the AIDefault.ai to activate aiSettings.maxBotsIncludeHumans AND aiSettings.overrideMenuSettings
The MAX PLAYERS is the deciding value.
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

- AIDefault.ai
aiSettings.setMaxNBots 30
aiSettings.maxBotsIncludeHumans 1
aiSettings.overrideMenuSettings 1

- Sliders
MAX PLAYERS 8
BOT RATIO 100
NUMBER OF BOTS 40
AUTO BALANCE [ ] (off)

Team 1 7 bots
Team 2 1 human

###### =============

- AIDefault.ai
aiSettings.setMaxNBots 30
aiSettings.maxBotsIncludeHumans 1
aiSettings.overrideMenuSettings 1

- Sliders
MAX PLAYERS 26
BOT RATIO 100
NUMBER OF BOTS 38 (auto limit: 64-26=38)
AUTO BALANCE [ ] (off)

Team 1 25 bots
Team 2 1 human

###### ============

- AIDefault.ai
aiSettings.setMaxNBots 100
aiSettings.maxBotsIncludeHumans 1
aiSettings.overrideMenuSettings 1

- Sliders
MAX PLAYERS 8
BOT RATIO 100
NUMBER OF BOTS 40
AUTO BALANCE [ ] (off)

Team 1 7 bots
Team 2 1 human

###### =============

- AIDefault.ai
aiSettings.setMaxNBots 100
aiSettings.maxBotsIncludeHumans 1
aiSettings.overrideMenuSettings 1

- Sliders
MAX PLAYERS 26
BOT RATIO 100
NUMBER OF BOTS 38 (auto limit: 64-26=38)
AUTO BALANCE [ ] (off)

Team 1 25 bots
Team 2 1 human

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
Change the AIDefault.ai option aiSettings.maxBotsIncludeHumans to OFF
AND aiSettings.overrideMenuSettings to ON
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

- AIDefault.ai
aiSettings.setMaxNBots 30
aiSettings.maxBotsIncludeHumans 0
aiSettings.overrideMenuSettings 1

- Sliders
MAX PLAYERS 8
BOT RATIO 100
NUMBER OF BOTS 40
AUTO BALANCE [ ] (off)

Team 1 30 bots
Team 2 1 human

###### =============

- AIDefault.ai
aiSettings.setMaxNBots 30
aiSettings.maxBotsIncludeHumans 0
aiSettings.overrideMenuSettings 1

- Sliders
MAX PLAYERS 26
BOT RATIO 100
NUMBER OF BOTS 38 (auto limit: 64-26=38)
AUTO BALANCE [ ] (off)

Team 1 38 bots
Team 2 1 human

###### ============

++++++++++++++++++++++++++++++++++++
When you have lots of Single-Thread CPU power... GO CRAZY!
++++++++++++++++++++++++++++++++++++

- AIDefault.ai
aiSettings.setMaxNBots 100
aiSettings.maxBotsIncludeHumans 0
aiSettings.overrideMenuSettings 1

- Sliders
MAX PLAYERS 8
BOT RATIO 100
NUMBER OF BOTS 40
AUTO BALANCE [ ] (off)

Team 1 40 bots
Team 2 60 bots + 1 human

###### =============

- AIDefault.ai
aiSettings.setMaxNBots 100
aiSettings.maxBotsIncludeHumans 0
aiSettings.overrideMenuSettings 1

- Sliders
MAX PLAYERS 26
BOT RATIO 100
NUMBER OF BOTS 38 (auto limit: 64-26=38)
AUTO BALANCE [ ] (off)

Team 1 38 bots
Team 2 62 bots + 1 human

In my experience bots have to be in a squad to do anything useful. Due to the Game Engine's hidden value of 48 bots you can only get a maximum of 48 bots on Team 1. And since there are only 9 Squads of 6 you get 54 "soldiers" that can join a squad before all the squads on a Team are full. Team 1 will always have all of the bots in squads. With 48 bots on Team 1 and only 54 places on Team 2 where a bot can join a squad before all the squads are full the combined value is 48 + 54 = 108. When you have more than 108 bots the bots that can not join a squad don't seem to do anything but stand around. My best guess is that when they are not in squad bots don't get any instructions from the Team COMMANDER. And without instructions they just wait.