Jump to content
Benny.

[SP/MP] BeCTI

Recommended Posts

Well, the ingame parameters is what I'm talking about....Dumbf!cks, notsobad, etc...what do those difficulty settings do? Where in Zerty CTI can I reduce the amount of resistance AI that spawn? I want to limit the amount of AI that the server has to control.

Share this post


Link to post
Share on other sites

What you dont like my parameter names ? :)

In my opinion the lag that the server experiences from the game is due to several things:

- Since not all AI are not local to the server (player AI) and since the server has to synchonised all those in order to generate the game dynamic, then the lag generated is the longuest time needed to grab the AI position and parameters from a client and dispatch it to the other clients (allowing some desync when no human player is nearby). Thus, one cause of the lag could be (I migth be wong since IDK whats realy in the netcode) the fact that several units are local to clients, the worse client creating at some point the bottleneck in the main loop of the netcode.

- Another parametter is the AI skill of units local to the server. Better skill means (I guess) a shorter cycle into the AI script since i guess they dont work with interruptions.

So If you really want a smooth server, you need to disactivate/reduce the players team or find a way to put their AI local to the server (or a HC) , lower the skill of all AI and reduce the maxping of the server.

All these are deductions from my experience, so take these words with care. All please keep in mind that we should get a nice update for server tomorrow :)

To reduce the number of AI in my version go into the Addons/Strat_Mode/init.sqf, there is a loop somewhere that reduced the number of AI with the number of connected players.

It looks like that:

0 spawn {
 while {!CTI_GameOver} do
 {
    _players={isplayer _x} count playableunits;
    CTI_TOWNS_RESISTANCE_GROUPS_RATIO = (75) -_players ;
    sleep 7;
  };
};

cheers

ps : I dont spell check, I am french :)

Edited by ZertyKchan

Share this post


Link to post
Share on other sites

Thanks for that Zerty, much appreciated. It's not that I don't like it, it's just that currently the Arma 3 engine can barely handle 32 players (10ai each), and 300-400 resistance/occupation ai. The server frames drop to like 5fps, and we have a GREAT server with more then enough bandwidth. I am trying to find ways to increase SERVER fps so that I can increase the slot count but still have a smooth game.

