Jump to content


  • Content Count

  • Joined

  • Last visited

  • Medals

  • Medals

Posts posted by Prodavec

  1. mmand prompt by using "Run as administrator" ? Or if you're using a batch file, right-click and run as administrator? You might have tried that already but I figured it's worth asking.

    My windows profile has administrative rights, it is inside Administrators group. And yes I just tried to Run As Admin option (Secondary Login service needed) just in case.

    The other thing I would try (and this is probably way out on a limb) but try turning off "DEP" or data execution prevention on arma3battleye.exe ? If you don't know how, there's plenty of walkthroughs on google..

    DEP is completely turned off for all programs on my PC

    do a verify cache on arma 3 in steam

    I do it after each arma 3 update. So yes - I have done local cache checking.

    Maybe the last update messed up your paths or something? Check the keys under this one (this is on my 64 bit system)


    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Bohemia Interactive\Arma 3

    • Default (REG_SZ): (value not set)
    • data (REG_SZ): %MAIN%
    • MAIN (REG_SZ): F:\Games\Steam\steamapps\common\Arma 3

    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Bohemia Interactive\Arma 3\Expansions

    • Default (REG_SZ): (value not set)

    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Bohemia Interactive\Arma 3\Expansions\Arma 3

    • Default (REG_SZ): (value not set)
    • MODDIR (REG_SZ): A3
    • path (REG_SZ): SOFTWARE\Bohemia Interactive\Arma 3

    "C:\Program Files (x86)\Steam\steam.exe" "%1"

    I didn't find anything related to that string in windows registry. I have found this:


    • Default (REG_SZ): "F:\Games\Steam\steam.exe" "%1"

    My Steam had been installed here F:\Games\Steam few years ago and steam.exe is inside that directory.

    I guess I have to wait some patch/update for BE with some diag / log information (at least error code) stored into Windows Event system and/or .log/.rpt file. Thanks for helping. From now I'm going to play another games.

  2. I forget about Event Log :). Well. I've just checked the log and didn't find anything related to BE (using CTRL+F). There are few notifications related to other products/applications but not BattlEye / Arma.

    I have cleared logs (Application, Security, Setup, System, Forwarded Events), restarted PC, tried to run A3 few times using BE launcher and checked the windows logs again - nothing.

    F:\Games\Steam\SteamApps\common\Arma 3>arma3battleye.exe
    F:\Games\Steam\SteamApps\common\Arma 3>

    F:\Games\Steam\SteamApps\common\Arma 3>arma3battleye.exe 0 1
    F:\Games\Steam\SteamApps\common\Arma 3>

    F:\Games\Steam\SteamApps\common\Arma 3>arma3battleye.exe 1
    :)IMPORTANT: Please launch game via Steam or command line "arma3battleye.exe 0 1 [parameters]" from now on.
    F:\Games\Steam\SteamApps\common\Arma 3>

    I have suspended arma3battleye.exe by Process Explorer and found Current directory: C:\Windows\. Is it ok?

  3. The game doesn't start with arma3battleye.exe.


    1. arma3battleye.exe 0 1 -window

    2. join BE enabled server and restart the game

    3. run game through the BIS Launcher (arma3launcher.exe)

    nothing works

    arma3battleye.exe just appears in the Task Manager process list and disappears instantly with no error message displayed.

    Windows 7 x64 SP1

    It's not possible to play BE protected servers now. Also I e-mailed Bastian about Color Clutch injector issue and he didn't respond me few months ago. It looks like the new BE launcher is in pre pre alpha stage.

  4. I'm interested in HC Task Manager (Load Balancer) but currently have no time to implement it in our project due deadline.

    I have some ideas how it should work:

    1. Server-side slow loop (scheduled env, sleeps) every 1-10 minutes which monitors current objects state (locality).

    2. HC-side slow loop with FPS measurement based on Moving Average.

    3. Server requests HC's average FPS regularly

    4. Based on HC's FPS server calculates gross power of the HC: total objects on that HC divide on FPS drawdown. For eaxample:

    20 objects on HC

    40 FPS (average)

    So drawdawn is 10 FPS because: 50 FPS (max) - 40 FPS (current avg.) = 10 FPS

    20 objects / 10 FPS = 2 O/FPS.

    It means each object "eats" 0.5 HC FPS.

    5. Calculate total power for all HC. Just summarize all gross power for all HC. For example we have two HC with 75 O/FPS and 25 O/FPS. As you can see they have different power and/or load. We have 100 O/FPS for all.

    6. Create object "cart": [groups, vehicles, environment, static_objects]

    7. Calculate share for each HC: HC's gross power / total power available.

    75 / 100 = 0.75

    25 / 100 = 0.25

    8. Now we can assign the cart objects to HCs in compliance with their shares

    HC #1: [groups * 0.75, vehicles * 0.75, environment * 0.75, static_objects * 0.75]

    HC #2: [groups * 0.25, vehicles * 0.25, environment * 0.25, static_objects * 0.25]

    9. We must delegate AI properly because they will lost all waypoints and other stuff. Well, actually it's not easy. We can get waypoints by waypoints command but synchronized objects will be pain in ass.


    after gathering all AI data and packing it to one big array, something like

       [group_0, waypoints_0, sync_data_0, some_other_shit_0],
       [group_1, waypoints_1, sync_data_1, some_other_shit_1],
       [group_N, waypoints_N, sync_data_N, some_other_shit_N]

    send it to remote HC function (via BIS_fnc_MP or some sort of CBA function)

  5. Your answer is not related to the topic starter's question. We have developed some kind of shit that may help to solve your issue.

    Related ticket #17998

    * Project:          Mushi
    * Module:           fnc_GetAllTurretPaths.sqf
    * Project version:  [1.0.0] 20.03.2014
    * Module version:   [1]     20.03.2014
    * Author:           RAB, Prodavec, Marbot, DumbkRat, SPESNAZ
    * Function:         fnc_GetAllTurretPaths
    * Comments:         --//--
     vehicle : OBJECT
     paths_array : ARRAY
     _allPaths = MyTank call fnc_GetAllTurretPaths;
    // _allPaths: [[0], [0,0], [0,1]]
    _result = [];
    if ((!isNil "_this") && {(typeName _this) in ["ARRAY", "OBJECT"]}) then
       _vehicle = objNull;
       _currentNode = [];
       _depth = -1;
       _currentConfig = objNull;
       switch (typeName _this) do
           case "ARRAY":
               if ((count _this) == 5) then
                   _vehicle = _this select 0;
                   _currentConfig = _this select 1;
                   _currentNode = _this select 2;
                   _depth = _this select 3;
                   _result = _this select 4;
           case "OBJECT":
               _vehicle = _this;
               _currentConfig = configFile >> "CfgVehicles" >> (typeOf _vehicle);
               _depth = 0;
       if ((!isNil "_vehicle") && (!isNil "_currentNode") && (!isNil "_depth") && (!isNil "_result") && (!isNil "_currentConfig") && {((typeName _vehicle) == "OBJECT") && ((typeName _currentNode) == "ARRAY") && ((typeName _depth) == "SCALAR") && ((typeName _result) == "ARRAY") && ((typeName _currentConfig) == "CONFIG")} && {!isNull _vehicle}) then
           _cfgTurrets = _currentConfig >> "Turrets";
           if (isClass _cfgTurrets) then
               for "_i" from 0 to ((count _cfgTurrets) - 1) step 1 do
                   _currentNode set [_depth, _i];
                   _result set [count _result, +_currentNode];
                   [_vehicle, _cfgTurrets select _i, _currentNode, _depth + 1, _result] call fnc_GetAllTurretPaths;

  6. OMG, this is ONE MORE Client <-> Server exchanging system. I thought there's REALY some optimizing code but not.

    1. init.sqf

    [] execVM "BME\init.sqf";

    Using execVM may cause loading order issues, like it was in Warfare by Benny for example. And it's better to send null-pointer instead of empty array if you don't want to send eny kind of arguments:

    objNull call compile preprocessFileLineNumbers "BME\init.sqf";

    It guarantees loading order before any user script which are using that system.

    2. BME\init.sqf

    _garbage = [] spawn BME_fnc_queue;
    _garbage = [] call BME_fnc_eventhandler;
    _garbage = [] call BME_fnc_serverhandler;

    Same: use objNull.

    And... where is local var privatization? If you create local var _myvar, always add it to private block:

    private "_myvar";

    It'll be very bad if someone will create "_garbage" var and BME will be loaded between user scripts. _garbage variable value will be overrided with a script handle.

    Should be fixed with:

    private "_garbage";

    3. \BME\BME_queue.sqf

    waituntil {(count bme_queue) > 0};

    WOW! ARE YOU KIDDING ME? Oh yeah, I know the idea: LAGS FOR EVERYONE FOR FREE :)))) Not realy. And then people would curse BIS for laggy scripts / low FPS / etc. Very "nice" solution for ArmA servers.

    First off you MUST to know: waitUntil works on full speed 1 check per frame in non-scheduled environment but may be delayed. If you're using waitUntil with no delay it completely loads VM with useless work (most of loops have very low efficiency by design) in most of time. The VM's script scheduler will allocate its time between useless FAST loop and other scripts. Is it good?

    That part of the code should be recoded with no loop.

    4. \BME\BME_queue.sqf

    if((_type == "server") or (_type == "all")) then

    It's much better to compare vars by float/double values instead of strings.


    if ("aaaa" == "bbbb") then {...};
    if ("someshit" == "someshit") then {...};

    works much slower (depending on the strings size) than this:

    if (var1 == var2) then {...};
    if (_shit1 == _shit2) then {...};

    and it'll be better way to use macro instead creating local var for comparing:

    #define DO_SOME_SHIT  100
    #define DO_OTHER_SHIT 101
    switch (_input) do
       case DO_SOME_SHIT:
           // ...
       case DO_OTHER_SHIT 101:
           // ...
    // ...
    ["Hello World!", DO_SOME_SHIT] call fnc_MyShit;

    5. \BME\BME_queue.sqf

    call compile format["wcgarbage = [_variable] spawn BME_netcode_server_%1;", _variablename];


    You're using slow dynamic compilation instead of getting direct access to the var! Why?

    objNull spawn (missionNamespace getVariable (format ["BME_netcode_server_%1", _variablename]));

    Is wcgarbage var used elsewhere?

    bme_queue select 0
    bme_queue select 0
    bme_queue select 0

    Any reason to extract the array entry three times instead of using single-time extraction and storing it in local var?

    6. \BME\BME_eventhandler.sqf

    if!(tolower(_type) in ["client", "server", "all"]) exitwith {hint "BME: wrong destination parameter should be client|server|all"};
    switch (tolower(_type)) do {
    		case "server": {

    _variablevalue 	=  call compile format["%1", _variablename];

    See above. If you will use macros, toLower will not be used.

    (((bme_addqueue select 2) == "server") or ((bme_addqueue select 2) == "all")))
    (((bme_addqueue select 2) == "client") or ((bme_addqueue select 2) == "all")))

    Cool. "bme_addqueue select 2" is used FOUR times instead of ONE.

    bme_queue = bme_queue + [bme_addqueue];

    Why would you use binary addition instead of set?

    bme_queue set [count bme_queue, bme_addqueue];

    Also there's no something revolutionary to decrease network traffic, something like serializing arrays (I hope you know about arrays trasfered via net ;) click).

    Thanks for your time, that was a nice try, but for actual use it should be completely rewritten from the scratch. For mission/addon makers I dont recommend to use it because of explained reasons. Use BIS_fnc_MP instead or create new one with no gross errors in simple code.

    Also that article is very usefull for novices: http://community.bistudio.com/wiki/Code_Optimisation

  7. Nope, it's "regular" Hi-End available on market for all people. Intel Core i7 4770 + ATI Radeon HD7990. With Intel Core Quad 6600 + ATI Radeon 7770 I'm still getting playable 80-100 FPS. Domkrat gets about 200-250 FPS on his NVIDIA GeForce 590 and Intel Core i7 2500k with middle settings. But it's all in SP. FPS in MP missions varies depending on which mission runs and its quality.

  8. It's not just scripting. It's the AI, it's the PhysX, It's everything in a server that has to be calculated twice both by the server and by the client. It's a combination of A lot of processing work to be done, and then a bad network syncing model for the amount of data needing to be processed and sent across all clients, and exacerbated by the fact that no matter if it's a client or a dedicated server, the game just does not fully utilize our hardware like it should for the best performance.

    It's funny that BI is willing to use the community as both a scapegoat for their performance issue's, and then as their savior when it comes to content issue's.

    Current Life missions (Stratis or Altis Life) is an example how scripters can kill performance with bad code. Open Editor and compare: singleplayer with minimum scripts has very good FPS (I have > 300 FPS on my rig) even if you place a lot of units and objects. I'm agreed with your point about double calculations in some situations and scripts is a part of all combination. But this part is very-very important and resource demanding if coded not properly like most missions are.

  9. A lot of performance in multiplayer is eaten by retarded scripters, not BIS. Open some MP mission from community, it's written very shitty with a lot of loops, waitUntil's, spam with publicVariable, bad algorythms, no garbage collection and script errors (even on mission start!), .etc. It's not BIS fault! How can BIS help in that situation??? They can't stop community scripters to make shitty code.

  10. Hi! I need some information related to executing scripts in parallel on arma's VM. I'm aware of this thread but it doesn't cover all aspects about atomicity and nobody from BIS team had written in that topic.

    Let's begin.

    We have two threads with completely identical code which started almost at the same time:

    globalVariable = 0;
    fnc_Thread =
       // Some job
       diag_log format ["[fnc_Thread] _this: %1 | globalVariable: %2", _this, globalVariable];
    fnc_StartThreads =
       1 spawn fnc_Thread;
       2 spawn fnc_Thread;

    For example - I don't want to execute that threads in parallel: if some of that threads is already running - do not run another one. Obviously we have to set some flag that indicates, some thread is already running:

    locked = false; // at init phase
    fnc_Thread =
       if (!locked) then
           locked = true;
           // Some job
           diag_log format ["[fnc_Thread] _this: %1 | globalVariable: %2", _this, globalVariable];
           locked = false;

    So if locked == true then do not allow another thread to run. That's simple.

    Thread 1: if (!locked) then {// allow execution} (locked = false)

    Thread 1: then {locked = true;...} (locked = true)

    Thread 2: if (!locked) then {// not allowed} (locked = true)

    But for example we have a lot of concurent threads and low FPS (so often happened on ArmA servers, especially with a lot of objects on the map and high online). As we know from that article each statment is executed with 0.3 ms delay in scheduled environment. Now, what happens with threads working in parallel?

    Thread 1: if (!locked) then {// allow execution} (locked = false)

    Thread 2: if (!locked) then {// allow execution} (locked = false)

    Thread 1: then {locked = true;...} (locked = true)

    Thread 2: then {locked = true;...} (locked = true)

    Both threads began to execute statements in their THEN {...} block.

    Also there's a special syntax of the IF:

    _result = if (a > b) then {true} else {false};

    So the first question: is there any pause (0.3 ms) between expression evaluating in if (if_expression) and first expression in then {first_expression; second_expression; ...};

    As I understood from this thread - one expression is evaluated as atomic, in other words it's executed "at once". But it's related only for ONE expression with SEMICOLON at the end. In other words:

    if ((a > b) || (d < e) || (f == g)) then  // no delay and all expression evaulated at once
       sleep 0.0003; // 0.3 ms delay in scheduled environment
       sleep 0.0003;
       // same as above

    What happens if we will use alternative syntax?

    _result = if (test) then {c = a + b; true} else {d = e - f; false};

    The second question: Has whole IF block with alternative syntax evaluated at once?

    Samatra has suggested to use the next solution:

    (lock renamed to locked, because lock is reserved by the engine :))

    if(if(!locked) then {locked = true; true} else {false}) then {
       locked = false;

    This solution based on assumption that alternative syntax of the IF statement is atomic. But probably not.

    Anyone know how to solve the task: test/exchange the variable and set the flag at the same time like CMPXCHG of the x86 instruction set.

    English is not my native

  11. For example we have collection (array):

    _collection = [ [2, 10], [5, 20], [8, 35], [9, 12] ];

    We have to get 2th element from that collection by its internal value "8". The simpliest but not optimized way is:

    _internalValue = 8;
    _item = [];
       if (_internalValue == (_x select 0)) exitWith
           _item = _x;
    } forEach _collection;

    We will get [8, 35].

    But there's a performance problem: we have to ennumerate all elements in collection manually instead of using find command. Find command can return index (or -1) of the found element but it can't search ing nested arrays. Find command works much-much more faster than scripted solution with forEach loop + if (). In my case I should get (or precache) all internal values to use find command:

    _allInternalValues = [];
       _allInternalValues set [count _allInternalValues, _x select 0];
    } forEach _collection;

    Now we have the second array:

    [2, 5, 8, 9]

    and can use find command instead of forEach loop:

    _index = _allInternalValues find _internalValue;
    if (_index > -1) then
       _item = _collection select _index;

    Even we have an array with 1 000 000 elements it will work very fast if we will use FIND with precached internal values at the first entering to the script. But there's a penalty: we must precache all values first, even we have to search one element in large collection.

    Have someone suggestion or specific to arma algorythm to search in nested arrays as fast as it possible.

  12. It's related to unoptimized signature checking, not caching / loading. Game reads whole file / very large block at once. SSD is not solution or are you ready to buy SSD for all arma 3 players?

    There's temporarily solution for players who have no SSD but have enough RAM: use RAM Disk until BIS will fix that (Arma 2 had same issue but was fixed).

  13. Could you please confirm the preinit bit is executed on the server? e.g with a diag_log 'I R PREINIT';

    It works well. I checked it with diag_log before I began to post my second part of the message.

    there's an explicit player globalChat message in there, locally executed on the client with mismatch, not relevant to the fnc_debug

    Exactly! This is the root of the problem.

    Also I checked Init EH:

    class Extended_preInit_EventHandlers
       class MyAddon
           serverInit = "diag_log 'preInit on server side';";
    class Extended_Init_EventHandlers
       class MyAddon
           serverInit = "diag_log 'Init on server side';";
    class Extended_postInit_Eventhandlers
       class MyAddon
           serverInit = "diag_log 'postInit on server side';";

    And I got two messages only:

    [5010,156.347,0,"XEH: PreInit Started. v1.0.0.190. MISSINIT: missionName=TestInitCommands, worldName=Stratis, isMultiplayer=true, isServer=true, isDedicated=true"]

    "preInit on server side"

    [5010,156.712,0,"XEH: PreInit Finished. CACHE DISABLED? (Disable caching with cba_cache_disable.pbo): SLX_XEH_RECOMPILE=false, CBA_COMPILE_RECOMPILE=false, CBA_FUNC_RECOMPILE=false"]

    bin\config.bin/CfgMovesMaleSdr/States/AmovPknlMtacSlowWpstDf.InterpolateTo: Bad move AovrPknlMstpSlowWpstDf

    bin\config.bin/CfgMovesMaleSdr/States/AmovPknlMtacSlowWpstDf.InterpolateTo: Bad move AmovPknlMevaSlowWpstDf

    bin\config.bin/CfgMovesMaleSdr/States/AmovPknlMtacSlowWpstDfl.InterpolateTo: Bad move AmovPknlMevaSlowWpstDfl

    bin\config.bin/CfgMovesMaleSdr/States/AmovPknlMtacSlowWpstDfr.InterpolateTo: Bad move AmovPknlMevaSlowWpstDfr

    String STR_A3_cfgVehicles_FxCartridge0 not found

    String STR_A3_cfgVehicles_FxCartridge0 not found

    String STR_A3_cfgVehicles_FxCartridge_Small0 not found

    String STR_A3_cfgVehicles_FxCartridge_Small0 not found

    Speaker Male01_F not found in CfgVoiceTypes

    [5220,179.735,0,"XEH: PostInit Started"]

    "postInit on server side"

    [5220,179.774,0,"CBA_VERSIONING: cba=, cba_a3=, "]

    [5220,179.803,0,"XEH: PostInit Finished. State: _isClient=false, _isJip=false, _isDedClient=false, _isServer=true, _isDedServer=true, _playerCheckDone=true, _sp=false, _startInitDone=true, _postInitDone=true, _mpRespawn=true, _machineType=0, _sessionId=1, _level=0, _timeOut=false, _game=3, BIS_functions=L Alpha 1-1:1, group=L Alpha 1-1"]

  14. I need CBA functionality (just XEH) for my addon designed for server side only. How do I disable "You are missing the following mod: %1" message on clients without editing CBA? I just only need Extended_postInit_EventHandlers class to be used with serverInit field.

    nvm. lol.

    CBA_display_ingame_warnings = false;


    Doesn't work, clients still get message about missing cba_main right after the briefing screen.

    class CfgPatches
       class MyAddon
           units[] = { };
           weapons[] = { };
           requiredVersion = 0.100000;
           author = "Prodavec";
           version = "1.0";
           requiredAddons[] = {"Extended_EventHandlers"};
    class Extended_preInit_EventHandlers
       class MyAddon
           serverInit = "CBA_display_ingame_warnings = false; publicVariable 'CBA_display_ingame_warnings';";
    class Extended_postInit_Eventhandlers
       class MyAddon
           serverInit = "execVM 'MyServerStuff.sqf';";

    CBA_display_ingame_warnings is actually FALSE, checked with DevCon on client and server sides.

    What's wrong here?


    _str = 'if(isServer)exitWith{};0 = objNull spawn { sleep 1; sleep 1; _func={GVAR(mismatch)=[format["%2 (%1)",name player, player],_this];publicVariable QUOTE(GVAR(mismatch));_this spawn{_t=format["You are missing the following mod: %1",_this];diag_log text _t;sleep 2;player globalChat _t}};';

    So it seems it's not possible with no editing cba_versioning.pbo/XEH_postInitServer.sqf because CBA_display_ingame_warnings blocks global messages only:

    FUNC(handleMismatch) = {
    [format["%1 - Not running! (Machine: %2)", _mod, _machine], QUOTE(COMPONENT), [CBA_display_ingame_warnings, true, true]] call CBA_fnc_debug;

    Should be something like that with new variable CBA_display_ingame_warnings_local:

    _str = 'if(isServer)exitWith{};0 = objNull spawn { sleep 1; sleep 1; _func={GVAR(mismatch)=[format["%2 (%1)",name player, player],_this];publicVariable QUOTE(GVAR(mismatch));_this spawn{_t=format["You are missing the following mod: %1",_this];diag_log text _t;sleep 2; if (isNil "CBA_display_ingame_warnings_local") then {CBA_display_ingame_warnings_local = true;}; if (CBA_display_ingame_warnings_local) then {player globalChat _t};};};';

    at Init

    if (isServer) then
       CBA_display_ingame_warnings = false;
       publicVariable "CBA_display_ingame_warnings";
       CBA_display_ingame_warnings_local = false;
       publicVariable "CBA_display_ingame_warnings_local";