6thSense.eu/AI-Manager

From Bohemia Interactive Community
Revision as of 11:57, 12 September 2007 by Sickboy (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

6thSense.eu AI Manager v0.2alpha2 for ArmA, by Sickboy (sb_at_6thSense.eu)

Meant as a tool for mission makers to create a dynamic, random and challenging Coop Mission.


Features

  • AI Spawn Manager (Spawn any number of AI, in any number of groups, picking types/class of units randomly out of defined arrays)

Supporting atm: Infantry, Vehicles, Tanks, Choppers and Building Rooftop Overwatch

    • Create Markers to choose the Area where you wish groups to be created
    • fCreateZoneMarkers Function by Killswitch to create the patrol zones around an Objective zone automaticly!
    • Random Placement of groups
    • Range Amount of Units per group selectable
  • AI Enhancements (Choosable per group or per Zone)
    • UPS (Patrol Script by Kronzky): Random Patroling, Enhanced AI when in combat
    • Infoshare: Groups Sharing information about enemies with nearby friendlies
    • Grouplink (by Keycat, rewritten to ArmA by \=SNKMAN=/, rewritten to SQF by Sickboy): Groups calling support from eachother, using realworld Tactics, and various other enhancements
  • AI Tracking System By Kronzky (Track Movement of AI Groups, leaving a trail of markers behind)
  • Basic Objective/Mission Generator
    • With support for:
      • Different mission types: ["Rescue","Recover","Destroy"];
      • Different mission subTypes: [["Captives","Civilian"],["Documents","Vehicles"],["Tanks","APCs","Buildings"]];
    • Fully configurable and ability for making and maintaining templates
    • Creates and colors markers dependent on status of objective
    • All triggers are dynamicly created, only having the needed triggers ingame at all times
  • All Scripts are in SQF, only preloaded into Memory when they are required repeatedly throughout the whole mission
    • Most tasks are done by Functions
    • Arrays available that contain the Zone Data (Created Groups, Size of Zone, Location, etc. etc.)


Project Status

  • Stable Version: v0.11
  • Unstable Version: v0.2alpha2


Download

Best Played With 6thSense.eu Mod Designed for Multiplayer BR

Please make sure that you Use this package inside the Multiplayer Editor (Multiplayer, Create a server (password it), and either click NEW or open the mission you want) and not in the Singleplayer Editor.


Planned Stages

  • v0.1 - Basic AI Generator, AI Enhancements etc.
  • v0.2 - Addition of Waypoint & Basic Mission/Objective Generator based on Parameters
  • v0.3 - Addition of AI Enhancement (Basing ideas on: Grouplink, Infoshare, DAC, KI2 etc. etc)
  • v0.4 - Enhance & Expand Previous

....


Plans

  • 6thSense.eu AI Populator/Generate Script integration; Populate the whole Island based on parameters
  • 6thSense.eu Player Bubble TM integration; AI Groups are only active in xxxxMeters range of Players
  • Reduce-Groups; When Players are further than xxxMeters away from AI, reduce the group to only the groupleader, Spawn the other group members in when they are closer than xxxMeters
  • Measure the Size of a Zone and automaticly fill the zone based on the square-meters
  • Further expand and implement other/new AI Features/Scripts
  • Develop Dynamic Waypoint Generator Script to give soldiers waypoints in the generated Zones (at this time this is only done when using UPS)


Demo Missions

  • 1 Beginner Demo Mission, 1 Advanced Demo Mission and another one with 10 Mission Areas and startpoints. Available in West and East, aswell as 6thSense.eu Mod and BIS (No Addons) variants.
    • Featuring the Infoshare and UPS Script, aswell as choice for Grouplink. "Save the Captives and RTB"... well goodluck :D


Changelog

v0.2alpha2

  • six_pt is now dynamicly updated (added to) based on the (six_allpg select 0) array

calling team. (six_aim_obj#_caller)

  • six_aim_ratio can be used to scale the mission up/down depending on amount of players and the amount of players the Mission was made for.
    • Idea for multiObjectives: Use a variable per objective (six_aim_obj#_ratio) to make only the team that calls the objective be rated, so the objective scales to the***
  • Included basic mission/objective generator
  • Base Functions
    • fSetVarName
      • Uses the setVehicleVarName and processInitCommands to propagate the name of an object over the network
    • fCreateGroup
      • Creates group on given side, but re-uses old created group if there are empty groups available
    • fShuffle
      • Shuffles the contents of an array
    • fGroupId
      • Automaticly set the groupId depending on side and amount of teams of inputted array. By default Generates 8 Different Callsigns and 8 Different Colors
  • AI-M Functions
    • fCreateObjective
      • Create an objective based on parameters and settings of cfg_Objectives
    • fObjHandler
      • Handles the objectives created by createObjective based on parameters and settings of cfg_Objhandler
  • AI-M Configuration
    • cfg_Objectives
      • Setup the objectives for fCreateObjective
    • cfg_ObjHandler
      • Setup the objectiveHandling for fObjHandler
    • cfg_Aim
      • Added six_aim_settings set [0, [true, 0.33]]; // Enable automatic ratio adjustment, ratio is used to determine number of units to generate per group. 0.33 - number Value, minimum Ratio

v0.11-

  • Fixed RACS (Resistance/Guer) Side (Thanks for report by fideco)
  • Updated the ADV missions on Rahmadi with the createMarker methods like the ones on Sahrani. No markers will be visible in MP.
  • GL2: Added Alert Cancel Distance. Default: 1000.
  • Performance Optimized some of the Loops. (Thanks for the tips Crashdome!)
  • Created less enemies, as the AI Enhancements should make up for the otherwise usual 10:1 Enemy AI/player ratio (Thanks Jinef for Remembering ;-))
  • Added Debug Notice to Infoshare script, request by fideco. six_debug_lvl=16 will display the messages
  • Added 4 more Objective Areas in the ADV missions on Sara
  • Prefixed folders with SIX_
  • Cleaned up more Code, Split Code more from Configuration.
  • Moved AIM\cfg_Zone.sqf to SIX_AIM\c\cfg_Zones.sqf
  • ADV Missions have some scripting inside init.sqf
  • Changed the Beginner Mission to Advanced and added another, very basic Beginner Demo Mission. Hopefully this is more esay :-)
  • Rewritten Grouplink to SQF. Better response times, smaller code, tighter loops, thinned and cut a lot, removed some unavailable features.
  • Added a simple playervehicle generator for the missions on Sarahni
  • Fixed proper Ammocrates
  • Added _bui Arrays per Zone (Representing Static Building Overwatch Groups)
  • Grouplink now has debug messages, handy for the mission maker to see what's going on
  • Now displays the amount of units in how many groups with how many vehicles in how many zones in how many seconds generated on server aswell as client
  • Grouplink parameters changed
  • Grouplink more optimized
  • Rewrote the cfg_Zone.SQF
  • Using the new fCreateZoneMarkers to generate the Border/Patrol Zones
  • Rebalanced groups to Infantry, Choppers, Tanks & Transport Vehicles
  • Made a large patrol area for Choppers etc.
  • Smaller, but more Groups
  • Starting Position is Random Now
  • Using smaller patrol zones, creating more properly divided Patrols
  • Day/Night time Choice
  • AI Type Choice (limited atm):
    • UPS + UPSAI
    • UPS - UPSAI + Grouplink2


Credits

  • AI Manager and Spawn Manager by Sickboy
  • UPS, Tracking and Some Functions by Kronzky (www.kronzky.info)
  • Grouplink2 by Keycat for OFP, converted by SNKMan to ArmA, Rewritten to SQF by Sickboy
  • Rndselect Function by Terox
  • AI Infoshare by General Barron for OFP, Optimized & Converted by Sickboy to ArmA & SQF
  • Many ideas based-on or inspired-by DAC by Silola (www.mapfact.com)
  • Spectator Script by Kegetys (www.kegetys.net)
  • fCreateZoneMarkers Script by Killswitch, with ideas by lwlooz and Sickboy


Have fun, 6thSense.eu


Help

Package Usage Info

Unpacking Missions

  • Unpack missions with cpbo by Kegetys


General Info

Configuration

  • AI-M Configuration: SIX_AIM\c\cfg_AIM.sqf. Help is further down below.
  • Zone Configuration: SIX_AIM\c\cfg_Zones.sqf. Help is further down below.
  • Mission Configuration: init.sqf. Use BEGinner mission as reference. The ADVanced missions have more complicated scripting

Needed Gamelogics etc

  • Server - You Need to create a gamelogic called Server, as seen in the Demo Missions

Needed Files & Folders

Best take them from BEG mission

  • SIX_AIM
  • SIX_BASE
  • Stringtable.csv
  • Init.sqf

Debug

  • Getting Access to Debug Tools / Trackers etc
    • In Mission init.sqf:
      • Add your name to the SIX_RF array. And/Or enable debug Manually: six_debug_miss=true - Will display Standard System Messages important to Mission makers
      • six_debug_lvl=
      • 12 - AI-M Lowlevel Debug
      • 15 - GL2 Lowlevel Debug
      • 16 - Infoshare Lowlevel Debug
    • Most debug features are only available when used together with the 6thSense.eu Mod.


Sides

  • 1 = East
  • 2 = West
  • 3 = Resistance
  • 4 = Civilian

Unit Types

  • 1 = Infantry
  • 2 = Vehicles
  • 3 = Tanks
  • 4 = Air (Choppers)
  • 5 = Building Rooftop Overwatch

Zone/Group Options

You can combine these options with for instance the function fChkDbg. This function returns the inputted value IF debugmode is enabled, and returns nothing if debugmode is disabled. For instance: "TRACK" call (SIX_Aim_F getVariable "fChkDbg") would only enable the Tracking Scripts when debug mode is enabled

  • "TRACK" - Enable Kronzky's Tracking System (SP/Offline only)
  • "RANDOM" - Enable Random Start Positions
  • "SHARE:" - Enable Infosharing script originally written for OFP by Genr. Barron
    • [Alarmradius,Delay]
      • Alarmradius - Number: Max distance in Meters an AI Squadleader can be away from another AI Squadleader to call in support
      • Delay - Number: Sleep time between script loops/alarmstate check
    • Examples:
      • To Enable Infosharing in a Radius of 300m with a 30 second delay: "SHARE:", [300, 30]
      • To Enable Infosharing on default Settings (rad 150, delay 30): "SHARE:", []
  • "AI:" - Enable AI Expansion, Make sure that the next array will be the configuration array [aitype, aisettings]
    • [AIType, AISettings]
      • AIType - Number:
      • 1 = UPS AI (With UPS Patrol Waypoint Generation)
      • 2 = Grouplink AI (With UPS Patrol Waypoint Generation)
      • AISettings - Array
      • UPS:
        • See the UPS Readme for possible options
      • Grouplink:
        • {{{["SUPP"]}}} - (SIX_AIM_SUPP array) will make the units of this group CALL and GIVE support
        • {{{["SUPP","STAT"]}}} - (SIX_AIM_SUPP and SIX_AIM_STAT arrays) will make the units of this group CALL but NOT GIVE support
        • {{{["SUPP","NOMOUNT"]}}} - (SIX_AIM_SUPP and SIX_AIM_NOMOUNT arrays) will make the units of this group CALL and GIVE support, but if they were inside Vehicles they will not remount them after the Alarm is finished.
    • Examples:
      • to Enable UPS AI in a zone: "AI:", [1, []]
      • to Enable GL2 AI in a zone: "AI:", [2, ["SUPP"]]
      • to only let units call support in this zone: "AI:", [2, ["SUPP", "STAT"]


cfg_AIM.sqf Usage

  • six_aim_messages set [0, true]; - Will display System Messages (e.g. Amount of units created etc) even when six_debug_miss=false
  • More usages in future


cfg_Zone.sqf Usage

Easy Setup of Zones

{{{ // Don't forget to have/create the Zone Markers on the map, in the examples: z1, z3, z4, z5 and z6. Check the BEG Example Mission for Reference. // Zone Configs /////////////////////// // Objective1, Main Zone: _zone="obj1"; // Will create zone "obj1" based on marker "obj1" _side=1; // Will generate units on side 1-East _conf=199; // Will take units from config 199 (BIS SF East). Corresponding with the AIM\c\cfg_side.sqf files _inf=[3, [4, 8]]; // Will Create 3 Infantry Groups with groupsizes between 4 and 8 _veh=[]; // Will not create Vehicles _tan=[]; // Will not create Tanks _air=[]; // Will not create Air (Choppers) _bui=[1, [10, 20]]; // Will Create 1 BuildingRooftop overwatch group with groupsize between 10 and 20 _feats=["TRACK" call (SIX_Aim_F getVariable "fChkDbg"), "RANDOM"]; // Will Enable Unit Tracking when in Debug Mode, and make the Units start from Random Position. _ai=["AI:", [2, ["STAT","SUPP"]]]; // Will Enable AI2: Group Link AI. Units will be STATic // Next Part is Important, do not forget to add! six_aim_z=six_aim_z+[call _c]; // Add Zone to the six_aim_z CreateZone Todo List. ///////////////////////


/////////////////////// // Objective 2, Air/Veh/Tank/Inf Support Zone: _zone="obj2"; // Will create zone "obj2" based on marker "obj2" _side=1; // Will generate units on side 1-East _conf=149; // Will take units from config 199 (BIS East). Corresponding with the AIM\c\cfg_side.sqf files _inf=[2, [4, 8]]; // Will Create 2 Infantry Groups with groupsizes between 4 and 8 _veh=[1, [4, 10]]; // Will Create 1 Vehicle Group with infantry groupsizes between 4 and 10 (Will create as much vehicles as nececairy to accomadate for all units in group) _tan=[1, [1, 1]]; // Will Create 1 Tank Group with Tank groupsize of 1 _air=[2, [1, 1]]; // Will Create 2 Air Groups with Chopper groupsize of 1 _bui=[]; // Will not create BuildingRooftop Overwatch Groups _feats=["TRACK" call (SIX_Aim_F getVariable "fChkDbg"), "RANDOM"]; // Will Enable Unit Tracking when in Debug Mode, and make the Units start from Random Position. _ai=["AI:", [2, ["SUPP"]]]; // Will Enable AI2: Group Link AI. Units will be SUPPortive // Next Part is Important, do not forget to add! six_aim_z=six_aim_z+[call _c]; // Add Zone to the six_aim_z CreateZone Todo List. ///////////////////////


/////////////////////// // Objective 3, Veh/Tank/Inf Support Zone: _zone="obj3"; // Will create zone "obj3" based on marker "obj3" _side=1; // Will generate units on side 1-East _conf=149; // Will take units from config 199 (BIS East). Corresponding with the AIM\c\cfg_side.sqf files _inf=[2, [4, 8]]; // Will Create 2 Infantry Groups with groupsizes between 4 and 8 _veh=[1, [4, 10]]; // Will Create 1 Vehicle Group with infantry groupsizes between 4 and 10 (Will create as much vehicles as nececairy to accomadate for all units in group) _tan=[1, [1, 1]]; // Will Create 1 Tank Group with Tank groupsize of 1 _air=[]; // Will not create Air (Choppers) _bui=[]; // Will not create BuildingRooftop Overwatch Groups _feats=["TRACK" call (SIX_Aim_F getVariable "fChkDbg"), "RANDOM"]; // Will Enable Unit Tracking when in Debug Mode, and make the Units start from Random Position. _ai=["AI:", [2, ["SUPP"]]]; // Will Enable AI2: Group Link AI. Units will be SUPPortive // Next Part is Important, do not forget to add! six_aim_z=six_aim_z+[call _c]; // Add Zone to the six_aim_z CreateZone Todo List. /////////////////////// }}}


Using the fCreateMarker function

{{{ // Explaination: [MarkerName, [positionX,positionY], Shape, [sizeX,sizeY]] call (SIX_Aim_F getVariable "fCreateMarker"); // Example: _marker=["obj1", [100.50,100.50], "RECTANGLE", [200,200]] call (SIX_Aim_F getVariable "fCreateMarker"); // // MarkerName - String // Position - Position Array // Shape - String (can be: "Icon", "Rectangle" and "Elipse") // Size - Size X/Y Array // // Optional Parameters: // "BRUSH:","Solid" // "COLOR:","ColorRed" // "TEXT:","Objective Area" // "TYPE:","Pickup" // "GLOBAL" Will Create the marker Globally (On all Pc's instead of only the local machine) }}}


Using the fCreateZoneMarkers function

{{{ // With this function you can create 4 "Border Zones" around the Objective Main Zone, you can specify amount of layers // The function returns the generated layers in an array _borders=["obj1", 100] call (SIX_Aim_F getVariable "fCreateZoneMarkers"); // Creates 1 Layer of 4 Borders around "obj1" marker, with a width of 100m. // Would Create These Zones: "obj1N1" "obj1E1" "obj1S1" "obj1W1" // The _borders variable would contain the following array: "obj1N1", "obj1E1", "obj1S1", "obj1W1"

_borders=["obj1", 100, "LAYERS:", 3] call (SIX_Aim_F getVariable "fCreateZoneMarkers"); // Creates 3 Layers of 4 Borders around "obj1" marker, with a width of 100m // The _borders variable would contain the following arrays: [["obj1N1", "obj1E1", "obj1S1", "obj1W1"], ["obj1N2", "obj1E2", "obj1S2", "obj1W2"], ["obj1N3", "obj1E3", "obj1S3", "obj1W3"]] }}}


Bare Scripting syntax to create Zone AI Groups

{{{ /* gz1=["z1", 1, getMarkerPos "z1", 100, [3, [5,20]], [], [], [], [], "RANDOM", "AI:", [1, []]] call (SIX_Aim_F getVariable "fCreateZone"); // ^ZONE ^SIDE ^STARTPOS ^CONF ^INF ^VEH ^TAN ^AIR ^BUI ^Features ^^^^^^^^ AI Settings

// Infantry/Vehicles/Tanks/Air Configs: [AmountOfGroups, [lowest,highest]] Leave the arrays empty: [] to disable generating units of that type // ^The groupsize of the generated groups will be anywhere between those 2 numbers

// Zone Spawning Example gz1=["z1", 1, getMarkerPos "z1", 152, [6, [6, 12]], [3, [10, 16]], [2, [1, 3]], [2, [2, 2]], [], "RANDOM", "AI:", [1, []]] call (SIX_Aim_F getVariable "fCreateZone");

// Would create a zone with 6 InfantryGroups of 6-12 Infantry, 3 VehicleGroups with 10-16 Infantry, 2 Tank Groups with 1-3 Tanks and 2 Chopper Groups with each 2 Choppers // and load the generated groups in the gz1 array.

  • /

}}}


Syntax to create Individual AI Groups

{{{ /* // d=[side,amount,position,unitconfig,unittype,areaname,OptionalFeatures] call (SIX_Aim_F getVariable "fCreate"); // Side - Number: 1-East, 2-West, 3-Guer, 4-CIv // Amount - Number: Amount of units to generate (between [lowerlimit,higherlimit]) // Position - Array: Position of start of group // UnitConfig - Number: Select the Unit Config from the c\cfg_(SIDE).sqf files // Unittype - Number: 1-Infantry, 2-Cars, 3-Armor, 4-Air // AreaName - String: e.g "test1"

// Individual Group Spawning Example gr1=[1, [10,20], getMarkerPos "test1", 100, 1, "test1", "AI:", [1, []], "TRACK" call (SIX_Aim_F getVariable "fChkDbg"), "SHARE"] call (SIX_Aim_F getVariable "fCreate"); gr2=[1, [10,20], getMarkerPos "test2", 100, 1, "test2", "AI:", [1, []], "TRACK" call (SIX_Aim_F getVariable "fChkDbg"), "SHARE"] call (SIX_Aim_F getVariable "fCreate"); gr2=[1, [10,20], getMarkerPos "test3", 100, 1, "test3", "AI:", [1, []], "TRACK" call (SIX_Aim_F getVariable "fChkDbg"), "SHARE"] call (SIX_Aim_F getVariable "fCreate"); // Would create create 3 variables (gr1, gr2, gr3) which represent the generated group objects

  • /

}}}