Headless Client – Arma 3

From Bohemia Interactive Community
Revision as of 12:47, 3 October 2014 by Dazhbog bi (talk | contribs)
Jump to navigation Jump to search

Headless Client Overview

  • headless client is used to offload AI calculation from server
  • headless client is integrated into game client and dedicated server executable (WIndows and Linux, use -client parameter)
  • server doesn't allow to connect arbitrary headless client because headless clients are not verified on Steam, so server.cfg contains list of allowed headless clients IPs headlessClients[]={"xxx.xxx.xxx.xxx", ...}
  • mission needs to be changed a little to support headless clients:
    • extract AI to separate AI script
    • edit init.sqf to execute an extracted AI on headless client
    • place headless client unit
  • in scripts the headless clients may be identified by its name, multiple headless clients are supported
  • next sections will show you how to use Headless Client

Prerequisites

Prepare mission for Headless Client

  1. create ai.sqf script that will spawn AI on headless client (see http://dl.dropbox.com/u/6920345/HC_tutorial/hc_tutorial.pdf)
  2. add Headless Client entity to map:
    1. add a regular unit (player, ...)
    2. then you can insert Headless Client unit:SIDE: Game Logic, CLASS: Virtual Entities, UNIT: Headless Client, CONTROL: Playable, NAME: somename
    3. don't forget to set NAME property, the name will be used to identify headless client in the scripts and it is used to connect headless client to proper headless client slot
    4. each Headless Client unit will add one headless client slot, mission may contain multiple Headless Client units
  3. update init.sqf to offload AI to Headless Client, to execute AI on Headless Client add these lines to init.sqf: playerName = name player;
    if(playerName == "hc") then {
    // execute extracted AI on headless client named hc
    execVM "ai.sqf";
    };
  4. put packed mission into mpmissions folder

Server

  1. add headless client IP address into server.cfg (you can use more than one address):headlessClients[]={"xxx.xxx.xxx.xxx", "xxx.xxx.xxx.xxx", "xxx.xxx.xxx.xxx"}
  2. to run Arma3 Dedicated Server use one of these commands:Windows: arma3server.exe -config=server.cfg
    Windows: arma3.exe -server -config=server.cfg
    Linux: arma3server -config=server.cfg

Headless Client

  1. to run Arma3 Headless Client use one of these commands:Windows: arma3server.exe -client -connect=xxx.xxx.xxx.xxx -name=hc -password=yourpass
    Windows: arma3.exe -client -connect=xxx.xxx.xxx.xxx -name=hc -password=yourpass
    Linux: arma3server -client -connect=xxx.xxx.xxx.xxx -name=hc -password=yourpass
  2. your client will be automatically connected to the headless client slot with the same name
  3. you can run arbitrary number of headless clients on the same machine

Overview of running options

  • Main game executable (windows only)arma3.exe
    arma3.exe -server
    arma3.exe -client
  • Windows server executablearma3server.exe
    arma3server.exe -client
  • Linux server executablearma3server
    arma3server -client

GUI

  • Headless clients can be seen in the Role assignment display when creating a MP game
    • If you are admin (host)
      • You will see HCs listed in the Players list on the right
      • You will see a category called Virtual (it can contain both Zeus and HCs) on the left
      • Note: HCs are automatically assigned to their slots
    • If you are normal player
      • You won't see any HCs anywhere
      • You won't see any Virtual category (if the mission contains Zeus then there will be Zeus category)
  • In-game UI
    • HCs are listed with other players only if you are admin (map, tasks, kill statistics, ...)