Jump to content
Sign in to follow this  
noubernou

Nou's Forward Observer Script v0.5

Recommended Posts

Nou's Forward Observer Script v0.5

September 11, 2009

This will simulate a forward observer attached to a gun battery. It is ran on a unit which then begins to search in a radius around it (500 meters) for enemy units. It finds the largest group of units (a group in this case consists of units within 50 meters of anyone unit) and begins to execute a fire mission on them.

When it executes a fire mission it may or may not adjust fire, up to 2 adjustments of fire. A majority of the time it will Fire For Effect on the first mission. It determines the number of rounds based off of the number of units at the target, times a force multiplier that adds rounds if there are tanks or IFV in the area, the maximum number of rounds per tube per mission is 8. Dispersion is set at a value of 12.5 meters times the number of rounds up to a maximum of 200 meters.

Once the mission completes it then waits a defined amount of time and it starts again. If the largest group is within 120 meters of the last mission it moves on to the next group and fires against it. It will repeat this until all units are either dead or disabled within range of the FO.

Simple Example:

junk = [foUnit, artilleryModuleBattery, numberOfMinutesBetweenMissions, side] execVM "fo\forward_observer.sqf";

Applicable values for side are (these are the objects, not strings):

west, east, resistance, civilian

This and the engage.sqf file MUST BE PLACED IN A FOLDER CALLED "fo" and called from that folder!

Extended Example:

1. Place a couple artillery pieces grouped together on the map.

2. Place an Artillery Module and sync it with the artillery group leader. Name this module something like "myBattery"

3. Place a unit that you want to act as your forward observer, it can be any unit really.

4. In the init line of your forward observer place the follow code:

junk = [this, myBattery, 1, west] execVM "fo\forward_observer.sqf";

5. The above code will tell the unit to use "myBattery" to search every 1 minutes for units aligned with the "west" side.

6. Any units within 500 meters of the forward observer will be engaged until they are killed or disabled.

Please review the included example mission if you have any trouble.

KNOWN ISSUES

1. When engaging only one target it will take twice the amount of time to fire on it due to it considering that the FO should engage another target first and it resets (otherwise it sits there and attacks the largest target only).

2. Sometimes the count of units in the area is slightly off, do not know why...

@TODO

1. Add in more configuration options for the script (round type, search radius, etc).

2. Add in better use of adjust fire, make it so previously hit areas do not use the adjust fire simulation.

3. Control multiple batteries from the same FO (simulate a FDC in control of multiple batteries).

4. Add radio calls for use with missions where the FO is working with the player.

5. Add better debugging code!!!!

6. Add better commenting of code!!!

LICENSE

I hope people enjoy and use this. Remember, its not my fault if something breaks because of this, so use it at your own risk! Also, I seriously doubt this will occur, but if you do use this in a commercial product please let me know so I can be proud of it, and make sure you keep this header in the script!!!

DOWNLOAD

URL: http://raceriv.com/arma2/Nous_FO_v0.5.rar

Please feel free to mirror if you want. Thank you! :)

Let me know what you guys think and what other improvements you can think of.

Share this post


Link to post
Share on other sites

I don't think you want dispersion to grow linearly to the number of rounds. If there is a strong enemy force including IFVs/tanks it should try to focus on them rather than spread the fire over 200m... Increasing dispersion to match the radius of the enemy force it is targeting (distance from "center" to the furthest unit) would make much more sense, assuming it evaluates targets properly and doesn't try to shoot 2 units that are 300m apart with 1 volley or something silly like that.

So is this forward observer "psychic"? That is, sees all units within 500m regardless of regular detection rules?

Share this post


Link to post
Share on other sites
I don't think you want dispersion to grow linearly to the number of rounds. If there is a strong enemy force including IFVs/tanks it should try to focus on them rather than spread the fire over 200m... Increasing dispersion to match the radius of the enemy force it is targeting (distance from "center" to the furthest unit) would make much more sense, assuming it evaluates targets properly and doesn't try to shoot 2 units that are 300m apart with 1 volley or something silly like that.

So is this forward observer "psychic"? That is, sees all units within 500m regardless of regular detection rules?

