Jump to content
Sign in to follow this  
sander

Settings influencing AI handling of AT weapon

Recommended Posts

Hi,

Which settings in the ammunition - or weapon config settings influence the AI handling of an AT launcher?

The optic for a Panzerfaust 3 addon works very well for human players in combination with the config reproduced below with a high probability of hit at the different ranges out to 400 meters. The AI troops equipped with the weapon on the other hand have great trouble using the weapon, dropping their rounds in the ground at 120-150 meters. Varying thrust values, thrustTime and distanceZoomMin/distanceZoomMax do not significantly alter AI performance, although the former do impact human users (overshooting the target when using thrusttime > 0). Does anybody know of particular values that can be manipulated to help the AI hit their mark with an unguided missile?

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

//

// Adapted with permission from the BW-Mod.

//

//

// some basic defines

#define TEast 0

#define TWest 1

#define TGuerrila 2

#define TCivilian 3

#define TSideUnknown 4

#define TEnemy 5

#define TFriendly 6

#define TLogic 7

#define true 1

#define false 0

// type scope

#define private 0

#define protected 1

#define public 2

#define VSoft 0

#define VArmor 1

#define VAir 2

#define CanSeeRadar 1

#define CanSeeEye 2

#define CanSeeOptics 4

#define CanSeeEar 8

#define CanSeeCompass 16

#define CanSeeRadarC CanSeeRadar+CanSeeCompass

#define CanSeeAll 31

#define CanSeePeripheral 32

#define ReadAndWrite 0 //! any modifications enabled

#define ReadAndCreate 1 //! only adding new class members is allowed

#define ReadOnly 2 //! no modifications enabled

#define ReadOnlyVerified 3 //! no modifications enabled, CRC test applied

#define LockNo 0

#define LockCadet 1

#define LockYes 2

#define WeaponNoSlot 0 // dummy weapons

#define WeaponSlotPrimary 1 // primary weapons

#define WeaponSlotSecondary 4 // secondary weapons

#define WeaponSlotHandGun 2 // HandGun

#define WeaponSlotHandGunItem 16 // HandGun magazines

#define WeaponSlotItem 256 // items

#define WeaponSlotBinocular 4096 // binocular

#define WeaponHardMounted 65536

#define SPEED_STATIC 1e10

#define NEVER_DESTROY 1000 // for MP - destroying dead bodies

#define TracerEColor 0.2,0.8,0.1

#define TracerWColor 0.8,0.5,0.1

#define TracerGColor 0.7,0.7,0.5

#define TracerNColor 0,0,0 // used for sniper / silenced rifles

#define TracerEColorF {TracerEColor,0.040}

#define TracerWColorF {TracerWColor,0.040}

#define TracerGColorF {TracerGColor,0.040}

#define TracerNColorF {TracerNColor,0.005}

#define TracerSEColorF {TracerEColor,0.25}

#define TracerSWColorF {TracerWColor,0.25}

#define TRACER_W_ALWAYS tracerColor[]=TracerWColorF;tracerColorR[]=TracerWColorF

#define TRACER_W_OPTIONAL tracerColor[]=TracerWColorF;tracerColorR[]=TracerNColorF

#define TRACER_W_STRONG tracerColor[]=TracerSWColorF;tracerColorR[]=TracerSWColorF

#define TRACER_E_ALWAYS tracerColor[]=TracerEColorF;tracerColorR[]=TracerEColorF

#define TRACER_E_OPTIONAL tracerColor[]=TracerEColorF;tracerColorR[]=TracerNColorF

#define TRACER_E_STRONG tracerColor[]=TracerSEColorF;tracerColorR[]=TracerSEColorF

#define TRACER_G_ALWAYS tracerColor[]=TracerGColorF;tracerColorR[]=TracerGColorF

#define TRACER_G_OPTIONAL tracerColor[]=TracerGColorF;tracerColorR[]=TracerNColorF

#define TRACER_N_ALWAYS tracerColor[]=TracerNColorF;tracerColorR[]=TracerNColorF

class CfgPatches

{

class llwsrat

{

units[]=

{

llwsrat_Soldier_HG,

llwsrat_Soldier_Tandem_HG,

llwsrat_Soldier_BF_HG,

llwsrat_Soldier,

llwsrat_Soldier_Tandem,

llwsrat_Soldier_BF

};

weapons[]=

{

LLW_PzFst3, LLW_PzFst3_HG

};

requiredAddons[]={};

requiredVersion=1.08;

};

};

class CfgModels

{

class default{};

class Weapon: default{};

class LLW_pzfst3: Weapon {};

class LLW_pzfst3_loaded: Weapon {}

};

class cfgAmmo

