Jump to content
Sign in to follow this  
mr_centipede

Cent Squad Link - Proof of Concept

Recommended Posts

Hello all,

I think I've finished early release of my AI script. May I present you Cent_AI_SqdLink v1.0

Introduction

This script will try to mimic a cooperation between squads within the BIS High Command structure. Basically what it will do is, if a squad is under attack, it will call for help from the closest squad to his location, and share the nearTargets with the supporting squad. I tried to make more complex with the aim of making a platoon contact drill, but that was to much of a brain drain, so I simplified it to this.

Current Limitation(s)

Currently the script only emphasize on infantry battle. I haven't make a logic if the squad is under attack by armor or such.

Bugs are also would be abundant I presume

Usage

1. You need to copy [cent_sqdlink] folder into your mission

2. Put in a game logic, in the init field enter this line: nul = [] execVM "cent_sqdlink\cent_sqdlink_init.sqf";

3. Play the game and enjoy.

Sample mission is provided.

License/Copyright

I will give permission for anyone to mess around with my scripts and redistribute provided proper credits are given where credits are due (esp to Fabrizio_T)

Credits:

BIS for High Command Module

Fabrizio_T & tpw for ARMA2 bDetect framework

Download Link:

https://www.dropbox.com/s/a0k5zk6rq6yuubd/cent_sqdlink_v101.7z

Enjoy...

change log:

v1.01 24/09/2013

- added suppression effect(AI only - just adjust their skill (aimingShake, spotTime, courage)

- refine react to contact procedure - the AI will create a hold WP, and hold out until things quiten down ( > 60 secs after the last shot fired from the enemy), then they will proceed with their mission

- some minor adjustments here and there

v1.0 23/09/2013 - initial release

Edited by Mr_Centipede

Share this post


Link to post
Share on other sites

Will test it out mate. We need something like a GL4 in Arma3, and this could be a step in the right direction.

EDIT: Just tested mission and it works well. We need some way to get the support squad to get to where they are needed fast however. As I watched they spent all of the battle still in the village and didn't get out to help the fireteam. They did react however. We need a 'haul ass' waypoint for troops :)

Edited by Kremator

Share this post


Link to post
Share on other sites

New Update:

https://www.dropbox.com/s/7ouymeu46b7sqtq/test_cent_sqdlink.Stratis.7z

Change log:

I've changed the supporting squad to go to the calling group leader position, with SAD waypoint.

After they completed the waypoint, they should resume their original waypoint

This scenario only taken into consideration of 1 squad in distress and 1 supporting squad. So to simulate lets say a platoon, I need to figure a sound logic first. Who should go to support, all linked squads or just one? Should it even call for help? So that's on my To do list

Edited by Mr_Centipede

Share this post


Link to post
Share on other sites

Just make sure that this information is not shared immediately and perhaps only by the squadleader.

So that we can avoid it by taking them out fast and/or by killing the squadleader first.

Making the AI more telepathic than it already is would be bad. ;)

Share this post


Link to post
Share on other sites

There doesnt seem to be any scripts packed with the mission? getting script error about unable to find sqdlink/cent_sqdlink_init.sqf

Anyway sounds good Mr Centipede, i love these types of scripts.

How would this differ from a guard waypoint, or i guess thats what you are working on?

Could the logic take into consideration what type of support is needed to qualify for the job, eg if the first squad are overpowered by an APC and call support then any AT units would have priority? if none available then no help is requested or denied? maybe thats a bit too much logic, thats the type of behavior i wish the guard waypoints could produce.

Share this post


Link to post
Share on other sites
Just make sure that this information is not shared immediately and perhaps only by the squadleader.

So that we can avoid it by taking them out fast and/or by killing the squadleader first.

Making the AI more telepathic than it already is would be bad. ;)

Thanks for the feedback, I'll try my best. Yeah telepathic AI would be very bad :D

---------- Post added at 18:35 ---------- Previous post was at 18:33 ----------

There doesnt seem to be any scripts packed with the mission? getting script error about unable to find sqdlink/cent_sqdlink_init.sqf

Anyway sounds good Mr Centipede, i love these types of scripts.

How would this differ from a guard waypoint, or i guess thats what you are working on?

Could the logic take into consideration what type of support is needed to qualify for the job, eg if the first squad are overpowered by an APC and call support then any AT units would have priority? if none available then no help is requested or denied? maybe thats a bit too much logic, thats the type of behavior i wish the guard waypoints could produce.

Ah my bad... so sorry.. will fix it ASAP.

