Jump to content
Sign in to follow this  
siggy

min/mid/maxRange and Probab's

Recommended Posts

So I'm making little mod to increase the RoF of the Mk19, AGS-17 and AGS-30 to real-world values. That's simple enough but I also want to get the AI using varying length automatic bursts of up to 5 rounds at up to 1500m.

I've created 5 different modes for the bursts I want them to use but I think need some help with getting the AI to use them. I don't understand the minRange, midRange, maxRange and probabilities enough to be able to tweak it right. Here's what I have so far...

class MK19 : MGun
{
	reloadTime = 0.175;
	modes[] = {"FullAuto_Player","FullAuto_AI_B2","FullAuto_AI_B3","FullAuto_AI_B4","FullAuto_AI_B5"};
	class FullAuto_Player: Mode_FullAuto
	{
		displayName = "HEDP";
		sound[] = {"\Vops_s_Guns\mk19_s.wss", 10, 1, 120};
		showToPlayer = 1;
		reloadTime = 0.175;
		dispersion = 0.01;
		burst = 1;
		aiRateOfFire = 1.5;
		aiRateOfFireDistance = 500;
		minRange = 250; minRangeProbab = 0.1;
		midRange = 500; midRangeProbab = 0.3;
		maxRange = 1500; maxRangeProbab = 0.1;
	};
	class FullAuto_AI_B2: FullAuto_Player
	{
		displayName = "2Rnd Burst";
		burst = 2;
		aiRateOfFire = 4;
		minRange = 200; minRangeProbab = 0.3;
		midRange = 400; midRangeProbab = 0.6;
		maxRange = 1200; maxRangeProbab = 0.2;
		soundBurst = 0;
		showToPlayer = 0; 
	};
	class FullAuto_AI_B3: FullAuto_AI_B2
	{
		displayName = "3Rnd Burst";
		burst = 3;
		aiRateOfFire = 4.5;
		minRange = 150; minRangeProbab = 0.5;
		midRange = 300; midRangeProbab = 0.7;
		maxRange = 900; maxRangeProbab = 0.3;
	};
	class FullAuto_AI_B4: FullAuto_AI_B2
	{
		displayName = "4Rnd Burst";
		burst = 4;
		aiRateOfFire = 5.0;
		minRange = 100; minRangeProbab = 0.7;
		midRange = 200; midRangeProbab = 0.9;
		maxRange = 600; maxRangeProbab = 0.4;
	};
	class FullAuto_AI_B5: FullAuto_AI_B2
	{
		displayName = "5Rnd Burst";
		burst = 5;
		aiRateOfFire = 5.5;
		minRange = 10; minRangeProbab = 0.7;
		midRange = 100; midRangeProbab = 0.9;
		maxRange = 300; maxRangeProbab = 0.5;
	};
};

Appreciated if anyone can offer some advice :) I will try to release the PBO once done!

Share this post


Link to post
Share on other sites

I have no hard facts here, just my guess.

That defines a 3 point probability curve for ranges between minRange..maxRange. Each three points have a value between 0 and 1. The target is at range X and the game engine checks what is the probability to use that fire mode at that range. For example mode B4 has now for the range of 400m (half way between 200..600m) the probality 0.65 (half way between 0.9..0.4). The game prolly takes a random value between 0..1 and sees if it is under the probabilty value in the curve.

If the mode probabilites are overlapping, I'm not sure how teh game deals that...maybe the game takes the first one which matches.

Share this post


Link to post
Share on other sites

Thanks for the info! It appears the engine's pretty rigid when it comes to selecting the mode - if I define them all with the same range/prob values, it always picks single shot - like you say, the first one that matches.

Cheers

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  

×