LordGolias / antistasi

Antistasi improved, a mod for the game Arma 3.
BSD 3-Clause "New" or "Revised" License
30 stars 18 forks source link

AI recruit: AI poorly chooses weapons #143

Open Warhammer47 opened 7 years ago

Warhammer47 commented 7 years ago

After recuiting an rifleman AI unit noticed that he came out with MP7 (PDW) and cap (no helmet). It is weird since there are much better rifleman weapons (5.56 and 6.5) and ammo (around 60 mags each) and helmets in the box/arsenal.

P.S. Tested using ACE in develop branch in MP

_veh addEve> 12:25:39 Error Undefined variable in expression: as_allmortarstatics 12:25:39 File fnc_initVehicle.sqf [AS_fnc_initVehicle], line 91 12:25:39 "[AS] Server: loading locations..." 12:25:41 "DICT:get([1675303: empty.p3d,""helis_armed"",""valid""]):ERROR: invalid key" 12:25:41 "DICT:get([1675303: empty.p3d,""helis_transport"",""valid""]):ERROR: invalid key" 12:25:41 "DICT:get([1675303: empty.p3d,""tanks"",""valid""]):ERROR: invalid key" 12:25:41 "DICT:get([1675303: empty.p3d,""apcs"",""valid""]):ERROR: invalid key" 12:25:41 "DICT:get([1675303: empty.p3d,""apcs"",""valid""]):ERROR: invalid key" 12:25:41 "[AS] Server: server side-variables initialized" 12:25:41 "[AS] Server: waiting for HQ position..." 12:25:41 "[AS] Client: waiting for commander to choose HQ location..." 12:25:46 "[AS] Server: loading HQ..." 12:25:46 "[AS] Server: loading FIA arsenal..." 12:25:46 "[AS] Server: spawn loop started." 12:25:46 "[AS] Server: resources loop started." 12:25:46 "[AS] Server: loading players..." 12:25:46 "[AS] Client: initialized" 12:25:46 "[AS] Server: loading AAF arsenal..." 12:25:47 "[AS] Server: loading missions..." 12:25:47 No speaker given for 12:25:48 "[AS] 2: new spawn 'fia_hq'" 12:25:48 "[AS] Server: scheduler_fnc_execute(AS_spawn_fnc_execute):" 12:25:48 "Worker 2: 29.6628" 12:25:48 "[AS] 2: spawn 'fia_hq' started state 'spawn'" 12:25:48 Performance warning: SimpleSerialization::Write 'resources' is using type of ',TASK' which is not optimized by simple serialization, falling back to generic serialization, use generic type or ask for optimizations for these types 12:25:48 "[AS] 2: spawn 'fia_hq' finished state 'spawn'" 12:25:48 "[AS] 2: spawn 'fia_hq' started state 'run'" 12:25:49 "[AS] 2: new spawn 'send_meds_regina'" 12:25:49 "[AS] Server: scheduler_fnc_execute(AS_spawn_fnc_execute):" 12:25:49 "Worker 2: 29.6628" 12:25:49 "[AS] 2: spawn 'send_meds_regina' started state 'initialize'" 12:25:49 "[AS] 2: spawn 'send_meds_regina' finished state 'initialize'" 12:25:49 "[AS] 2: spawn 'send_meds_regina' started state 'spawn'" 12:25:49 "[AS] 2: spawn 'send_meds_regina' finished state 'spawn'" 12:25:49 "[AS] 2: spawn 'send_meds_regina' started state 'run'" 12:25:49 "[AS] Server: loading completed." 12:26:30 No speaker given for 12:26:35 "[AS] 2: new spawn 'aaf_road_patrol_68'" 12:26:35 "[AS] Server: scheduler_fnc_execute(AS_spawn_fnc_execute):" 12:26:35 "Worker 2: 25.5971" 12:26:35 "[AS] 2: spawn 'aaf_road_patrol_68' started state 'spawn'" 12:26:35 Performance warning: SimpleSerialization::Write 'resources' is using type of ',TASK' which is not optimized by simple serialization, falling back to generic serialization, use generic type or ask for optimizations for these types 12:26:35 "[AS] 2: spawn 'aaf_road_patrol_68' finished state 'spawn'" 12:26:35 "[AS] 2: spawn 'aaf_road_patrol_68' started state 'run'" 12:26:38 "[AS] 2: spawn 'aaf_road_patrol_68' finished state 'run'" 12:26:38 "[AS] 2: spawn 'aaf_road_patrol_68' started state 'clean'" 12:26:38 "[AS] 2: spawn 'aaf_road_patrol_68' finished state 'clean'" 12:26:47 String STR_A3_RscGroupRootMenu_Items_ActivateMine0 not found 12:26:47 String STR_A3_RscGroupRootMenu_Items_ActivateMine0 not found 12:26:47 Unknown attribute itemsCmd 12:26:47 Unknown attribute itemsCmd

StefArma commented 7 years ago

They pick only unlocked weapons, you can always select them and use the AI command to interact with arsenal, from there you can costumize them how you prefer and even save/load preset

nothing useful in the rpt about that as far as i can see

Warhammer47 commented 7 years ago

Unlocked? I think the new Antistasi (by Golias) removes locked, infinite weapons. Yes but that looks like time consuming, no?

StefArma commented 7 years ago

Ahh then is similar to 1.7.17 with jeroen arsenal, sorry i tought the unlocking system was still there + the addition of taking items from the inventory directly on Arsenal interface.

Good to know

LordGolias commented 6 years ago

Weapon selection is done by the function AS_fnc_getBestWeapon.

I added a simple test (run using [] execVM "tests\test_bestWeapon.sqf";) that illustrates how the function is called. It selects the best valid weapon based on:

unlocked weapons count as if they have count = 100 in availability

Can you write a test that fails, illustrating your case?