CQB Unit Locality

  1. 7 years ago

    I was really excited when I found out about the CQB, it works beautifully for what I need but there's one HUGE problem - it doesn't seem to offload AI on to nearby players. All units spawn local to the server (horrible performance).

    I thought the locality: auto option on the CQB module would do just that - automatically sync ownership, but apparently not. Is there a way to do this using ALiVE? I don't have access to headless clients, so I need to offload on to the players.

    If I do this manually using my own script loop, will that interfere with the functionality of the CQB and ALiVE?

  2. Hmmm. That doesn't sound right. I don't play with other people too often but I don't ever recall a situation where someone had seen an enemy another player couldn't see.

    Curious to see the answer for this as well.

  3. You can run a (or multiple) headless clients from the same machine as the server or a player. This is much more efficient than locking the AI's intelligence to the player's machine's performance.

  4. @SpyderBlack723 You can run a (or multiple) headless clients from the same machine as the server or a player. This is much more efficient than locking the AI's intelligence to the player's machine's performance.

    So you think it's a server load issue rather than a locality one?

  5. This whole thread is about how to best manage processing time.

  6. Ah I see. I misread the first paragraph of the OP.

  7. @SpyderBlack723 You can run a (or multiple) headless clients from the same machine as the server or a player.

    I'm a little confused. Are you saying that a player can be turned into a HC? Do HCs still require multiple owned copies of the game?

  8. Edited 7 years ago by SpyderBlack723

    HC'S can be run freely alongside your game instance using multiple instances of the same copy of the game.

  9. Edited 7 years ago by Dreesy

    @SpyderBlack723 HC'S can be run freely alongside your game instance using multiple instances of the same copy of the game.

    That's awesome. I recall requiring more than one copy of the game for HCs, but maybe that's just for Arma 2.

    I've managed to come up with a simple loop to offload server-owned AI onto player units in the meantime, but now I'm running into a much bigger problem:

    CQB doesn't seem to have a group limiter, meaning potentially hundreds of AI can spawn. Even offloading that many AI onto tons of other players/HCs won't help if I can't limit the amount of AI spawned by a singular CQB.

    Is there a way to do this other than setting the spawns to solo, and having their spawn distance be ridiculously low?

    I managed to go from 60% server CPU usage with only 40 AI - to 330 units at ~48% average CPU usage for server, by running this loop on the server:

    while {true} do {
    
    {
    
    EZLeader = leader _x;
    EZGroup = group EZLeader;
    
    if((groupOwner EZGroup) <= 2) then {
    
    LeaderToCheck = EZLeader;
    ClosestPlayer = objNull;
    DistanceToCheck = 10000;
    {
           DistanceBetween = _x distance LeaderToCheck;
           if((isPlayer _x) && (DistanceBetween < DistanceToCheck)) then
           {
               ClosestPlayer = _x;
               DistanceToCheck = DistanceBetween;
           };
    } forEach playableUnits;
    
    NewOwnerID = owner ClosestPlayer;
    EZGroup setGroupOwner NewOwnerID;
    EZGroup enableDynamicSimulation true;
    
    "[DEBUG] Group is now owned by Player 1." remoteExec ["systemChat", 0, false];
    
    };
    
    } forEach allGroups;
    
    
    sleep 1;
    };
  10. There is no way to limit spawns.

  11. I just tweaking some improvements to the above code, managed to shave off an additional ~20% server load by introducing DynamicSimulation + higher check distance.

    Even though my method works, it appears to be fighting with some internal ALiVE function that is constantly assessing ownership of groups and re-assigning them back to the server. Any way I can dig into this function to turn it off? I'm assuming it's the Localization:Auto feature.

  12. @highhead

 

or Sign Up to reply!