Increasing CPU Time To AI

Ask questions, discuss ideas, get answers
Post Reply
Daisy
Posts: 4
Joined: Tue Mar 06, 2018 12:29 am

Increasing CPU Time To AI

Post 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
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Re: Increasing CPU Time To AI

Post by freddy »

Try this in console

Code: Select all

game.serverCoopCPU 100
Daisy
Posts: 4
Joined: Tue Mar 06, 2018 12:29 am

Re: Increasing CPU Time To AI

Post 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%.
Daisy
Posts: 4
Joined: Tue Mar 06, 2018 12:29 am

Re: Increasing CPU Time To AI

Post 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.
russ
Posts: 73
Joined: Sun Oct 29, 2017 8:12 am

Re: Increasing CPU Time To AI

Post 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.
russ
Posts: 73
Joined: Sun Oct 29, 2017 8:12 am

Re: Increasing CPU Time To AI

Post 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
Daisy
Posts: 4
Joined: Tue Mar 06, 2018 12:29 am

Re: Increasing CPU Time To AI

Post 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.
russ
Posts: 73
Joined: Sun Oct 29, 2017 8:12 am

Re: Increasing CPU Time To AI

Post by russ »

game.serverCoopCPU is completely broken, in more than one way.

Use ai.SystemQuotient as described in the bf single player link.
Diamondback
Posts: 589
Joined: Mon Oct 01, 2012 3:13 pm
Location: Canada
Contact:

Re: Increasing CPU Time To AI

Post 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.
See my Strasbourg map project here.
Post Reply