I agree, the issue I was having though is that when it was a large number of units it was converging fire too much. I need to do something to adjust the dispersion according to target types, like it does with the multiplier for the number of rounds (more rounds for tanks, then probably a tighter dispersion).

Yes, right now it is psychic. I am wondering an effective way for it to engage targets that it detects as AI, but I have always run into the issue with infantry not being able to detect units at a great distance effectively.

What I would like it do is maybe work the same way it does now, but only engage targets that it has line of sight on, but I am not sure how to do that at the moment.

Share this post


Link to post
Share on other sites

I've worked on a enemy FO script as well, and I just forced the FO to watch at each enemy around him, and if a LOS was established it would call in an arty strike. On open field it could easily detect enemies from 900m away, so you could try something similar.

Anyhow, I assume you use virtual artillery for that dispersion?

Share this post


Link to post
Share on other sites

The problem with using real detection is indeed the crappy AI detection abilities. Infantry that doesn't shoot is 100% invisible beyond 175m during the day, and other units also have a not-very-long range above which they are invisible. And it doesn't seem to matter if the AI has any optics. The only AI optics that seem to matter are NV at night, which increase the AI infantry detection range from 20m to 95m, and that's on a night with no clouds and I could see almost as good as day except in black and white.

Hopefully AI detection range limitations will be removed and just make it take him longer to detect distant targets, but that's up to BIS.

Share this post


Link to post
Share on other sites

Actually, the AI can detect objects from afar, but they can't detect if the object they spotted was enemy or not, and as long as the side for the spotted object remains "UNKNOWN", they AI won't do shit.

So what I did in my script is helping/cheating in the side detection, so the AI could actually detect from a far distance, if direct LOS was present.

Share this post


Link to post
Share on other sites

How do you modify that? Would be nice to give the AI similar detection ability to players, if it can be done via a script, at least until BIS come up with a fix.

Are you sure, though? I remember grouping myself with a bot and placing an enemy 200m away, and the bot would ignore him completely until I "showed" it to him.

Share this post


Link to post
Share on other sites

Cool. Will test. :)

Maybe someone can make the good old "TrueRangeAI" addon again? (Long range detection for AI).

Alex

Share this post


Link to post
Share on other sites

Thanks Foxhound for the post on Armaholic!

On the note of AI detecting each other I have noticed that unless you give the units a destroy waypoint on an actual AI they do not seem to even care about each other until they are within 50 to 100 meters, even if they are on fairly open terrain.

Share this post


Link to post
Share on other sites

Just tested and great script! finally an AI artillery script!

Only observation is when you use in night time setting, the AI hardly fired. The FO had NVG and still could not get him to fire.

Share this post


Link to post
Share on other sites

Thats very odd CaptainBravo, since the unit doesn't use its "eyes" or anything, but rather more telepathic "methods" using the nearObjects command. Technically you can put the script on a goat or a sign and it will work...

I'll look into that though and see if it reacts differently during night time. Thanks for the report.

Share this post


Link to post
Share on other sites

I have tried script again and it works well. Just to clarify: if I increase trig size (FO trig) then artillery should fire on longer range ?

Perhaps next version you can add FO to script and one with highest priority targets gets the fire mission (armor, vehciles ..)

Great script.

Share this post


Link to post
Share on other sites
I have tried script again and it works well. Just to clarify: if I increase trig size (FO trig) then artillery should fire on longer range ?

Perhaps next version you can add FO to script and one with highest priority targets gets the fire mission (armor, vehciles ..)

Great script.

Ah, negative on the trigger size, that was only meant to be an example of its search range.

Right now the search radius is hard coded to 500 meters, I am going to be adding a few radius options for searching, group sizes, and dispersion soon. I should probably have another release out today or tomorrow (first game for my NFL team today... so that might take higher priority! :p).

Share this post


Link to post
Share on other sites