About the logic, sorry I don't have any fool proof concept yet. For now I'm trying to simulate a platoon, so 3-4 linked squad will communicate together. I haven't gone deep yet, but thanks for the input, because honestly I just think about infantry combat and totally forgot about vehicles. Thanks for the heads up

---------- Post added at 18:36 ---------- Previous post was at 18:35 ----------

First post updated:

https://www.dropbox.com/s/7ouymeu46b7sqtq/test_cent_sqdlink.Stratis.7z

Hope it's okay now

Edited by Mr_Centipede

Share this post


Link to post
Share on other sites

Probably "firedNear" would be a better eventhandler then "hit". Otherwise the AI might think "Hey, we are under heavy fire but no need to call help until somebody gets hurt" :D

It would also be great to do a little comparison between amount of known targets and group size. A group with 20 people that are attacked by two probably won't call for help.

P.S. If you need a dedicted server for testing, just ask me.

Share this post


Link to post
Share on other sites

@Neo,

About firedNear, already on it. But I use fired instead. The reasoning is, if you're firing, then you're are in contact. And the group leader will reset "inContact" variable every 10 secs. Havent tested this one yet, but the logic is coming in bit by bit.

Share this post


Link to post
Share on other sites

About the logic, sorry I don't have any fool proof concept yet. For now I'm trying to simulate a platoon, so 3-4 linked squad will communicate together. I haven't gone deep yet, but thanks for the input, because honestly I just think about infantry combat and totally forgot about vehicles. Thanks for the heads up

Hope it's okay now

Yes, worked perfect.. patrolling squad moved to support the squad under attack, when they arrived Opfor were already gone leaving only corpses.. supporting squad moves back to patrol their street.

Ok i get where your coming from now and how it might be different from a guard trigger.

Cheers, look forward to seeing where it goes :)

Share this post


Link to post
Share on other sites
@Neo,

About firedNear, already on it. But I use fired instead. The reasoning is, if you're firing, then you're are in contact. And the group leader will reset "inContact" variable every 10 secs. Havent tested this one yet, but the logic is coming in bit by bit.

You can quickly run in performance problems, if you are tracking every units/player with a fired-handler and calculating distances/knowsabout for every groupleader. I would probably profile some "worst-case-scenarios".

Share this post


Link to post
Share on other sites

This seems a lot like what Rydygier was doing with HAC in ArmA 2, but on a bit more grand scale. HAC was unsupported in multiplayer, but maybe it can give you some ideas?

Share this post


Link to post
Share on other sites

Hi Lucidity,

HAC was indeed a grander scale than mine... I ran into a bit of a wall right now and realised that what I was trying to achieve was too grand (not HAC grand), So currently I'm downscaling my objective/vision and start from the building block of any professional army - the squad/section level.

I'm trying to teach the AI basic battle drill (react to contact -> find the enemy/suppress them -> assault or break contact -> reorg/resume mission) on squad level. After I'm satisfied with squad level, I'll try to level up to platoon level. Company level maybe a bit too much, but we'll see when I get there.

I just finished some basic frame work on the four phases, just need to fine tune the decision making part. I'm just editing AI on squad leader level. I'm not tweaking low level AI like finding cover or such. tpw EBS and windwalker's AI cover already achieved that. With that said, I might let go(scrap) the EH part and use tpw EBS framework to detect when a squad is in contact. We'll see how it goes...

Furthermore, I intend to use BIS High Command with this, using <hcAllGroups _unit> to get all linked group that will share information when needed. Again, I might get to far ahead with myself... need to control myself to not lose focus.

So, let's see how my AI battle drill goes first... stay tuned

Share this post


Link to post
Share on other sites

I'm not sure if this is still an issue (because I only have basic scripting skills), but if the leader of the group dies, will the next-in-command continue to be controlled by the script?

Share this post


Link to post
Share on other sites

Hey Mr Cent,

I haven't really tested properly yet but I have had up to 10squads (same faction) and everything seems to function ok. It did appear the some groups may have been oblivious to a firefights that should have concerned them? But as mentioned there's a good sound suppression (forget name) mod already to take care of that aspect.

Can Opfor/Blufor share the same script?

Share this post


Link to post
Share on other sites

Cent, can you explain the limitations of the script, such as how many groups can the script control, maximum number of units per squad, and possible incompatibilities with other scripts?

Also, can this be run in a multiplayer setting or does the script run on all clients?

You might consider starting a doc on Google Drive as a manual so that users can be up-to-date as you develop this thing, plus they can comment and ask questions directly.

Share this post


Link to post
Share on other sites

@Katipo,

