Jump to content

Recommended Posts

38 minutes ago, RCA3 said:

 

Hi pazuzu, the key has changed (AIDC.bikey), please verify if you have updated it on your keys folder.

Cheers.

 

Yes I uploaded mod folder and added key to server.

 

I also made new mod folder in my root arma 3 folder and selected it in launcher.

 

When I try to join my server it says I don't have proper key.

 

I'll try it again today and see if I may have forgotten something.

  • Thanks 1

Share this post


Link to post
Share on other sites

Not sure what I did wrong but I got it working now.

 

Thanks for the update.

  • Like 1

Share this post


Link to post
Share on other sites

Changelog:

v2.5.5.1 - Hotfix: Vehicle would halt/lose formation when too close to group leader. Fix #2.

  • Like 2

Share this post


Link to post
Share on other sites

Changelog:

v2.6 - Fixed: Vehicle would halt/lose formation when too close to group leader. Fix #3. AI led groups only.

            Fixed: Player led AI would return to formation after reaching destination since 2.5.5.1.

            Added: Tanks now stop when men enter vehicle's "bounding box": setFuel workaround.

            Added: Bypass enemy vehicles.

            Added: Optional vehicle variable "AIDCBBOXLENGTHCOEF" to define "bounding box" length.

            Added: Optional vehicle variable "AIDCCONVOYSEPARATION". AI led groups only.

            Tweaked: Minor optimizations and tweaks.

  • Like 7
  • Thanks 1

Share this post


Link to post
Share on other sites

Changelog:

v2.6.1 - Fixed: problem moving after loading cargo, stuck on "bounding box" loop.

 

- -

Since v2.6 if you're moving with AI vehicles on your (player) group, to help prevent them halting when too close to you, define a long convoy separation ~30+:

<vehicle> setVariable ["AIDCCONVOYSEPARATION", 30];

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks a lot for update,  what does exactly do  the convoy separation ?

 

would you recommend me to set it on vehicle creation (you know my mission) ?

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Hey,

It's just overwriting setConvoySeparation.

For your mission I would say yes if the AI vehicles are on your players groups.

Cheers.

Share this post


Link to post
Share on other sites

Changelog:

v2.6.2 - Fixed: Vehicle would halt/lose formation when too close to group leader. Fix #4.

                Changed: Script version Zeus initialization to BIS_fnc_addScriptedEventHandler.

                Tweaked: Minor tweaks and optimizations.

  • Like 3

Share this post


Link to post
Share on other sites

I got problems with gettig it to work with a trigger...

 

want to use Radio alpha.

 

but as soon as mission start they drive away

Share this post


Link to post
Share on other sites
On 3/27/2020 at 1:21 PM, loopdk said:

I got problems with gettig it to work with a trigger...

 

want to use Radio alpha.

 

but as soon as mission start they drive away

 

What do you want to use on the trigger, the script initialization?

Where are they driving away to, are they bypassing vehicles in front of them?

More details, please.

Share this post


Link to post
Share on other sites
On 3/2/2020 at 9:53 AM, RCA3 said:

Changelog:

v2.6 - Fixed: Vehicle would halt/lose formation when too close to group leader. Fix #3. AI led groups only.

            Fixed: Player led AI would return to formation after reaching destination since 2.5.5.1.

            Added: Tanks now stop when men enter vehicle's "bounding box": setFuel workaround.

            Added: Bypass enemy vehicles.

            Added: Optional vehicle variable "AIDCBBOXLENGTHCOEF" to define "bounding box" length.

            Added: Optional vehicle variable "AIDCCONVOYSEPARATION". AI led groups only.

            Tweaked: Minor optimizations and tweaks.

Not sure if this is the culprit or not, but I'm getting issues with tanks being out of fuel once they reach their last waypoint, and having to refuel them manually every time.
Doesn't affect trucks, MRAPs, etc.

Share this post


Link to post
Share on other sites

