Author: RCA3
Author Website:

Requirements: No addons required

Version: 2.5.3
Signed: Yes, serverkey included

Short description: Gives more control to AI drivers. Script uses nearEntities to find vehicles/men, calculates relative angles to nearest one and applies forceSpeed depending on situation.

Date: 2019-10-03 07:51


Comments: (2)
Rating:



 







AI Driving Control

by
RCA3


Description:
Gives more control to AI drivers.
Script uses nearEntities to find vehicles/men, calculates relative angles to nearest one and applies forceSpeed depending on situation.
Use "STEALTH" behaviour to temporarily bypass the script.

Features:
AI will brake and speed up for vehicles ahead.
AI gives way to vehicles approaching from the right.
Pedestrians have priority over vehicles.
Pedestrians are overtaken or followed if directly in front of vehicle.
Works on and offroad.
Have less (not avoid) crashes.
Engines turn off on idle if at final waypoint.
Vehicles on "STEALTH" behaviour bypass code until behaviour changes (setBehaviour, etc.).
Bypass script entirely on a vehicle's init with "this setVariable ["NOAIDRIVINGCONTROL", true, true]".
For a convoy use "(object) limitSpeed (km/h)" on lead vehicle.
Gates ("Land_BarGate_F", "Land_BarGate_01_open_F" and "Land_RoadBarrier_01_F") are detected when closed. Note: place gates BEFORE AI driver gets in vehicle/spawn/zeus/etc. i.e. not scanned in realtime.
As a bonus, gates are made indestructible (by tanks as well unfortunately).


Installation:
To install AI Driving Control you should use modfolders to keep it seperate from the official game content to prevent issues.
With Arma 3 you can use different ways to set up your modfolders to use custom content you have downloaded.
Please visit the Arma 3 Mod install instructions page for more information about using custom mods and addons in Arma 3.


Included files:
aidrivingcontrol.pbo


Usage:
For usage instructions and information of how to use AI Driving Control please refer to the included documentation and/or example mission.

Works with placed and spawned vehicles, single player and dedicated server.
Clients with AI drivers must be running the addon.
For Zeus, the player being Zeus must be running the addon.

Optional:
(vehicle) setVariable ["AIDCBBOXWIDTHCOEF", (coefficient)];
Defines "bounding box" width, per vehicle, which detects men around and stops the vehicle. Where 1 = vehicle's width; 1.5 = default.
Smaller values improve overtaking men but run them over more often, higher values will be safer but will halt more often. More than default should not be necessary.


Media:


Armaholic.com has its own Youtube channel where we will cover the Community made releases.
Subscribe to the Armaholic.com Youtube channel


Known issues:
When confronted with large groups of pedestrians, vehicles occasionally stall.
Quadbikes are not detected by other vehicles on road (@BI: they always report "isOnRoad false"). Are detected offroad.

Does not work on ALiVE vehicles.
Incompatible with TPW SANITY (uses forceSpeed as well).


Notes:
Any forceSpeed command (on affected land vehicles) will be overwritten by script.
Does not cause dependency on missions.


Credits & Thanks:
Bohemia Interactive
BI Arma Forum Contributors
Wikipedia
BI Wiki Code Optimisation author(s) https://community.bistudio.com/wiki/Code_Optimisation
3 1 A Measure of Relative Direction https://www.youtube.com/watch?v=uDwP4T7bPSY

Thanks to:
Armaholic.com
Mondalkb and the Global Mobilization CDLC team for copy/paste of their EULA from https://steamcommunity.com/sharedfiles/filedetails/?id=1284731930
Kremator for testing with tanks


License / Disclaimer:
No Re-upload - You may not re-upload the content of this addon as a whole or any part of this addon, including Steam Workshop.
Non Military - You may not use the content of this addon as a whole or any part of this addon for military purposes.
No Monetization - You may not use this addon as a whole or any part of this addon on monetized servers.
Armaholic Only - The author grants permission to Armaholic (www.armaholic.com) moderators to upload and update the content of this addon.

Attribution - You must attribute the material in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the material).
Noncommercial - You may not use this material for any commercial purposes.
Arma Only - You may not convert or adapt this material to be used in other games than Arma.
No Derivatives - If you remix, transform, or build upon the material, you may not distribute the modified material.

Arma Public License No Derivatives (APL-ND)
https://www.bohemia.net/community/licenses/arma-public-license-nd