{

/*extern*/ class Default;

/*extern*/ class RocketCore;

class LLW_Bullet_Pzf : RocketCore

{

soundHit[] = {"\ca\Weapons\Data\Sound\explosion_large1", db33, 1};

soundFly[] = {"\ca\Weapons\Data\Sound\rocket_fly1", db-20, 1.5};

soundEngine[] = {"\ca\Weapons\Data\Sound\noise", db-50, 1};

supersonicCrackNear[] = {"\ca\Weapons\Data\Sound\supersonic_crack_close.wss", 1, 1};

supersonicCrackFar[] = {"\ca\Weapons\Data\Sound\supersonic_crack_50meters.wss", 1, 1};

timeToLive=4.5;

thrust=500;

thrustTime=0.0;

sideAirFriction=0;

visibleFire = 24; // how much is visible when this weapon is fired

audibleFire = 16;

CraterEffects = "MissileCrater";

explosionEffects = "ExplosionEffects";

};

//PzF - Monohohlladung

class LLW_Bullet_PzF_3 : LLW_Bullet_Pzf

{

hit=750;

indirectHit=15;

indirectHitRange=1;

model="\llwsrat\pzf3\g_pzf_3.p3d";

};

//PzF - Tandemhohlladung

class LLW_Bullet_PzF_3T : LLW_Bullet_Pzf

{

hit=900;

indirectHit=15;

indirectHitRange=1;

model="\llwsrat\pzf3\g_pzf_3t.p3d";

};

//PzF - Bunkerfaust

class LLW_Bullet_PzF_BF : LLW_Bullet_Pzf

{

hit=130;

indirectHit=40;

indirectHitRange=10;

model="\llwsrat\pzf3\g_pzf_bf.p3d";

};

};

class cfgRecoils

{

llwsratrecoil[]=

{

0.02,0,0,

0.05,0.08,0.03,

0.1,0.03,0.015,

0.2,0,0

};

};

class CfgMagazines

{

/*extern*/ class Default;

/*extern*/ class CA_Magazine;

/*extern*/ class CA_LauncherMagazine;

class LLW_PzFst3: CA_LauncherMagazine

{

type = 256;

reloadAction = ManActReloadAT;

initSpeed=243;

};

class LLW_PzFst3_HG: CA_LauncherMagazine

{

type = 16;

reloadAction = ManActReloadAT;

initSpeed=243;

};

class LLW_PzF_3 : LLW_PzFst3

{

type = 3*WeaponSlotItem;

scope = public;

displayName="Panzerfaust 3";

picture="\llwsrat\pic\m_pzf3_pf_ca.paa";

modelSpecial="\llwsrat\pzf3\llw_pzf_3.p3d";

ammo="LLW_Bullet_PzF_3";

class Library {

libTextDesc = "The Panzerfaust 3 DM 12A1 round has a single charge HEAT warhead capable of penetrating over 700mm RHA (Rolled Homogenous Armour).";

};

};

class LLW_PzF_3T : LLW_PzFst3

{

type = 3*WeaponSlotItem;

scope = public;

displayName="Panzerfaust 3-T";

picture="\llwsrat\pic\m_pzf3_pf_ca.paa";

modelSpecial="\llwsrat\pzf3\llw_pzf_3t.p3d";

ammo="LLW_Bullet_PzF_3T";

class Library {

libTextDesc = "The Panzerfaust 3 DM 22 round has a tandem charge HEAT warhead capable of penetrating up to 900mm RHA (Rolled Homogenous Armour). The tandem hollow charge allow the round to defeat ERA (Explosive Reactive Armour) tiles.";

};

};

class LLW_PzF_BF : LLW_PzFst3

{

type = 3*WeaponSlotItem;

scope = public;

displayName="Bunkerfaust";

picture="\llwsrat\pic\m_pzf3_bf_ca.paa";

modelSpecial="\llwsrat\pzf3\llw_pzf_bf.p3d";

ammo="LLW_Bullet_PzF_BF";

class Library {

libTextDesc = "The Panzerfaust 3 DM 32 round known as the Bunkerfaust has a two stage warhead capable of penetrating field fortifications before exploding the main high explosive fragmentation charge.";

};

};

//

// An additional launcher using ammunition stored in the handgun ammunition slots

//

class LLW_PzF_3_HG : LLW_Pzfst3_HG

{

type = 4*WeaponSlotHandGunItem;

scope = public;

displayName="Panzerfaust 3";

picture="\llwsrat\pic\m_pzf3_pf_ca.paa";

modelSpecial="\llwsrat\pzf3\llw_pzf_3.p3d";

ammo="LLW_Bullet_PzF_3";

class Library {

libTextDesc = "The Panzerfaust 3 DM 12A1 round has a single charge HEAT warhead capable of penetrating over 700mm RHA (Rolled Homogenous Armour).";

};

};

class LLW_PzF_3T_HG : LLW_PzFst3_HG

{

type = 4*WeaponSlotHandGunItem;

scope = public;

displayName="Panzerfaust 3-T";

picture="\llwsrat\pic\m_pzf3_pf_ca.paa";

modelSpecial="\llwsrat\pzf3\llw_pzf_3t.p3d";

ammo="LLW_Bullet_PzF_3T";

class Library {

libTextDesc = "The Panzerfaust 3 DM 22 round has a tandem charge HEAT warhead capable of penetrating up to 950mm RHA (Rolled Homogenous Armour). The tandem hollow charge allow the round to defeat ERA (Explosive Reactive Armour) tiles.";

};

};

class LLW_PzF_BF_HG : LLW_PzFst3_HG

{

type = 4*WeaponSlotHandGunItem;

scope = public;

displayName="Bunkerfaust";

picture="\llwsrat\pic\m_pzf3_bf_ca.paa";

modelSpecial="\llwsrat\pzf3\llw_pzf_bf.p3d";

ammo="LLW_Bullet_PzF_BF";

class Library {

libTextDesc = "The Panzerfaust 3 DM 32 round known as the Bunkerfaust has a two stage warhead capable of penetrating field fortifications with a primary armour piercing charge before exploding the main high explosive fragmentation grenade.";

};

};

};