I would like to report some bug I've found last night (25/04/2020). Appears to be glitch if I get in a player vehicle as passenger. And if I drive a vehicle myself, passenger will see my glitch.
Today (26/04/2020), I tried disabled and enabled your mod, appears to be yours or I am not sure if it collided with other mod.

 

Please check. Thank you, RCA3.
 

 

  • Like 1

Share this post


Link to post
Share on other sites
On 4/26/2020 at 8:59 AM, Jono the Cutest said:

I would like to report some bug I've found last night (25/04/2020). Appears to be glitch if I get in a player vehicle as passenger. And if I drive a vehicle myself, passenger will see my glitch.
Today (26/04/2020), I tried disabled and enabled your mod, appears to be yours or I am not sure if it collided with other mod. 

No thats a vanilla bug, already fixed in next hotfix

  • Like 2

Share this post


Link to post
Share on other sites

Hello my friend, I have to report that after 1.98 patch there are a lot of car crashes back in my warfare,  looks like the script is not working as it was before patch, are you still on it?

 

Most of crashes happens between different players ai.  and from behind...

 

Please have a look, we need your script, it's not possible to enjoy a mission with a rating system when you lose ai for traffic crashes

 

🙂

  • Like 1

Share this post


Link to post
Share on other sites
On 5/13/2020 at 4:48 AM, rubberkite said:

Hello my friend, I have to report that after 1.98 patch there are a lot of car crashes back in my warfare,  looks like the script is not working as it was before patch, are you still on it?

 

Most of crashes happens between different players ai.  and from behind...

 

Please have a look, we need your script, it's not possible to enjoy a mission with a rating system when you lose ai for traffic crashes

 

🙂

 

Are you using the mod version or the script version?

  • Like 1

Share this post


Link to post
Share on other sites

I am still using the Mod version and although there are some little incidents, mainly AI drivers taking 10 point turns to change directions ( no running over friendlies ) and still very smooth for myself

 

Thanks @RCA3, Very nice work, hope you can maintain it in the future

  • Like 2

Share this post


Link to post
Share on other sites
On 5/17/2020 at 12:37 AM, LSValmont said:

 

Are you using the mod version or the script version?

 

I use the script version, RCA sent me a  little update to test but there are still crashes, I think something changed in Ai behave from 1.98,  with previous arma 3 build  we almost lowered the crashes to  Zero with the great work of RCA script,  problem is always hard to investigate and understand reason of crash,  it happens a lot with supply truck I'll do something by config and limit their speed to 60 km/h and see if that will help.

 

I have rarely meet such kind and friendly person during my arma time, and I really appreciate that he keep listening and trying to improve and fix when possible.

 

Cheers up for RCA3!

  • Like 4
  • Thanks 1

Share this post


Link to post
Share on other sites

@rubberkite, you are the kindest, politest person I've ever met online. Luffy is certainly a hero and you deserve to carry that badge. I wish you all the best in the adventures of this life.

 

 

As for the script, I'm not fully aware how it performed to you/MP before 1.98 but I estimate it is due to this script's poor MP optimization.

Another unrelated update was made (v2.6.4) but since 2.6.3 it improved keeping distance between large/heavy vehicles especially on downslopes.

 

Cheers.

  • Thanks 1

Share this post


Link to post
Share on other sites
2 hours ago, RCA3 said:

@rubberkite, you are the kindest, politest person I've ever met online. Luffy is certainly a hero and you deserve to carry that badge. I wish you all the best in the adventures of this life.

 

 

As for the script, I'm not fully aware how it performed to you/MP before 1.98 but I estimate it is due to this script's poor MP optimization.

Another unrelated update was made (v2.6.4) but since 2.6.3 it improved keeping distance between large/heavy vehicles especially on downslopes.

 

Cheers.

 

Thanks for the heads up @RCA3!

 

May I ask since  you said that "it is due to this script's poor MP optimization". 

 

1) Does that means that the mod version is more optimized than the script version or you were talking about both versions?

2) Does that means that this is mainly a SP mod/script or you are planning on optimizing Drive Control for MP?

Share this post


