Jump to content

Prodavec

Member
  • Content Count

    107
  • Joined

  • Last visited

  • Medals

  • Medals

Posts posted by Prodavec


  1. I know reasons for using so much disk space... It's just not comfortable for me (Just my opinion, no offense) and there is no option to automaticaly delete .pack dir after update. And that's not solution to speed up update because SU will convert my mods to SU-mods on the next update process. If you update ACE that becames the hell.

    Because we like it

    This is the key thing - "WE"

    You - the developer

    Me - the software user

    If you should to develop the program for the shortest time and get the money for you job - it's really good solution. Minimum time - maximum money. Something like "Rapid Application Development" by the Borland. Maximum security - minimum time for service and deploying. Basicaly there's no performance goals on that platform.

    Software developer doesn't care corporate end-user's hardware and corporate end-user doesn't care hardware because it bought by the company. In case of home user the situation is a bit different: in most cases the PC has been bought by user's money and there's no projects which demand critical development time.

    I'm really ready to wait 1-2-3 months but want to get high performance app with fast start (one mouse click - app is opened and ready on "OnLeftMouseButtonUp" event :)) and low resources consumption in the updating process. Commit charge >250 MB with 60-100% CPU usage and ~20-50% kernel mode is not good for "addon downloader". I'll prefer to use rsync directly via command or something like Total Commander (or any other fast native FTP client) if addons are on FTP server.

    Thanks a lot.


  2. there will always be abusive admins no matter what game you play.

    Well, I play online games since 96 year. Quake/CS/CoD/BF had/has a bunch of players in their communities and generally abusive admins which tried to use admin hax... sorry... tools (I forget, admins do not hack, they just do their job :)) they were a rare exception from the rule. Also, big online allows to change the server and forget. There's low online in ArmA because basically it is a game for mature players and that's a problem. When you kicked/banned/abused by kiddy in CoD/BF is not the same in ArmA with low online. You just have no choice. Yeah, you may swap tha server but some of them, have no players, run some buggy map, require to follow rules like you're playing not a game but court simulator or just high ping.

    Look at the forum, here's people which complain about players even... admins! It's very bad for "mature" community, because in "non-mature" communities posts/threads like that would be just funny joke with no actual complaining because it's just a game.


  3. Got following results on my machine and test map with constant conditions:

    1 million iterations

    [0, 0, 0] distance _vector;
    // 55s
    
    sqrt ((_vector select 0)^2 + (_vector select 1)^2 + (_vector select 2)^2);
    // 97s
    
    ([0,0,0] distance [(_vector select 0)*1000, (_vector select 1)*1000, (_vector select 2)*1000]) / 1000;
    // 136s
    
    (ASLToATL [0, 20000, 0]) distance (ASLToATL [(_vector select 0), 20000 + (_vector select 1), (_vector select 2)]);
    // 130s
    

    PS _vector is predefined as _vector = [2, 2, 2] outside of the testing loop.

    UPDATE

    Nice testing. Although to be fair the test should then be:

    Yeah! Recalculated.


  4. Also for some reasons it is not constant (even it's mystical map distance and on the LAND) and differs like SaMatra described. Looks like the water waves are the border of the world. So no way to calculate vector magnitude by single command? :(

    Got it. That's weird. It is called the crutches.


  5. Well, I want to use "native" engine method to get vector magnitude by using DISTANCE command for perfomance reasons.

    _vector distance [0, 0, 0];
    

    but for some reasons DISTANCE works strange for me in that case. It returns something random if called few times in a row. For example:

    [2, 2, 2] distance [0, 0, 0];
    

    you will get values between 3.4 and 3.5. +/- 0.1 m is very bad when using DISTANCE to calculate tiny vectors and small angles between them.

    Classic way works pretty fine:

    sqrt (2^2 + 2^2 + 2^2);
    

    RESULT: 3.4641

    But it impacts on perfomance more than DISTANCE comamnd because contains more operations executed in not "native" environment.

    Any suggestions gents?


  6. reported multiple times

    Does it mean the player should be detected on multiple servers with restricted scripts or multiple BE records of the one server at random time (for ex. Monday, Tuesday, Friday, Sunday, next week...)?

    Anyway it means it's possible. Just need to compose few false reports at random time and few random servers, for example at my servers and servers of my friend which administrates some other server(s).

    Right?

    Basically I thought it is FULLY automated process with no intervention of the admin(s).


  7. Well, you're right. I guess for loop is needed for maximum possible perfomance when you're working with large array (or you need a lot of iterations).

    You could do it like this to prevent this issue:

    Oh... this is additional expression to execute.

    But then again I don't have to live with 2fps

    I'm very aware of perfomance, because... you know ArmA is lagging most of the time. A lot of people still playing with 20-40 FPS (just check last videos with A3 demonstrating on VERY powerfull PC. Even developers play with lags!), that is not so much especialy in CQB. Or they need to reduce video settings to get 60-100 FPS but graphics becames crappy. I very often hear: "I got new rig with 32 GB RAM, 690 GTX in SLI and i7 3570 processor but ArmA, the game of the 2009 year still lags. WTF?!?!? *going mad*" lol.

    So I have to make ideal code :)


  8. Understand. I see perfomances difference betweent forEach and FOR loop and I guess it is better to use FOR loop if it's possible even counter is not used.

    But forEach loop has advances (just tested): you'll never get Zero Divisor message:

    {
       // a bunch of code here and we're running low-end machine with low FPS
       // _x is unit
       // some one was killed and allUnits array has been decreased... we still working inside of loop with no problems
    } forEach allUnits;

    for "_i" from 0 to ((count allUnits)-1) step 1 do
    {
       _unit = allUnits select _i;
       // some one was killed and we get decreased allUnits, but FOR doesn't "know" about this. Loop condition doesn't evaluate second time.
       // we getting Error Zero Divisor
    };

    Got some perfomance results:

       // forEach with _forEachIndex instead of COUNT command
       {
           _array2 set [_forEachIndex, _x];
       } forEach _array1;
       // RESULTS
       // With no RESIZE: 56.6719 / 56.3047 / 56.2109
       // With RESIZE: 57.6094 / 57.0625 / 56.7656
    


  9. Muzzleflash

    Thanks a lot! That info should be in wiki :)

    Deadfast

    I did few tests:

    _msg = "BEGINING BENCHMARK...";
    hint _msg;
    player groupChat _msg;
    diag_log _msg;
    
    // Prepare (here is static part)
    // -------------------
    _array1 = [];                       // define _array1
    _array2 = [];                       // define _array2
    for "_i" from 0 to 10000 step 1 do
    {
       _array1 set [_i, random 10];    // Fill _array1 with random data, total 10000 items
    };
    _size = count _array1;              // size of _array1
    _array2 resize _size;               // make resize _array2 to prevent resizing in each iteration
    _k = 0;                             // counter
    // -------------------
    
    _t1 = diag_tickTime;                
    // The Test
    // -------------------
    for "_i" from 0 to 100 step 1 do
    {
       // forEach speed test
       /*
       {
    
       } forEach _array1;
       */
       // RESULTS: 3.24219 / 3.13281 / 3.13281
    
       // forEach + SET with COUNT command
       /*
       {
           _array2 set [count _array2, _x];
       } forEach _array1;
       */
       // RESULTS
       // With no RESIZE: 66.6172 / 65.2266 / 65.3594
       // With RESIZE: 65.7344 / 66.5781 / 65.2344
    
       // forEach + SET with counter increased manualy
       /*
       {
           _array2 set [_k, _x];
           _k = _k + 1;
       } forEach _array1;
       */
       // RESULTS
       // With no RESIZE: 84.75 / 85.2188 / 84.4609
       // With RESIZE: 85.5703 / 84.7266 / 85.75
    
       // FOR speed test
       /*
       for "_n" from 0 to (_size-1) step 1 do
       {
    
       };
       */
       // RESULTS: 2.64063 / 2.63281 / 2.64063
    
       // FOR + SET with internal FOR's counter which increased automatically
       /*
       for "_n" from 0 to (_size-1) step 1 do
       {
           _array2 set [_n, _array1 select _n];
       };
       */
       // RESULTS
       // With no RESIZE: 53.5 / 53.0703 / 53.3594
       // With RESIZE: 53.6406 / 53.6641 / 53.3047
    
       // + Unary Operator (the fastest way!)
       /*
       _array2 =+ _array1;
       */
       // RESULTS: 0.710938 / 0.757813 / 0.734375
    };
    // -------------------
    _t2 = diag_tickTime;
    
    _msg = format ["EXECUTION TIME: %1", (_t2 - _t1)];
    hint _msg;
    player groupChat _msg;
    diag_log _msg;
    

    As you can see RESIZE doesn't influence on the perfomance in my test or influences very-very little (within an error).

    So if I want to copy an array I have to use + unary operator:

    _array2 =+ _array1;

    instead of simple = or SET

    If I will have to do some processing I'd prefer to use FOR "<counter>" instead of other methods, because it's fastest way.

    Right?

    That's why you don't see the change.

    Got it!

    That's why you don't see the change.

    _array1 = [1, 2, 3];
    _array2 = _array1;
    _array1 set [0, 4];
    hint str _array2;

    Getting [4,2,3] as I expected.

    But I still don't understand, you says:

    That was the first line, so now _someBigArray ---> #ARR_B, now to the second line:

    Now we have #ARR_B, it doesn't contain objNulls anymore.

    I do:

    _someOtherBigArray = _someBigArray;

    So both arrays reference the same data. If you do:

    because it's two pointers which refer on the same array.

    But for some reason on extremely low FPS I'm getting something like that:

    _someBigArray ---> #ARR_A: [1, 2, 3, objNull, 5, objNull, 7, 8, 9, objNull];
    _someBigArray = _someBigArray - [objNull]; // remove objNulls
    _someBigArray ---> #ARR_B: [1, 2, 3, 5, 7, 8, 9];
    _someOtherBigArray = _someBigArray;

    and theoreticaly we should get second pointer to the same array:

    _someOtherBigArray ---> #ARR_B: [1, 2, 3, 5, 7, 8, 9];

    _someBigArray and _someOtherBigArray refers to #ARR_B. It's easy to understand and it works until we have enough FPS.

    Actually I'm getting this when FPS 0.5-2:

    _someOtherBigArray ---> #ARR_C: [1, 2, 3, objNull, 5, 7, 8, 9];

    WTF? It looks like it's hybrid array of A and B but MUST be #ARR_B with no objNull inside!

    I currently cant create new reference because of this:

    _someBigArray = _someBigArray - [objNull]; // #ARR_A to #ARR_B but with no objNulls
    _someOtherBigArray = _someBigArray; // new pointer to #ARR_B
    

    _someOtherBigArray will consist objNulls. Hm?

    Found the roots of the problem. Topic may be closed. Thanks Muzzleflash for explaining how references work.

    while {true} do
    {
       _someBigArray = [...];
       for .... do
       {
           //...
           _someBigArray = _someBigArray - [objNull];
       };
       _someOtherBigArray = _someBigArray;
       sleep N;
    };
    

    _someOtherBigArray will get [objNulls] inside of it at the next iteration of WHILE. Goddamit. :)


  10. Why don't you set up a sleep just before copying your array?

    Anyway, i guess nobody really considers trouble happening between one and five FPS, because you simply cannot play the game at those framerates.

    I don't use sleep because:

    1. It is not realiable. It may help, but because of scheduler architecture sometimes you have to increase delay time, sometime decrease. And there's no indication of process completion like _waitUntil {_copyingCompleted};

    2. It is not possible to use sleep or waitUntil in non-scheduled environment by design. Function should be universal: may be called in non-scheduled and in scheduled environments.

    because you simply cannot play the game at those framerates.

    Well, code should be realiable in all possible situations. 0.5-5 FPS is like stress-test and it's not passed.

    Your assumption that this creates a copy is incorrect. Arrays are basically pointers, you just copy the reference.

    Hmm... you mean in SQF _someArray is just a pointer like in C/C++? What about wiki:

    Removing elements from an array

    When FIFO removing elements from an array, the set removal method works best, even if it makes a copy of the new array.

    ARRAYX set [0, objnull];
    ARRAYX = ARRAYX - [objnull];

    It looks like the array is just variable, not a pointer. And I did simple test

    _array1 = [1, 2, 3];
    _array2 = _array1;
    _array1 = [1, 1, 1];
    hint str _array2;
    

    and I see [1,2,3] not [1,1,1]. If it was the pointer then I should see changed _array1: [1,1,1].

    _someBigArray = [item1, item2, item3, ..., itemN]; // A bunch of elements
    _someOtherBigArray = [];
    _someOtherBigArray resize (count _someBigArray); //Pre-allocate the array
    
    _n = 0;
    for "_i" from 0 to ((count _someBigArray)-1) step 1 do
    {
       if (alive (_someBigArray select _i)) then
       {
           _someOtherBigArray set [_n, _someBigArray select _i];
           _n = _n + 1;
       };
    };
    
    _someOtherBigArray resize _n; //Remove unused elements at the end 

    Why are you using RESIZE if you are using SET command? SET automaticaly resizes array if needed. Maybe because it resizes every iteration you have used RESIZE at the begining outside of the loop?

    Well. This method works and I'm using it. But in this case you have to pass thru _someBigArray to copy all elements to another one. And this is not good when you've possible alternative variants like

    _someOtherBigArray = _someBigArray;

    or something else executed inside of engine, not a script layer.

    I will try to use Binary Addition to compare two methods, with FOR + SET and =+.

×