Jump to content
ezremake

AI are dumb as bricks when localized to players

Recommended Posts

I use roughly 20-30 respawning AI in my mission, and had noticed that server CPU usage would spike into the high 80s and 90s when there were enough players online to have all the AI engaged.

 

Seeing that I do not have access to a headless client at this time, I figured I would write something to evenly distribute the AI load onto the players. This did wonders for lowering server overhead, however it seems to have come at the cost of AI functionality.

 

When the AI is setGroupOwner'd on to players, they become dumb, shoot at a slow pace, and miss most of their shots. Using setSkill doesn't seem to do much unless the unit is owned by the server. I figured the slowdown when local to players is due to client -> server -> client communication, rather than the standard server->client.

 

Is there any way to improve this without having to get a second machine just for AI calculations? It seems kind of over egregious for just 24 AI.... I figured my server would have been able to handle it, being 3.40ghz.. Do higher Ai skill settings increase CPU usage by any chance?

Share this post


Link to post
Share on other sites

Not 100% sure about this, but it could be that the players have difficulty AI sliders all the way down.

AI difficulty is wonky as hell, so that might very well be the case if you're not running any custom AI skill scripts that override AI difficulty settings.

 

This video was made after the recent AI "refactoring" to make lower precision values not bugged, according to the devs this should make AI at lower precision value more precise than with the old setting using the same values.

Changing precision from 0.05 to 0.5 to 1.0, with skillFinal always returning 0.75. Seems the devs are lost on this one as well.

Go figure.

 

Cheers

Share this post


Link to post
Share on other sites
7 hours ago, ezremake said:

I figured I would write something to evenly distribute the AI load onto the players.

 

This will kill your session due to bandwidth choke.

 

Proper headless client needs to be on same machine as server with local connection.

 

I have tested distributed systems on busy servers (45+ players), and the result is catastrophic collapse of client FPS and network stability. Server FPS will be high but the session is unplayable.

Share this post


Link to post
Share on other sites

The headless client seems to be done especially for that. Probably due to specific network data between server and HC.

 

Note apart: I can't read any Vimeo video on Firefox / W10 (all updated), and it seems there is no working solution on net at this time. (all tested).

 

Share this post


Link to post
Share on other sites
10 hours ago, fn_Quiksilver said:

This will kill your session due to bandwidth choke.

 

I almost expected this to be the case. God Arma 3 is such a greedy game, needing 2 server machines just for something like this... My dedicated server is only a dual core 3.40ghz, so running a headless from the same machine would be pointless unfortunately.

 

How much CPU usage would you say a player uses on average from your experiences? Does it get significantly worse when players are in the same vicinity. Does ARMA 3 take any measures when CPU hits 100%, or does it immediately just start to choke out clients with red chains?

 

I'm trying to figure out if what I've spent months making is even going to be feasible. I honestly can't believe ~20 AI is eating up 80% of a 3.40ghz processor.

Share this post


Link to post
Share on other sites

In my experience, it shouldnt.

 

I would bet something is wrong somewhere, in the mission or in the infra. Any misión around the scene has those 20 AIs running without killing any PC.

 

Antistasi runs 100 AI at a time without killing an average PC and the AI behaves decently.

 

Good advice from qucksilver because indeed I was about investigating a way to offload AI on connected clients. You saved me a ton of work :)

 

 

Share this post


Link to post
Share on other sites

I did a huge scale rewrite on my mission, and dialed the AI back all the way down to 10 units. I'm still seeing an average of ~30% CPU usage, even with 0 players online. I can't understand it, especially since when the server first starts with the 10 AI, the CPU usage is only about 10-15%.

 

I figured maybe one of my loops was the problem, but I've pretty much disabled 90% of them and the CPU is still an issue. I have no idea how servers use 100s of AI without a headless client, if I can't even use 10 without 30% CPU usage.... I swear it never, ever, used to be like this.

 

Is there a way I can actively profile my server's performance while it runs? I need to get script profiling from the active environment, running script profiling in EDEN is almost useless for me as 90% of my scripting is serverside and relies and exDB3 which EDEN can't use..

Share this post


Link to post
Share on other sites
On 2/22/2018 at 8:08 PM, ezremake said:

I did a huge scale rewrite on my mission, and dialed the AI back all the way down to 10 units. I'm still seeing an average of ~30% CPU usage, even with 0 players online. I can't understand it, especially since when the server first starts with the 10 AI, the CPU usage is only about 10-15%.

 

I figured maybe one of my loops was the problem, but I've pretty much disabled 90% of them and the CPU is still an issue. I have no idea how servers use 100s of AI without a headless client, if I can't even use 10 without 30% CPU usage.... I swear it never, ever, used to be like this.

 

Is there a way I can actively profile my server's performance while it runs? I need to get script profiling from the active environment, running script profiling in EDEN is almost useless for me as 90% of my scripting is serverside and relies and exDB3 which EDEN can't use..


may be this can help
https://steamcommunity.com/sharedfiles/filedetails/?id=1652506957&searchtext=script

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×