Link to post
Share on other sites

Hi, Valmont,

1) No, I mean both, the addon runs exactly the same script.

2) It was written with MP in mind, so it works, just not sure how well and definitely could be optimized (oneachframe e.g.) but would take a full rewrite and i'm just not up for it right now.

Cheers.

  • Thanks 1

Share this post


Link to post
Share on other sites
On 5/19/2020 at 3:26 PM, RCA3 said:

Hi, Valmont,

1) No, I mean both, the addon runs exactly the same script.

2) It was written with MP in mind, so it works, just not sure how well and definitely could be optimized (oneachframe e.g.) but would take a full rewrite and i'm just not up for it right now.

Cheers.

 

Thank you RCA3!

 

Take a look at my implementation of a performance friendly Ai Driving script, it is composed mainly of two functions (vAiDriving_init and vAiDriving_loop) and it is quite simplistic compared to yours but could do the job incredibly well and incredibly FAST!


As you can see it is greatly inspired by yours!

Spoiler

 


// on initServer.sqf add: [] call vAiDriving_init;

vAiDriving_init = {
	if !(isServer) exitWith {}; // Run on Server Only
	
	if !(isNil "AiDrinvingScriptRunning") exitWith {}; //Script already running
	if (isNil "AiDrinvingScriptRunning") then {AiDrinvingScriptRunning = 1;}; // Prevent the loop from running several times.
	
	useLinesIntersectWith = true;
	
	[{
		currentGates = (allMissionObjects "Wall_F") select {private _object = _x; !(bargatetypes findIf {_object isKindOf _x} isEqualTo -1)};
		[] call vAiDriving_postInit;
	},[],5] call CBA_fnc_waitAndExecute; // Delay execution until all items and vehicles are placed.
};

vAiDriving_postInit = {
	if !(isServer) exitWith {}; // Run on Server Only
	
	private _aiDrivenVeh = [];
	_aiDrivenVeh = vehicles select {(alive driver _x && !(isPlayer driver _x) && (local driver _x) && (_x isKindOf "Car" || _x isKindOf "Motorcycle" || _x isKindOf "Tank"))}; //Select all vehicles being driven by Ai.
	if (_aiDrivenVeh isEqualTo []) exitWith {[vAiDriving_postInit,[],300] call CBA_fnc_waitAndExecute;}; //If no candidate found recheck 300 seconds later!
	
	{
		if (isNil {_x getVariable "vAiDrivingSet"}) then {
			_x setVariable ["vAiDrivingSet",0];
			_x setConvoySeparation 20;
			//_x forceFollowRoad true;
			_x setSpeedMode "LIMITED";
			//Add Event Handler
			_x addEventHandler ["Getin", {_this spawn vAiDriving_loop;}];

			if (isNil {driver _x getVariable "vAiDrivingSet"}) then {
				driver _x setVariable ["vAiDrivingSet",0];
				[driver _x] call vAiDriving_setDriver;
				//Start function if driver inside
				if !(isNull (driver _x)) then{null=[_x,"driver",(driver _x)] spawn vAiDriving_loop;};					
			};
		};
	} forEach _aiDrivenVeh;
	
	[vAiDriving_postInit,[],300] call CBA_fnc_waitAndExecute; // Check again Later!
};

