Polaris-Tactical-Arma / AI-spotDistance-adjuster

0 stars 0 forks source link

Adjustable spotDistance #1

Open EduardSchwarzkopf opened 2 years ago

EduardSchwarzkopf commented 2 years ago

BapKing:

We could tinker with these variables and use a script to apply them to night ops only Some kind of if statement that checks mission time, if it is after 8pm or a reasonable time that it gets dark then it sets all AI to lower values Or you could have it be something that you just add manually as a script to your night missions only which is less complex but would need to remember each time

image

EduardSchwarzkopf commented 2 years ago

that is perfect. We could test different values with that. Also it possible to make this a bit automated with https://community.bistudio.com/wiki/moonPhase I could write a small script, that is executed on mission start, to set that value. Needs to be tested with spawned in units, but this wouldnt be to much of a pain to implement

EduardSchwarzkopf commented 2 years ago
Daytime | AI equipment | AI skill and rank | player stance and speed | player outfit | first detection distance | first detection value | max detection (4) -- | -- | -- | -- | -- | -- | -- | -- 13:37 | Katiba + ACO (Green) | 0.5 - private | Standing, running | B_Soldier_F | 245.663 | 0.148076 | 132.863 13:37 | Katiba + ACO (Green) | 0.5 - private | Standing, running | underwear only, rifle | 246.815 | 1.19377 | 132.9 13:37 | Katiba + ACO (Green) | 0.5 - private | Standing, running | B_Soldier_F, no uniform | 241.885 | 1.24 | 132.56 13:37 | Katiba + ACO (Green) | 0.5 - private | Standing, running | B_Sniper_F | 156.715 | 2.95534 | 133.019 13:37 | Katiba + ACO (Green) | 0.5 - private | Lying down, running | B_Soldier_F | 105.401 | 4 | 105.401 13:37 | Katiba + ACO (Green) | 0.5 - private | Crouching, running | B_Soldier_F | 193.232 | 1.94615 | 134.556 13:37 | Katiba + ACO (Green) | 0.5 - private | Standing, sprinting | B_Soldier_F | 235.001 | 1.3146 | 134.445 13:37 | Katiba + ACO (Green) | 0.2 - private | Standing, running | B_Soldier_F | 214 | 0.166763 | 124.553 13:37 | Katiba + ACO (Green) | 1.0 - private | Standing, running | B_Soldier_F | 293.065 | 1.11004 | 140.088 13:37 | Katiba + ACO (Green) | 0.5 - colonel | Standing, running | B_Soldier_F | 245.641 | 1.20426 | 132.113 13:37 | no weapon | 0.5 - private | Standing, running | B_Soldier_F | 421.959 | 0.283476 | 109.274 13:37 | Katiba + LRPS | 0.5 - private | Standing, running | B_Soldier_F | 244.962 | 4 | 244.962 20:00 | Katiba + ACO (Green) | 0.5 - private | Standing, running | B_Soldier_F | 132.089 | 0.62443 | 49.4895 20:00 | Katiba + ACO (Green), no NVG | 0.5 - private | Standing, running | B_Soldier_F | 10.6837 | 4 | 10.6837

Code used:

player allowDamage false;
player enableFatigue false;

player setPosATL [0,0,0];
player setDir 0;
unit setPosATL [0,500,0];
unit setDir 180;

waitUntil {speed player > 0};

[unit, player] spawn {
    params ["_unit1", "_unit2"];
    private _time = time;
    private _knowsAboutData = [
        format ["world = %1\ndate = %2\nanim = %3\nweapon/scope = %4/%5\nskill/rank = %6/%7\nplayerType = %8",
            worldName,
            date,
            animationState player,
            primaryWeapon _unit1,
            (_unit1 weaponAccessories primaryWeapon _unit1) select 2,
            skill _unit1,
            rank _unit1,
            typeOf _unit2
        ]
    ];
    private "_knowsAbout";
    private "_entry";
    while { alive _unit1 && alive _unit2 } do
    {
        _knowsAbout = _unit1 knowsAbout _unit2;
        _entry = [_unit1 distance _unit2, _knowsAbout];
        _knowsAboutData pushBack _entry;
        systemChat format ["time: %1 - %2", round (time - _time), _entry];
        copyToClipboard str _knowsAboutData;
        sleep 1;
    };
};
EduardSchwarzkopf commented 2 years ago

Do not bother using that code

EduardSchwarzkopf commented 2 years ago

AI will see you with NVGs about 50-70 in any light condition at night. With our current setting, I was not able to see a unit in a pitch-black forest, but the ai had no problem. But while I'm able to see a unit on a full moon easily about 300m, an AI is not spotting me.