Dynamic AI with Blackjack and Whores
- dzn_commonFunctions v0.7 (https://github.com/10Dozen/dzn_commonFunctions)
- dzn_gear v2.3 (https://github.com/10Dozen/dzn_gear)
- Step By Step
- Creation of Zone Properties
- Control Zone
- Vehicle Behavior
- Groups Reaction
- Caching
- Group Custom Skill Level
If zone is not active by default and before it activated you can use some functions to control zones:
- dzn_zone1 call dzn_fnc_dynai_activateZone - activates zone and start spawn groups. Parameters: gamelogic object;
- [dzn_zone1, [200,200,0], 90] call dzn_fnc_dynai_moveZone - moves and rotates given zone. Parameters: gamelogic object, pos3d, direction (optional);
- dzn_zone1 call dzn_fnc_dynai_getZoneKeypoints - return all zone's keypoints (array of pos3ds);
- [dzn_zone1, [ [200,200,0], [300,300,0], [400,400,0] ]] call dzn_fnc_dynai_setZoneKeypoints - set new keypoints for zone. Parameters: zone's GameLogic, array of pos3ds
Get more at API wiki.
Use different second value in vehicle array ( ["B_G_Offroad_01_armed_F","Vehicle",""] ) to get different behavior:
Vehicle, Vehicle Patrol - vehicle group will patrol through keypoints or random points in cycle.
Vehicle Advance - vehicle group will move through keypoints or several random points and will hold on the last checkpoint.
Vehicle Hold - vehicle group will hold therir position (static, AAA, defensive position)
If dzn_dynai_allowGroupResponse variable is true - group reactions will be used. That means, that group which met many hostiles or suffer great loses will call for help. Then nearby allied group will move to caller position to provide support. You can add Editor-placed units/groups to Group Reaction system (check wiki for details).
If dzn_dynai_enableCaching variable is true - units, which are placed far from the players become 'cached' and will not affect on performance. Cached unit will be hidden, excluded from simulation (no physics, no AI, no graphics). Anyway group leaders will not be cached, so AI groups will patrol areas (using single unit per group) and when players come closer - rest of the squad will be uncached at the current position of group leader.
dzn_dynai_cacheDistance variable allow you to set minimum distance between unit and nearest player when unit become cached.
dzn_dynai_cachingTimeout and dzn_dynai_cacheCheckTimer allow you to customize time between cache/uncache checks (e.g. make periods longer/shorter)
It is available to set individual skill level for every group. To do it - add skill array as 3rd argument of group array:
[ 28, [ ["B_G_Offroad_01_armed_F","Vehicle Patrol",""], ["B_Soldier_F",[0,"driver"],""], ["B_Soldier_F",[0,"gunner"],""] ],[false, 0.5] /* Simple skill: isComplex(BOOLEAN), skill level(NUMBER) */ ]
[ 28, [ ["B_G_Offroad_01_armed_F","Vehicle Patrol",""], ["B_Soldier_F",[0,"driver"],""], ["B_Soldier_F",[0,"gunner"],""] ],[true, [["accuracy, 0.5], ["spotTime", 0.9]]] /* Complex Skill: isComplex(BOOLEAN), Skill array (NUMBER) */ ]