vAiDriving_loop = {

	if !(isServer) exitWith {}; // Run on Server Only
	
	if (diag_fps < 15) exitWith {[{[] spawn vAiDriving_loop;},[],60] call CBA_fnc_waitAndExecute;}; // Server FPS too low, save resources and restart the loop until FPS gets better

	params ["_car", "_role", "_driver"];
	
	if (!(_car isKindOf "Car" || _car isKindOf "Motorcycle" || _car isKindOf "Tank") || {!(_role isEqualTo "driver")} || {isPlayer _driver} || {!(local _driver)}) exitWith{};

	while {alive _driver && !(isNull (objectParent _driver))} do {
		if (diag_fps > 15) then {
			private _objectsIntersected = [];
			private _speed = speed _car;
			if (useLinesIntersectWith) then {
				private _carFrontPos = ATLToASL (_car modelToWorld [0, 2, -0.2]);
				private _distanceToCheck = ((_speed)*1.1);
				if (_distanceToCheck < 10) then {_distanceToCheck = 10;};
				private _carFrontDistanceToCheck = ATLToASL (_car modelToWorld [0, _distanceToCheck, 0.5]); //position far in front of vehicle			
				private _objectsIntersected = [];
				_objectsIntersected = lineIntersectsWith [_carFrontPos, _carFrontDistanceToCheck, _car, _driver, true];
				//drawLine3D [ASLToATL _carFrontPos, ASLToATL _carFrontDistanceToCheck, [1,0,0,1]];
			};
			if !(_objectsIntersected isEqualTo []) then {
				_car forceSpeed 1;
				_car limitSpeed 10;
				sleep 1; // Do not overwheelm the server.			
			} else {
				private _nearestObjects = [];
				private _radius = _speed * 0.2;
				if (_radius < 5) then {_radius = 5;};
				if (_radius > 20) then {_radius = 20;};
				private _nearestObjects = ((nearestObjects[_car getRelPos [5,0],["CAManBase","Car"],_radius]) select {alive _x && !(_car isEqualTo _x)});
				sleep 0.5;
				if !(_nearestObjects isEqualTo []) then {
					_car setSpeedMode "LIMITED";
					_car forceSpeed 1;
					_car limitSpeed 10;
					if (random 5 > 4) then {driver _car forceWeaponFire [currentWeapon _car ,currentWeapon _car ];}; // Blow the horn for those pesky pedestrians!
					{
						if (_x isKindOf "CAManBase" && {isNull (objectParent _x)}) then {[_x, _car] call vAiPedestrian_runToNearestBuilding;};
						if (_x isKindOf "Car" && !(isPlayer driver _x)) then {
							_car setDir ((getposatl _car) getDir ((_x modelToWorld [-3, 0, 0])));
						};
						//if (_x isKindOf "Car") then {_car setDir ((getposatl _car) getDir (getposatl _x));};
						
						sleep 0.5;
					} forEach _nearestObjects;
				} else {
					_car forceSpeed -1;
					_car limitSpeed 30;
					_car setSpeedMode "NORMAL";
					if (((getPos _car) getEnvSoundController "houses") >= 0.7) then {
						_car limitSpeed 20;
					};				
				};
			};
		};
	sleep 1; // Do not overwheelm the server.	
	};
};

vAiDriving_setDriver = {
	params ["_driver"];
	if !(local _driver) exitWith {};
	if (isPlayer _driver) exitWith {};
	if !(isNil {_driver getVariable "vDriverSet"}) exitWith {};
	_driver setVariable ["vDriverSet", 0];
	{_driver disableAi _x;} forEach ["MINEDETECTION","NVG","RADIOPROTOCOL","COVER","AIMINGERROR","SUPPRESSION","AUTOCOMBAT","CHECKVISIBLE"];
	_driver setCombatMode "BLUE";
	_driver setBehaviour "CARELESS";
	_driver allowFleeing 0;
	(group _driver) enableDynamicSimulation true;
};

