Page 1 of 1

Increasing CPU Time To AI

Posted: Tue Mar 06, 2018 12:38 am
by Daisy
Hello All,

I was hoping someone has a way or can provide me with a mod that would allow the CPU Time to AI (max is currently 25%) to be increased. I play the Desert Combat Mod as well as the Unofficial version with the enhanced ai capabilities. Via one of your community modders (Thank you!) I was able to increase the amount of bots in the game. Often they are not being utilized and are standing in formation and I know that more cpu time needs to be given to maximize their play. If anyone can help that would be great. Thank you in advance.

Daisy

Re: Increasing CPU Time To AI

Posted: Tue Mar 06, 2018 6:02 am
by freddy
Try this in console

Code: Select all

game.serverCoopCPU 100

Re: Increasing CPU Time To AI

Posted: Tue Mar 06, 2018 7:48 pm
by Daisy
Hello Freddy,

Thank you for your prompt reply. Using the console key, I typed in "game.serverCoopCPU 100" without the quotes as suggested and pressed enter. It is returning with: "error:unauthorizedmethod!" without the quotes. I also tried with various numbers under 100 and get the same return. Maybe I am doing something wrong or it needs to be done another way.

With modern cpu's, I don't see why we cant allocate more than the 'maximum' 25%.

Re: Increasing CPU Time To AI

Posted: Thu Mar 08, 2018 4:40 pm
by Daisy
BTW, I did find the line 'game.serverCoopCPU 25' in the server.con file in the game and changed it to 100 and lower numbers and it did not change anything.

Re: Increasing CPU Time To AI

Posted: Sat Mar 10, 2018 11:08 pm
by russ
I suspect this may be broken. It looks like the setup code is reading in an int, 0-100, but the AI code is expecting a value 0.0 to 1.0. It looks like the default is 0.2. I don't see where it's divided by 100 before passing it into the AI code. Try 1 and see if that helps.

Re: Increasing CPU Time To AI

Posted: Sat Mar 10, 2018 11:31 pm
by russ
Oh geez, adding insult to injury, AIMain::AIMain is called after the assignment, so it would never happen anyway. Changing it in the console won't help either since it only modifies the value in setup, not AIMain itself. But as the professor says, good news everyone!

http://bfmods.com/mdt/scripting/Ai/Prop ... tient.html

Is the actual value, with a range of 0.0 to 1.0. It should be settable after AIMain starts assuming you have permissions right. This would mean after the call to ai.init:

http://bfmods.com/mdt/scripting/Ai/Properties/Init.html

http://www.battlefieldsingleplayer.com/ ... topic=3155

Re: Increasing CPU Time To AI

Posted: Sun Mar 11, 2018 5:56 am
by Daisy
Hi Russ,

Thank you for trying to help. Please tell me where I should put that value of 1. I didn't see a "AIMain" or where it is. I am not a coder but will try my best with instructions.

Re: Increasing CPU Time To AI

Posted: Mon Mar 12, 2018 9:29 am
by russ
game.serverCoopCPU is completely broken, in more than one way.

Use ai.SystemQuotient as described in the bf single player link.

Re: Increasing CPU Time To AI

Posted: Sun Apr 09, 2023 6:41 pm
by Diamondback
russ wrote: Sat Mar 10, 2018 11:31 pm Oh geez, adding insult to injury, AIMain::AIMain is called after the assignment, so it would never happen anyway. Changing it in the console won't help either since it only modifies the value in setup, not AIMain itself. But as the professor says, good news everyone!

http://bfmods.com/mdt/scripting/Ai/Prop ... tient.html

Is the actual value, with a range of 0.0 to 1.0. It should be settable after AIMain starts assuming you have permissions right. This would mean after the call to ai.init:

http://bfmods.com/mdt/scripting/Ai/Properties/Init.html

http://www.battlefieldsingleplayer.com/ ... topic=3155

I have added the command to Berlin's AI.con file, like this:

Code: Select all

rem *** Init AI using current settings ****
ai.init 2
ai.aiSystemQuotient 1.0
Unfortunately, I perceived no difference in the strength of the AI. The only differences I perceived were when the AI Skill and CPU Given to AI parameters were set to their maximum values (100 % and 25 % respectively) in the Create game menu for a COOP game.