The squad will only call 1 squad only to come and help them. Then the squad that going to help them wont call for additional help. The logic behind calling for help also non-existant currently. Those that are in contact will automatically call for closest help (I'm trying this for the past week, but didn't come out that good). Blufor and Opfor can share the same script.

@Lucidity,

I didn't limit the max amount of group so probably limited to ones machine. About combatiility, I tested with tpw EBS mod, so that one should work fine, other than that I don't know.

Multiplayer combatibility, honestly I don't know. Probably not because I don't know one thing how to code scripts with MP in mind.

Share this post


Link to post
Share on other sites

@Lucidity,

I didn't limit the max amount of group so probably limited to ones machine. About combatiility, I tested with tpw EBS mod, so that one should work fine, other than that I don't know.

Multiplayer combatibility, honestly I don't know. Probably not because I don't know one thing how to code scripts with MP in mind.

Alright, with multiplayer, please look into the "is server?" command (whatever the snippet is). I believe you can get away making it multiplayer compatible by forcing the script to exit on client machines. If it doesn't work, feel free to call me an idiot.

Share this post


Link to post
Share on other sites

About isServer command, I don't know where I should put it. is it in the init? Sorry I'm not very knowledgeable in MP scripting, maybe some one with access to a dedi server can try it?

New update:

Added a test mission on Altis that I personally like. The firefight can last very long, and a lot suppression fire going on from the AI (it looks like they're firing blind). I'm also firing blind, generally shoot where the AIs are shooting at, without seeing the enemy most of the time. Btw I didn't run with any other AI mods, (tpw EBS or WW AICover)

Enjoy.

change log:

v1.01 24/09/2013

- added suppression effect(AI only - just adjust their skill (aimingShake, spotTime, courage)

- refine react to contact procedure - the AI will create a hold WP, and hold out until things quiten down ( > 60 secs after the last shot fired from the enemy), then they will proceed with their mission

- some minor adjustments here and there

Share this post


Link to post
Share on other sites
About isServer command, I don't know where I should put it. is it in the init? Sorry I'm not very knowledgeable in MP scripting, maybe some one with access to a dedi server can try it?

With ArmA 2, the line of code was

if not (isServer) exitWith {};

which needed to be at the top of the first script initialized, so in this case you'll probably add that to the top of cent_sqdlink_init.sqf.

I believe that line of code tells the system to check if it is the host or the client, if it is the client, it exits. As far back as OFP, I think that is all you need to do to make the script multiplayer compatible (so the script isn't running in multiple instances). Dedicated servers seem to work differently with headless clients, but if you can host a game and have a friend join and play without problems, then the script is at least somewhat compatible with multiplayer.

---------- Post added at 11:32 AM ---------- Previous post was at 11:17 AM ----------

Also, check this out http://community.bistudio.com/wiki/Multiplayer_framework

Edited by Lucidity

Share this post


Link to post
Share on other sites

How do I tell the script how many groups I am using?

Share this post


Link to post
Share on other sites

I'm not sure I understand the question...

If you mean how it is assigned to the group then the script (using bDetect as its base) will assign a fired EH on every unit on map. So when a unit detects a bullet near him, the script will suppress the unit (change some skill value) and tell the group that they're in contact.

Then, the group that is in contact will call for help by checking if he is in a HC command structure. If he is, then the script will find the closest one to send as reinforcement. If he's not then no reinforcement will come.

So basically you need to assign high command structure to the groups that you want them to reinforce each other. I'm still figuring out how the decision is suppose to be made (when to call for help, who should be sent to help, etc). It's still a long way, but if you want a simple group supporting each other, then this might be it...

Share this post


Link to post
Share on other sites

Okay, in your example missions, each group (that I'm assuming is controlled by the script) has a "grp# = group this" in their init field. Is that necessary or do I just need to sync up the groups with high command/sub for them to work?

Share this post


Link to post
Share on other sites

Ah, I understand now... that was the legacy left over from earlier version. Sorry for causing the confusion. Those are not necessary anymore. It's automatic, as long as you have that Game Logic unit, with the init line

Share this post


Link to post
Share on other sites
Ah, I understand now... that was the legacy left over from earlier version. Sorry for causing the confusion. Those are not necessary anymore. It's automatic, as long as you have that Game Logic unit, with the init line

So nothing needs to be in their init lines, but do they need to be sync'd to the high command.

On a side note, I've never fully understood the relationship of high command to subordinate when both are ai controlled. Does the AI cooperate and collaborate when groups are sync'd with the modules (to a commanding ai unit, like in your example)?

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
Sign in to follow this  

×