No updates yet, I have been messing around with knowsAbout command to see if I can get it to only fire on targets it can actually see. AI right just sucks at that though, I can have a soldier stare down an enemy from a 100 meters away and it wont even register... :(

In terms of dispersion, I am going to look into that. I might end up doing shell spawning since the dispersion function I am told works better that way. Also I might add in some randomness to the final target area.

I have been running my FO script using the ACM turned up to full. It is pretty fun watching the FO rain shells down on enemies. You have to make sure that they get into fire fights though, otherwise units move too quickly and the shells are way off. I was thinking about trying to script predictive fire in, but that seems like a lot of work for right now when there are other things to work out.

The multiplier that adjusts the number of shells needs to also subtract shells if it is just infantry... I have seen it call in 18-20 shells on just a squad sized element of infantry in the open.

---------- Post added at 01:00 AM ---------- Previous post was at 12:58 AM ----------

Also been working on some manual FO tools, like a ruler for the map, but I am running into a number of issues there (mainly from just lack of experience).

Share this post


Link to post
Share on other sites

you are doing great work for someone who lacks experience :)

The AI sight is not too good in this game so a little cheating might be necessary. That is where dispersion comes in to make it fair.

ALso maybe adding 2 or 3 FO using some artillery unit, so if one goes down artillery still has (eyes) on battle field.

Keep up the good work.

Share this post


Link to post
Share on other sites

Ingame Ai detection is a horror indeed.

Have you experimented with the reveal command and then just prioritizing targets per script depending on their range?

If that doesnt work you could use the ingame allunits array

and check for

{_x == side ENEMY} and {_x distance _spotter<=500}

EDIT: Just looked at your script . The way you do it just works great. I had thought you were looking for more of an AI-like enemy detection where the spotter needs to be aware of the enemies.

Edited by Charon Productions

Share this post


Link to post
Share on other sites

In your comment section you wrote:

sleep 5; // This needs to be figured out better, probably needs to watch the arty modules and see when they are done with init.

This is how to find it out:

_bool=(units myBattery select 0) getVariable "ARTY_INITIALIZED";

returns true if the artillery is initialized.

or maybe like you did it

count (units (_battery getVariable"ARTY_INITIALIZED"));

Keep it up, AI FO is a great thing !!!

EDIT: I personally like dynamic war missions and just let them play against each other like playing chess with myself hehe.

So another idea would be counter-artillery tactics where free available batteries

can try to engage the enemy artillery or some units are sent out to kill the enemy spotter.

Many possibilities to enhance your great script.

Edited by Charon Productions

Share this post


Link to post
Share on other sites

CaptainBravo, sorry things have been a little hectic lately IRL and with the unit I play with.

I am also in the middle of writing a field manual for artillery that can be applied in game (a condensed version of Army FM 6-30) and a ruler script (so you can more easily do polar coordinates and OT/GT lines).

I really want to work on this, maybe I will get to it today.

Charon, thanks for the tips. About counter battery, I was trying to do an overly realistic simulation of that, actually tracking the rounds in flight and calculating their trajectory down and up... I put that on the back burner as it was more of learning/experiment thing. I do like the idea of CB fire though just using the supplied round track tools.

To be honest I would like to implement a whole Artillery chain including FDC, where you can have FO be in the field and they will call in targets and the FDC will decide what battery and what type of rounds to fire on it. Thats all pie in the sky at the moment cause I am training real people in game to do the same thing... :P

Share this post


Link to post
Share on other sites
@TODO

1. Add in more configuration options for the script (round type, search radius, etc).

2. Add in better use of adjust fire, make it so previously hit areas do not use the adjust fire simulation.

3. Control multiple batteries from the same FO (simulate a FDC in control of multiple batteries).

4. Add radio calls for use with missions where the FO is working with the player.

5. Add better debugging code!!!!

6. Add better commenting of code!!!

How about also add radio calls from the FO to the artillery units...? (I think this could be usefull if the pieces are manned by players):)

Share this post


Link to post
Share on other sites
How about also add radio calls from the FO to the artillery units...? (I think this could be usefull if the pieces are manned by players):)

Thats a great idea and actually sort of part of a very large addon pack that I am making.

I do not want to release too many details right now, but it will be a very comprehensive player controlled artillery simulation covering guns/FDC/FO operations. ;)

For those of you waiting for an update, I apologize for the slowness. I made some good updates, I will look at it today and see if I can give out a release. :)

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  

×