And a note on HC, we have it working on our server. However, we've noticed that with a full game (32 players) the HC actually brings the server FPS down, we can see that it's doing something (It's using CPU) but it's not working well with BECTI. I think Benny (or if you're up to it) needs to go back and look at the code, it's def not bringing up the server FPS like it should. We have an Arma 2 server with BECTI and the HC works very well but w/Arma 3 it's not ready.

Great news about the new version, I can't wait to host it! :-)

Share this post


Link to post
Share on other sites
the Arma 3 engine can barely handle 32 players (10ai each), and 300-400 resistance/occupation ai.

As awesome as it would be, I can't really imagine having nearly 700 AI units with 32 players and not choking the game.

AI teams already get unresponsive when there's more than 150 units fighting each other, takes them substantially more time to spot hostiles/react.

I wonder how they solve these issues in VBS3 where it's claimed to support 5000 (I think?) AI units...

Share this post


Link to post
Share on other sites

I'd like the options on the max AI's that AI squads can have extended so that 3 & 5 also becmoe an option -

please? :-)

Share this post


Link to post
Share on other sites

I would have to agree with grumpy old man on this.

We have found that our server performance starts to drop dramatically once the servers AI amount reaches 150 and will bottom out at >200. ( we don't use client AI for 2 reasons. 1 it lags more and 2 we prefer it players only ).

Note. I consider server performance to be bad at 20 fps and bottomed out at 10 or less. and would only call it good at >40.

To combat that I edited the scripts so that they reduce how many resistance are created once the server gets around the 150 mark. Also we use Zertys great territorial scripts so that only 4 res towns can be activated at once.

I haven't done anything with Occupation AI in my scripts as we mainly play it as a coop :)

But the scripts look the same and I see no reason it could not be done with occupation as well. (unsure how zerty handles occupation created AI inside his territorial scripts I imagine its not restricted as the resistance AI is to 4 towns.)

Another way would be to use the servers fps to determine how many AI are created as well as the AI counter.

Although the Server fps way is very hard to catch as it will go from at 100 AI with server fps at 40 then creates 60 AI at one more town and now its at 20 fps and drops soon as the AI start to use tactics in a fight.

The server our group uses is a very good dedicated box but alas Arma3 is not the only game played on the box. So our testing is below par to anyone who is using a Dedicated box just for Arma3 (not a rented Arma3 server a Dedicated Box ! )

Core i7 4770, 32 GB of RAM, and 2x 320 GB SSDs in a RAID-0 config. (yer I know sweet right :) )

I think something is wrong somewhere in Arma3 at the moment, as I do not remember these problems with CTI back in OFP on servers with a lot less power. although back then I was less active in the server side of things.

In Arma2 I was more active with the server performance and mission creation and numbers of AI where a problem but you could probably more than double the numbers to get the same low server performance. (at the end of Arma2 1.62)

I also agree with SpanishSurfer on the Headless Client it reduces rather than increases the servers performance even if you use affinity to set the cores the Server and Headless are assigned.

Rather than each mission maker writing code for the Headless could not BIS who understand this alot better than us guys add the headless code into the core engine so all we need to do is turn the headless on and assign it a core or two ?

I think that would make things a lot easier to test as it would be one set of code being tested rather than one for each mission.

My conclusion would be that until BIS do something drastic with the servers handling of the the AI or the headless clients handling of AI. If you want lag free games set a limit on how may AI are created and do not create any AI above that amount.

A param can be made that does this along side a script that checks AI amounts, with not too much trouble and each server admin can decide how many they feel their server can handle.

Not so good for Single play style but if its pvp the main game should be player versus player anyway right ? with AI as an after thought ?

Really like this discussion hope we figure some shit out or at least help the devs improve performance somehow.

And when Benny comes back hes got some feedback to read through :)

BL1P.

Edited by BL1P

Share this post


Link to post
Share on other sites

Sadly, I dont think we will be a way to improve the 15 AI cap without having more information about the main cycle of the game.

What I would expect running on the server would be something like:

- 1 Main cycle: generate the dynamic and FPS of the server

- 1 netcode (cycle): need to update clients and the server, not necessary a cycle, can also be some functions called from the main loop

- 1 AI cycle : generates the AI dynamics.

What we already know is that if we stuff more than 150 AI in the AI cycle then the FPS (and CPS) drops. From that we can deduce that there is a strong synchronism between the Main cycle and the AI cycle. Moreover if the AI cycle is locked to a single thread then it means that it fills the execution stack of the CPU.

From all that we could build some possible execution process of the main loop with all description of what tasks are consecutives, (a)syncronous... With some shared resources problem (memory space) and buffers.

Please remember that all that is only speculations, and is not the image of what happens in reality, my point is to analyse how to go past that 150 AI cap, we really need much more information. Moreover, I don't know if formal methods are used @ BIS but it could be a nice thing if they used something like Time Petri Nets to run some verification And/Or simulation in order to optimise a classic problem of concurent systems.

More practically, am not verry supprised that the HC is not that efficient since as it is called, its a client. And then the netcode also applies on that client. If all unit are present on that local client then that client becomes the bottlenec of the process (as we want to keep it "wynchonised" with the server).

In the becti mission all AI are sent to the HC, which could reduce drastically the awaited performance (the problem is sent to the HC) so if someone has a server with an HC, I would recomend to test if the perfomances improve if you are only sending 25,50,75% of the AI to the HC (and not all of them).

Oh, and if some dev are reading this my main question is if the exthread parametter allows concurency is the execution of AI.

ps: town occupation is handled as resistance through the strategic mode.

Share this post


Link to post
Share on other sites