class cfgWeapons

{

/*extern*/ class Default;

/*extern*/ class LauncherCore;

/*extern*/ class Launcher;

class LLW_PzFst3: Launcher

{

scope = public;

displayName="Panzerfaust";

model="\llwsrat\pzf3\llw_pzf.p3d";

modelOptics="\llwsrat\pzf3\optik.p3d";

ffMagnitude=0.1;

ffFrequency=1;

ffCount=1;

opticsZoomMin = 0.15;

opticsZoomMax = 0.15;

distanceZoomMin = 200;

distanceZoomMax = 200;

recoil=llwsratrecoil;

aiRateOfFire=10.0; // delay between shots at given distance

aiRateOfFireDistance=500; // at shorter distance delay goes lineary to zero

picture="\llwsrat\pic\w_pzf3_ca.paa";

magazines[]={ "LLW_Pzf_3","LLW_Pzf_3T","LLW_Pzf_BF"};

sound[]={\ca\Weapons\Data\Sound\RocketLauncher_Shot04_A,db30,1}; //pokus

drySound[]={\ca\Weapons\Data\Sound\Javelin_dry_v1,db-80,1};

reloadMagazineSound[]={\ca\Weapons\Data\Sound\flare_reload,db-70,1};

initSpeed=250;

class Library

{

libTextDesc = "The Panzerfaust 3 launcher is in service with the Netherlands armed forces in the short range anti tank role. The weapon is capable of firing the Bunkerfaust munition in order to destroy field fortifications in addition to a variety of unitary - or tandem hollow charge HEAT rounds that can defeat the armour of MBT's.";

};

};

//

// An additional launcher using ammunition stored in the handgun ammunition slots

//

class LLW_PzFst3_HG: Launcher

{

scope = public;

displayName="Panzerfaust";

model="\llwsrat\pzf3\llw_pzf.p3d";

modelOptics="\llwsrat\pzf3\optik.p3d";

ffMagnitude=0.1;

ffFrequency=1;

ffCount=1;

opticsZoomMin = 0.15;

opticsZoomMax = 0.15;

distanceZoomMin = 200;

distanceZoomMax = 200;

recoil=llwsratrecoil;

aiRateOfFire=10.0; // delay between shots at given distance

aiRateOfFireDistance=500; // at shorter distance delay goes lineary to zero

picture="\llwsrat\pic\w_pzf3_ca.paa";

magazines[]={ "LLW_Pzf_3_HG","LLW_Pzf_3T_HG","LLW_Pzf_BF_HG"};

sound[]={\ca\Weapons\Data\Sound\RocketLauncher_Shot04_A,db30,1}; //pokus

drySound[]={\ca\Weapons\Data\Sound\Javelin_dry_v1,db-80,1};

reloadMagazineSound[]={\ca\Weapons\Data\Sound\flare_reload,db-70,1};

class Library

{

libTextDesc = "The Panzerfaust 3 launcher is in service with the Netherlands armed forces in the short range anti tank role. The weapon is capable of firing the Bunkerfaust munition in order to destroy field fortifications in addition to a variety of unitary - or tandem hollow charge HEAT rounds that can defeat the armour of MBT's.";

};

};

//

};

class cfgNonAIVehicles

{

/*extern*/ class ProxyWeapon;

class ProxyLLW_pzfst3: ProxyWeapon {};

class ProxyLLW_pzfst3_loaded: ProxyWeapon {};

};

class cfgVehicles