Changelog:
2.5.3
Fixed: "Bounding box" loop would not exit for driver disembark, death or vehicle damaged.
[Warning] Changed: Script version makes use of remoteExec on zeus and optional spawns. Meaning client's AI will have controlled driving on non-locally created vehicles (same as in addon version). Read INSTALLATION.txt for new instructions.
Changed: Renamed functions main class.

2.5.2
- Tweaked: Oncoming traffic vehicle rotation is now < 30º, more is considered crossing. Gives vehicles more time to cross.
Tweaked: Followed vehicle's angle and rotation is combined to find following angle. It should reduce number of overtaking occurrences.
Tweaked: Smoothed slow down/speed up when following vehicles.
Tweaked: Minor tweak to vehicle versus men speed.
Tweaked: Scan radius.
Changed: Passed a few math operations to pre-processor #define.
Added: Optional vehicle variable "AIDCBBOXWIDTHCOEF" to define "bounding box" width.
Added: Detection of all three military gates "Land_BarGate_F", "Land_BarGate_01_open_F" and "Land_RoadBarrier_01_F".

2.5.1
Fixed: Animals were still being evaluated.
Tweaked: Minimum scan radius reduced from 50m to 25m.
Tweaked: Minor tweak to "bounding box" search.

2.5
Changed: Vehicle versus pedestrians speed is now dynamically calculated.
Removed: Pedestrians's military/civilian discrimination.
Removed: Pedestrians's on/off road discrimination.
Added: New server key.

2.4.1
Added: A 360 degrees "bounding box" around vehicle which detects pedestrians and stops the vehicle.
Tweaked: Increased/improved pedestrians overtake speed.
Tweaked: Minor tweak to scan radius.
Fixed: Gates being detected outside of range.
Fixed: Animals were being evaluated as men.
Changed: Script version installation and respective notes.

2.4 - Added: New timeout system which starts only if crossing vehicle ahead is not moving. Results in much smoother traffic.
Fixed: Oncoming traffic was being evaluated as crossing (delaying traffic). Oncoming traffic vehicle rotation is now <45º, more is considered crossing.
Released: Script version.
Added: New server key.

2.3.1
- Hotfix: FSM was running on every vehicle's passenger.

2.3
Changed: Passed main function and parts of code to CfgFunctions.
Changed: Code optimized when vehicle is stopped by vehicle/man ahead to ~0.19ms (benchmark) no matter how many vehicles/men around.
Changed: Optimized vehicles array sorting.
Changed: Vehicles stop on initialization while scanning for bargates.
Changed: Engine off on idle moved to separate FSM resulting on optimization to ~0.37ms (benchmark) for 10x men/cars scan.
Tweaked: Optimized main branch.
Fixed: On road vehicles were evaluating offroad vehicles.
Removed: Unnecessary BIS_fnc_getAngleDelta call removed.
Removed: Duplicated getDir removed.
Tweaked: Front buffer increased by 5 meters.
Tweaked: Give way right traffic timeout decreased back to 10 seconds.
Added: New server key.

2.02.2
- Hotfix: Vehicles weren't resuming after opening gates.

2.02.1
- Fixed: Vehicles relative position was being wrongfully checked according to their internal direction. Improves overall traffic and convoy behaviour.
Tweaked: Added one more distance check increasing pedestrians safety.
Tweaked: Give way right traffic timeout increased from 10 to 30 seconds.
Tweaked: Minimum scan radius increased to 50 meters.

2.02
- Changed: Reverted to civilian vehicle convoys offroad being possible as of v1.01. 15 meters width (overtake) buffer for all vehicles.

2.01.3
- Fixed: Minor fix where offroad vehicles could be following without proper angle.

2.01.2
- Fixed: On road vehicles were following offroad vehicles.

2.01.1
- Tweaked: Applied Pythagorean theorem to civilians buffer. It's a safer distance.

2.01
- Changed: AI tries to bypass civilians up until the last moment. Infantry are (still) followed at a more respectable distance.
Tweaked: Buffer width offroad is now 10 meters instead of 15 meters for infantry.

2.0
- Changed: Addon name changed from Road Control AI Addon to AI Driving Control.
- [Warning] Changed: Variable to disable script is now "NOAIDRIVINGCONTROL".
- Added: Scan radius is now dynamic with vehicle speed. Should increase performance.
- Fixed: Maintain speed of front.

1.01
- Wider offroad buffer now affected by military personnel only.


Forum topic:
- BI forums




Enable javascript to be able to download from Armaholic please!