vAiPedestrian_runToNearestBuilding = {
	params ["_aiPedestrian", "_car"];
	if !(isNil {_aiPedestrian getVariable "vIsAvoidingVeh"}) exitWith {};
	if (lifeState _aiPedestrian isEqualTo "INCAPACITATED" OR !(canStand _aiPedestrian)) exitWith {};
	private _onFoot = isNull (objectParent _aiPedestrian); // check for vehicle
	if (!_onFoot) exitWith {}; 	// no further action if unit in vehicle
	if (isPlayer _aiPedestrian) exitWith {};
	
	_aiPedestrian setVariable ["vIsAvoidingVeh", 0];
	
	private _fleeDir = 180 + (_aiPedestrian getDir _car); //direction opposite to car
	private _fleePos = _aiPedestrian getrelPos [30,_fleeDir]; //finds location at 50 mtrs in established direction.
	
	// nearBuildings
	private _NearestBuilding = [];
	_NearestBuilding = _fleePos call CBA_fnc_getNearestBuilding;
	if (_NearestBuilding isEqualTo []) exitWith {};
	private _Building = _NearestBuilding select 0;
	if (_aiPedestrian distance2D _Building > 30) exitWith {};
	private _BuildingPositions = [];
	_BuildingPositionsCount = _NearestBuilding select 1;
	
	// pick a random building spot and move!
	_BuildingPosition = getPos _aiPedestrian;
	if (_BuildingPositionsCount > 1) then {_BuildingPosition = (selectRandom (_Building buildingPos -1));} else {_BuildingPosition = getPos _Building;};
	private _previousGroup = group _aiPedestrian;
	_previousGroup deleteGroupWhenEmpty false;
	[_aiPedestrian] join grpNull;
	{_aiPedestrian enableAI _x} forEach ["MOVE","PATH","ANIM"];
	_aiPedestrian setUnitPos "UP";
	_aiPedestrian setBehaviour "CARELESS";
	_aiPedestrian forceSpeed -1;
	_aiPedestrian setSpeedMode "FULL";
	
	if (isAgent teamMember _aiPedestrian) then {
		_aiPedestrian moveTo _BuildingPosition; // agents only move with moveTo.
	} else {
		_aiPedestrian doMove _BuildingPosition;
	};
	[_aiPedestrian, _previousGroup] spawn {
		params ["_aiPedestrian", "_previousGroup"];
		sleep 10;
		_aiPedestrian setVariable ["vIsAvoidingVeh", nil];
		_aiPedestrian setBehaviour "AWARE"; [_aiPedestrian] join _previousGroup;
		_previousGroup deleteGroupWhenEmpty true;
		_aiPedestrian setUnitPos "AUTO";
		[group _aiPedestrian, getPos _aiPedestrian, 100] call BIS_fnc_taskPatrol;
	};
};

 

The script uses a mix of scheduled and unscheduled environments as I found out that combining both works best for mission performance.

 

Running the script on a 30 vehicles + 60 civs server caused no performance degradation at all running basically real time!

 

Combined with the Pedestrian running into buildings function it is quite good at preserving the life of both the Drivers and the pedestrians.

 

I hope this helps you get inspiration you just like your work did with me! 😉

 

PS: I don't know if adding your FSM to this will do any good?

 

PS2: Requires CBA!

  • Like 2

Share this post


Link to post
Share on other sites

I like it!

I will definitely try it out.

Glad I inspired you to work with something that seems to scare so many people. 😁

 

The FSM just:

_car engineOn false;

after:

private _stallshort = ["STEALTH","COMBAT"];
_stalltimeidle = [10 + (random 20), 3 + (random 7)] select ((behaviour _driver) in _stallshort);

You can use it and run it separately or adapt it to your script. Although I think BI came up with something that turns engines off now automatically.

 

Good job, waiting for a release soon.

  • Thanks 1

Share this post


Link to post
Share on other sites
1 hour ago, RCA3 said:

I like it!

I will definitely try it out.

Glad I inspired you to work with something that seems to scare so many people. 😁

 

The FSM just:


_car engineOn false;

after:


private _stallshort = ["STEALTH","COMBAT"];
_stalltimeidle = [10 + (random 20), 3 + (random 7)] select ((behaviour _driver) in _stallshort);

You can use it and run it separately or adapt it to your script. Although I think BI came up with something that turns engines off now automatically.

 

Good job, waiting for a release soon.

 

Thank you! 

 

And you won't have to wait much longer my friend! 😉 

 

 

  • Haha 1

Share this post


Link to post
Share on other sites

@RCA3 May I ask:

 

How do you check if a car is coming towards another car o going on the same direction?

 

I need to find our of a vehicle is coming on the same but opposite direction of another car so that CAR A can turn to different directions.

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

×