{

/*extern*/ class SoldierWB;

/*extern*/ class SoldierWAT;

/*extern*/ class SoldierWMiner;

/*extern*/ class SoldierGB;

/*extern*/ class SoldierGAT;

/*extern*/ class SoldierGGuard;

/*extern*/ class SoldierGMiner;

class llwsrat_Soldier: SoldierGAT

{

accuracy=1000;

displayname="AT Soldier (Panzerfaust 3)";

weapons[]={"M16A2","LLW_PzFst3","Throw","Put"};

magazines[]={ "30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag",

"30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag",

"30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag",

"LLW_PzF_3","LLW_PzF_3" };

};

class llwsrat_Soldier_Tandem: SoldierGGuard

{

accuracy=1000;

displayname="AT Soldier (Panzerfaust 3 Tandem Warhead)";

weapons[]={"G36K","LLW_PzFst3","M9","Throw","Put"};

magazines[]={ "30Rnd_556x45_G36","30Rnd_556x45_G36",

"30Rnd_556x45_G36","30Rnd_556x45_G36",

"30Rnd_556x45_G36","30Rnd_556x45_G36",

"15Rnd_9x19_M9","15Rnd_9x19_M9",

"15Rnd_9x19_M9","15Rnd_9x19_M9",

"LLW_PzF_3T","LLW_PzF_3T" };

};

class llwsrat_Soldier_BF: SoldierGMiner

{

accuracy=1000;

displayname="AT Soldier (Bunkerfaust)";

weapons[]={"M16A2GL","LLW_PzFst3","Throw","Put"};

magazines[]={ "30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag",

"30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag",

"30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag",

"1Rnd_HE_M203", "1Rnd_HE_M203",

"1Rnd_HE_M203", "1Rnd_HE_M203",

"1Rnd_HE_M203", "1Rnd_HE_M203",

"1Rnd_HE_M203", "1Rnd_HE_M203",

"LLW_PzF_BF","LLW_PzF_BF" };

};

class llwsrat_Soldier_HG: SoldierWAT

{

accuracy=1000;

displayname="AT Soldier (Panzerfaust 3)";

weapons[]={"M4AIM","LLW_PzFst3_HG","NVGoggles","Throw","Put"};

magazines[]={ "30Rnd_556x45_Stanag","30Rnd_556x45_Stanag",

"30Rnd_556x45_Stanag","30Rnd_556x45_Stanag",

"30Rnd_556x45_Stanag","30Rnd_556x45_Stanag",

"30Rnd_556x45_Stanag","30Rnd_556x45_Stanag",

"HandGrenadeTimed","HandGrenadeTimed",

"HandGrenadeTimed","HandGrenadeTimed",

"LLW_PzF_3_HG","LLW_PzF_3_HG" };

};

class llwsrat_Soldier_Tandem_HG: SoldierWAT

{

accuracy=1000;

displayname="AT Soldier (Panzerfaust 3 Tandem Warhead)";

weapons[]={"M4AIM","LLW_PzFst3_HG","NVGoggles","Throw","Put"};

magazines[]={ "30Rnd_556x45_Stanag","30Rnd_556x45_Stanag",

"30Rnd_556x45_Stanag","30Rnd_556x45_Stanag",

"30Rnd_556x45_Stanag","30Rnd_556x45_Stanag",

"30Rnd_556x45_Stanag","30Rnd_556x45_Stanag",

"HandGrenadeTimed","HandGrenadeTimed",

"HandGrenadeTimed","HandGrenadeTimed",

"LLW_PzF_3T_HG","LLW_PzF_3T_HG" };

};

class llwsrat_Soldier_BF_HG: SoldierWMiner

{

accuracy=1000;

displayname="AT Soldier (Bunkerfaust)";

weapons[]={"M4AIM","LLW_PzFst3_HG","NVGoggles","Throw","Put"};

magazines[]={ "30Rnd_556x45_Stanag","30Rnd_556x45_Stanag",

"30Rnd_556x45_Stanag","30Rnd_556x45_Stanag",

"30Rnd_556x45_Stanag","30Rnd_556x45_Stanag",

"HandGrenadeTimed","HandGrenadeTimed",

"Mine","PipeBomb",

"LLW_PzF_BF_HG","LLW_PzF_BF_HG" };

};

};

Regards,

Sander

Share this post


Link to post
Share on other sites

You want to fiddle with maxSpeed value in ammo config. It's an AI setting that dictates how high/low they should aim. If the rounds fall short, lower the maxSpeed (it's a completely empiric value that doesn't have to do with the actual speed of the rocket). Experiment with this value until they start hitting the target at common ranges.

Share this post


Link to post
Share on other sites

Thank you very much for your help, the suggestion worked. Setting this value at 160 for the ammunition solved my problem.

Thanks again and regards,

Sander

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×