Hey there Zerty. Nice work on the CTI but the independent ai doesn't seem attack the blue force. I've restarted a few times but it happens each time. Any solutions?

Share this post


Link to post
Share on other sites

In the becti mission all AI are sent to the HC, which could reduce drastically the awaited performance (the problem is sent to the HC) so if someone has a server with an HC, I would recomend to test if the perfomances improve if you are only sending 25,50,75% of the AI to the HC (and not all of them).

Zerty, is there a way to modify BECTI so that the HC only has to process town resistance? If we could eliminate that tasking from the server it would help out a lot.

Also, to Zerty/Bl1P or any other experienced mission dev. I have 2 goals for my next change in the mission and I need your help.

#1: I want to increase the slot size from 32 to 40, do I just load the mission editor and drop in 8 more players?

#2: I want every town to spawn vehicles and only the smallest ones (<100) to spawn infantry (cutting the amount of AI that spawn but increasing the difficulty via vehicles). Do I just edit the array for town resistance/occupation and delete all the infantry that can spawn and keep the vehicles? The smaller towns will have the highest probability for light vehicles and as the town increases in size I will spawn bigger/more powerful vehicles.

*I am having 1 problem with vehicles spawning: They are either stuck in some part of the town or blow up when they spawn. How can I force AI to spawn out of the town so that they do not end up getting stuck or blowing up?

Edited by SpanishSurfer

Share this post


Link to post
Share on other sites

@SpanishSurfer

1. yes

2. using just vehicles will not reduce the amount of AI it will just create the same amount of AI but in vehicles but yes how you explained it is how its done.

This is the part you want to edit to alter where they spawn ( I think )

Server_SpawnTownResistance.sqf

_groups = [];
_positions = [];
{
diag_log _x;

_position = [getPos _town, 25, CTI_TOWNS_RESISTANCE_SPAWN_RANGE] call CTI_CO_FNC_GetRandomPosition;
_position = [_position, 50] call CTI_CO_FNC_GetEmptyPosition;
[_positions, _position] call CTI_CO_FNC_ArrayPush;

_group = createGroup resistance;
[_groups, _group] call CTI_CO_FNC_ArrayPush;

} forEach _teams;

Could be wrong probably am

But hope it helps :)

Share this post


Link to post
Share on other sites

Well I'm going to drop the amount of AI that spawn in each town and have enough for 2-3 vehicles to spawn in each town.

So roughly 9 AI spawning in each town. (3 ai units/vehicle).

What's the best way to do this? Reduce group size to 9?

Also, help me understand this:

//--- Pool data: [<UNIT TYPE>, <PRESENCE>, {<PROBABILITY>}]

I understand unit type, but could you explain presence and probability?

Does probability need the { } when putting in the numbers?

EX

_pool_units = [["GUER_VEHICLES_LIGHT", 2, {80}], ["GUER_VEHICLES_MEDIUM", 1, {40}]];

?

Edited by SpanishSurfer

Share this post


Link to post
Share on other sites

I think but am not sure that it goes like this

Unit type = classname

Presence = how many

Probability = the chance the code picks this

Doesn't look like you need the {}

Example

["GUER_VEHICLES_HEAVY", 1, 45]

Broken down

[

"GUER_VEHICLES_HEAVY", //---<UNIT TYPE>

1, //---<PRESENCE>

45 //---<PROBABILITY>

]

Where 45 is a 45% chance and 100 or nothing are the 100% chance for example ( ["GUER_VEHICLES_HEAVY", 1] and ["GUER_VEHICLES_HEAVY", 1, 100] )

I think :)

Share this post


Link to post
Share on other sites
Zerty, is there a way to modify BECTI so that the HC only has to process town resistance? If we could eliminate that tasking from the server it would help out a lot.

Town resistance is already processed by the HC, what I was tring to say is that it should NOT process all resistance AI but only 50% of it. One way to do so migth be to make the server part of the HC pool (so whan a real HC is present both the server and the HC get AI). It could reduce the chokepoint of having all AI in a single client.

