Jump to content
Sign in to follow this  
Rydygier

Problematic Scripts Museum presents an exhibit: Angry Spartan

Recommended Posts

Exhibit No. 00002/20131128/Ryd



ANGRY SPARTAN - turret AI with enhanced fire control

1. The file

Package contains three demo missions, where script is activated via Init.sqf. Oe demo shows static turret in action, another shows mobile turret, last - possibility of usage AS for AA purposes.

2. What this does?

Basically AS makes chosen vehicles (turrets) fire at pointed objects in chosen way, with chosen effectiveness, if chosen distance and direction conditions are met. Turrets will engage only, when user want, any possible to hit target pointed by user, regardless of its side. Script was designed with autonomous .50 cal turret in mind, but experiments with other equipment using ammo of similar ballistics may prove interesting. Tested against infantry, cars and helicopters.

3. Usage

Paste content of any demo mission folder into yours mission folder. Init by:

nul = [turrets,targets,range,arc,dispersion,unlimited ammo,delay,fire mode,debug] execVM "AS\ASInit.sqf";

By default vehicles set as turrets should have maximized skill.

Parameters:

1. Turrets (vehicles) to be controlled by AS (array of AI vehicles). 
2. Array of targets - units, that will be considered as hostile by turrets.
3. Distance of engagement - number in meters. More distant targets will be ignored.
4. Arc of fire. Eg for value of 80 turret will engage targets located up to 40 degrees left/right relative to the main turret axis. Number from 0 to 360.
5. Dispersion. Number from 0 to 1. Each 0.1 means 1m of dispersion range (3D) on 100 meters distance (value changes proportional to distance). Values above 0.1 mean poor to tragic efficiency.
6. Unlimited ammo - boolean.
7. Additonal delay between shots. Positive number in seconds. Final interval is equal to delay + (random (delay/2)). Eg for 10, delay will be each time randomized from 10 to 15 seconds.
8. "Termopile" mode switch - boolean. In normal mode turret will aim, then shoot. In "Termopile" mode turret will shoot and aim simultanously. 
9. Debug mode (3D markers for guns, targets and targeting spots. 

Additional setup:

1. List of targets can be changed on the fly via manipulating
RYD_AS_Targets
array, that holds targets' names.

2. Use in the init field of unit(s):

this setVariable ["RYD_AS_Aegis",[i]number[/i]];

to shield chosen unit(s) by setting minimal dispersion (
number
, in meters) for turrets targeting them. This not guarantee 100% inviolability. Unit still can be hit by ricochets or if will stand in the line of fire.

3. Terminate AI permanently by:

 RYD_AS_Active = false;

4. You can lower turret's skill to achieve even worse accuracy.

5. Temporary pause whole script by:

 RYD_AS_Pause = true;

and resume by

RYD_AS_Pause = false;

6. You can any moment switch chosen
turret
from static (default) to mobile state (so will follow waypoints, respond to doMove command etc) by:

[i] turret[/i] getVariable ["RYD_AS_Mobile",[i]true/false[/i]]

7. You can any moment switch chosen
turret
's mode via

[i]turret[/i] setVariable ["RYD_AS_Termopile",[i]true/false[/i]];

SAFETY WARNING:



Use with caution!

Do not approach operating turret from the front!

Do not set own unit as the target!

Keep away from children!

Before maintenance work disconnect the power!

Manufacturer is not liable for damage resulting from non-compliance of these rules.

This exhibition has been prepared by courtesy of: Problematic Scripts Museum. Exhibits so far:

DRUNKEN MARATHONER

ANGRY SPARTAN

HECTIC MUSE

Script you can freely modify, copy, "cannibalize", to use in your projects. It is released under APL-SA license. I'll be grateful for notification about each such usage.

Edited by Rydygier
1.1

Share this post


Link to post
Share on other sites
Guest

Thanks for informing us of the release :cool:

Release frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

:)

BTW I would be happy seeing regular scripting command of at least such variety of settings and control possibilities working for all vehicles and men as well.

Share this post


Link to post
Share on other sites

Very cool again! Immediately reminded me of Alien II, too bad there are no aliens in Arma (yet)... :D

Share this post


Link to post
Share on other sites

Yeah, Aliens 2, I remember. :)

Wanted better moving objects targeting, and improve overall handling for other turret-like vehicles (tested with autonomous .50 HMG, Stomper and Cheetah). Current goal was, when without applied dispersion, decent effectiveness against objects of speed up to 100 m/s. I'm happy with current results in 80%, that's low for me, I feel, that my formulas are still imperfect, too many makeshifts, so probably I'll work more with this.

Improved also overall behavior. Noted, that for some vehicles, like Stomper, doWath or LookAt commands sets barrel in such position, so turret is still not aimedAt, but are targeting a bit higher than should be to hit, while for other there isn't such effect. Failed to find common reason, so was forced to add amendement if needed by individual classes.

Also have an idea for future - would be nice, if turret will be able to adjust targetting parameters dynamically by kind of short-term self-learning. Let's say turret few times missed same target in short amount of time, one shot by one. In such circumstance there is good chance, that problem is imperfect targeting calculations. So AI could to measure parameters of these misses, take the average, and try to self-apply proper changes to the coefficients to compensate for next shots... But for now:

1.1 released.

Changelog:

- improved targeting of fast objects;

- improved overall script behavior;

- two additional demos to show new features;

- additional control possibilities.

I also want to thank Hypnomatic for his projectile path tracing script, was invaluable during

. Edited by Rydygier

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  

×