ARTEMIS - Hunting Instinct
ARTEMIS 1.22 (Dropbox)
1. Description
ARTEMIS mod is an AI algorithm that simulates animal-like hunting behaviour of controlled units (Hunters) against chosen units (Prey). It's meant as a tool for mission makers, while easiness of Artemis setup makes practically everyone familiarized with editor's basics potential mission makers able to set hunter-prey missions fast and smooth.
This code does some heavy calculations (mainly numerous LOS checks every second). Should be more efficient than
1.0
, still too many hunters at once may cause hunters' reactions delays/sluggishness. How many is OK? Not sure & depends. Let's say "one or few to several". Number of prey units isn't as crucial.
ARTEMIS is designated as opponent for player, but should work well also against AI.
Hunter has to his disposal two customizable senses: sight and smell.
Sight is specified by two parameters: light sensitivity and movement sensitivity. It decides, how easily Hunter will spot the Prey according on daytime, weather, size, speed, background (sky or not, surrounding terrain) and knowledge factor (memory).
Smell helps to follow not visible Prey by its trail. Each Prey will leave "footprints", that Hunter can scent. Old footprints will be erased, also rain gives small chance for removing some parts of the trail. Smell (range) is strongly affected by wind (direction and strength).
If there is no Prey nor trail known, Hunter will loiter randomly starting from last known position of last prey.
If Hunter see the Prey, his behaviour depends on situation. His goal is surprise attack, prefferably from behind. Will charge anyway, if close, but otherwise will approach, fast, or stealty, only, when flanking the Prey (out of Prey's FOV). If catched in the FOV depends on situation can hide low or run out of LOS, then try to outflank keeping out of sight.
Is most dangerous at night, in the dense forest when visiblity is poor.
Hunter uses only melee attacks.
2. Usage
ARTEMIS is designed for single player. Behaviour in MP environment unknown (code will/should be run server side only, hunters should be server side too).
[indent][b]Addon version[/b][/indent]
- play with addon;
- place on the map Artemis (Hunter) module;
- optionally customize module settings;
- synchronize with it all units, that should act like animal hunters/predators;
- place on the map Artemis (Prey) module;
- optionally customize module settings;
- synchronize with it all units, that should be hunted down by hunters.
Alternatively may be used method of pointing hunters and prey for script version. Such way defined arrays of hunters and prey will overwrite lists based on synchronized units.
[indent][b]Script version[/b][/indent]
- paste content of the Script Version folder into mission folder;
- initialize in init.sqf or init field in editor via:
[indent][i]RYD_ART_Hunters = [(here list of hunters)];
RYD_ART_Prey = [(here list of prey units)];
nul = [] execVM "Artemis\ARTInit.sqf";[/i][/indent]
[indent][b]Optional customization[/b][/indent]
Customization is possible via defining listed global variables (as examples used default values):
[b]RYD_ART_Hunters = [];[/b] (Array holding hunter units. Changes on the fly will be effective. Note: hunters excluded that way wil proceed with their last routine)
[b]RYD_ART_Prey = [player];[/b] (Array holding prey units. Changes on the fly will be effective.)
[b]RYD_ART_Pause = false;[/b] (pausing switch. As long is true - hunters will immediately stop all Artemis activity, prey will stop to leave the trail)
[b]RYD_ART_MainSwitch = true;[/b] (when set to false, whole code exits permanently, controled units immediately stop all activity)
[b][i]hunter_Unit[/i] setVariable ["Ryd_ART_Excluded",true];[/b] - setting this variable for given [i]hunter unit[/i] will temporarily exclude it from Artemis control. Unit will stop current activity immediately.
Below settings for script version only. For addon version use module settings instead.
[b]RYD_ART_Smell = 3;[/b] (positive number - smell sensitivity of the hunters. Used for tracking prey)
[b]RYD_ART_Sight = [1.5,1.5];[/b] (array of positive numbers. Eyesight sensitivity for the hunters (light factor, movement factor). Used for spotting prey)
[b]RYD_ART_Loiter = 200;[/b] (non-negative number. How far around current position hunter should wander randomly when lost the trail. Unlimited if 0)
[b]RYD_ART_Strike = 1;[/b] (number. Multiplier of damage dealt by Hunter each basic strike)
[b]RYD_ART_Placement = [];[/b] (Min/max random placement radius for each hunter from random hunted. Leave empty array to disable random placement)
[b]RYD_ART_TrailMaxAge = 3600;[/b] (maximal lifetime of each prey's footstep in seconds)
[b]RYD_ART_Dbg = false;[/b] (boolean. Debug mode switch. In debug mode postions of all hunters and each prey will be marked on the map. For the hunters is also shown current routine and max knowledge about it amongst all prey units))
[indent][b]Other notes[/b][/indent]
- for striking sounds and animations hunter units must be used [b]"players only"[/b] raptors from Jurrasic Arma - Raptor Pack by McRuppert ([url="http://www.armaholic.com/page.php?id=27163"]http://www.armaholic.com/page.php?id=27163[/url]);
- if in addition to above raptors should use from time to time jump atack, somewhere on the map must be present at mission init one raptor [b]"AI only"[/b] to register jump attack function;
- included demo mission is for addon version and requires Jurrasic Arma - Raptor Pack addon by McRuppert & Bad Benson. In the init.sqf debug mode may be enabled to follow hunters actions on the map.
3. Changelog
4. Known issues and notes
- if hunter is in "hidden low" mode under FOV of completely static AI unit, logically attack may never come, because hunter will patiently wait, till he can move out of prey's FOV. To avoid such stalemates make prey moving;
- if used anything else than McRuppert's raptors, attacks have no sounds nor animations;
- seems, raptor units from Raptor Pack with assigned waypoints tend to stuck from time to time, vanilla A3 units not affected;
- this version is only slightly tested. I'm always grateful for any feedback and bug reports.
Enjoy 🙂
Mod is released under APL-SA license. I'll be grateful for notification about each such usage.