One point that i dont have time to test is to lower the skill of the AI, hopefully those will be related to the number of cycle per second needed per each AI (the values migth also be only related to min time and probabilities of the AI so no real changes awaited).

Share this post


Link to post
Share on other sites

I haven't done much testing with the HC mainly because I use my own server at home to test my scripts and stuff.

And I wont pay out for a second game just to use the HC to test if it works or not.

I wish I did have a HC to test though as there are a few things I would like to test :)

Share this post


Link to post
Share on other sites

Hi, sorry if this has been asked before, but will there eventually be a conversion for arma 2 as well? Not sure if this is correct but I remember benny saying something about focusing on the arma 3 mission but being able to convert it relatively easily for arma 2 as well once he has done a full release. Is that still happening? I am really REALLY keen for the re-written AI, because currently the warfare BE AI bugs out really bad after a couple of hours.

Share this post


Link to post
Share on other sites
the warfare BE AI bugs out really bad after a couple of hours
hope so...... but the Ai is not better in alpha3 and have the same + more probs too

Share this post


Link to post
Share on other sites

whats the deal with teh equipment that *seemingly* never despawns ?

i'm positive its ruining my fps after a few hours of play.

Mission bug? game bug? or is the timer on despawn set incredibly high on the server i play?

Possible introduce a cleanup script that whipes the map of rogue items?

Share this post


Link to post
Share on other sites
hope so...... but the Ai is not better in alpha3 and have the same + more probs too

I really hope that eventually this gets fixed. Thing is, even the shortest warfare BE missions go for over 5 hours, and by that time most of the AI is either glitching somewhere or has gotten stuck behind a tree or in the middle of the sea (LOL). I don't think I have ever had a game where the AI didn't glitch from mid-to-late game. Of course this is not Benny's fault, but rather a problem with the buggy arma engine; I just wish there was some sort of "anti-AI-glitch" script that detected when the AI was acting retarded and "force-fixed" it by for example resetting the AI... but maybe that's not practical :/

Share this post


Link to post
Share on other sites
whats the deal with teh equipment that *seemingly* never despawns ?

i'm positive its ruining my fps after a few hours of play.

Mission bug? game bug? or is the timer on despawn set incredibly high on the server i play?

Possible introduce a cleanup script that whipes the map of rogue items?

Put that some in the mission code so the server runs it for a despawning time of 4 minutes:

	//groundcontainer cleanup
	0 spawn {
		_timeout={
			_time=time;
			waitUntil {time > _time + 240};
			deleteVehicle (_this);
		};
		while {! CTI_GameOver} do {
			{
				if (isNil {_x getVariable "GC"}) then {
				 _x setVariable ["GC",true];
				 (_x) spawn _timeout;
				};
			} forEach allMissionObjects "GroundWeaponHolder";
			sleep 10;
		}
	};

Ill include that in next version.

Share this post


Link to post
Share on other sites

The only performance difference I noticed when playing on the Jammy server was having NVGs on at night might impact FPS, taking them off FPS jumps up again.

No idea about server fps though.

Share this post


Link to post
Share on other sites

clientside fps jump is normal ... because it resets the rendering of lighting and clouds etc. plus in case of AI there must be recheck too

Share this post


Link to post
Share on other sites
Zerty, do I place the above code to clean up gear in the init.sqf? If not which file?

Also, this is prob not a BECTI bug but a BIS bug. http://forums.bistudio.com/showthread.php?172171-Transition-from-day-to-night-or-night-to-day-DRASTICALLY-degrades-server-FPS

Have you had similar problems with the above issue?

I mostly never used fast time because of its effect on the overcast (it looks awfull when there are clouds). I also find it strange that the server fps drops if active. Without some benchmark, i can't say that I have seen this effect, maybe you can try to augment the cycle timer in the clients and server FSM doing the fast time, 1 evolution every 20 minutes rather than every 3 seconds.

And for the script you put it in the server init or global init with checking the CTI_isServer variable.

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

×