Page 1 of 4 1234 LastLast
Results 1 to 10 of 37

Thread: Nou's Forward Observer Script v0.5

  1. #1

    Nou's Forward Observer Script v0.5

    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:
    Code:
    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:

    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.

  2. #2
    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?

  3. #3
    Sergeant Major NouberNou's Avatar
    Join Date
    Jul 6 2009
    Location
    Tacoma, WA
    Posts
    1,942
    Author of the Thread
    Quote Originally Posted by galzohar View Post
    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.

  4. #4
    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?

  5. #5
    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.

  6. #6
    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.

  7. #7
    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.

  8. #8
    Just load up the debugger and play with nearTargets, and see for yourself.

  9. #9
    Did not have time to try this yet but sounds great

    Release frontpaged at the Armaholic homepage.


  10. #10
    Cool. Will test.

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

    Alex


Page 1 of 4 1234 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •