Gunter Severloh 4054 Posted April 2, 2023 (edited) by Rydygier & Gunter Severloh What is Herne? Herne is an ai hunter script, the script was written with two AI hunting codes merged into one. The first code you can see demonstrated here: VIDEO The second code was taken from my mission: Desert OPS Run - Tactical Arena scenario. The first code basically gives the ai knowledge of roughly where the player is, they will move, pursue, and search for the player in the area they "know" where the player is without you needing to give them waypoints, if the player is seen or shoots, the ai will engage, and follow. The second code gives the ai knowledge of where the player is, but its main focus is engaging the player inside a buildings, so if the player is hiding, or defending or had moved to a location inside a building of any type, the ai will most times enter the building en-masse and locate and kill the player, almost like in cqb. Though the ai is not going to have a tactical prowess or some special forces techniques or tactics they will perform when they enter, the normal vanilla ai skills will come into play, the script mainly gets the ai to the player's location and has them search. Download the Script/Demo mission v1.1 https://www.dropbox.com/s/88p0p4mtun6sxfe/RYD_Herne_v1_1_demo.Altis.zip?dl=0 Spawn AI through a trigger that will hunt the player! How to use the script in a scenario In a initServer.sqf or init.sqf put the following code: call compile preprocessFileLineNumbers "Herne.sqf"; { [_x] call RYD_CH_Herne; } foreach [HuntingGroup1,HuntingGroup2]; Ingame Usage: Give the enemy squad or unit a name in their group variable name box not a squad's leaders or single unit variable box, the squad as a group, so using the Entity List (left panel) click on the group itself and edit it, then run the code from a initServer.sqf as seen above, replacing or using HuntingGroup1 or 2 with your own name. Optional Parameters You also have optional parameters if you want to customize. For the following adjust the code in your initServer.sqf or init.sqf: [HuntingParty,onlyKnown,distanceLimit,updateInterval] call RYD_CH_Herne; onlyKnown: may be 0, 1 or 2. 0 - hunters will hunt the player regardless of knowledge about him. 1 - hunters will move as a group in the player's vicinity regardless of knowledge, but they must know about the player in order to enter into the building (default setting). 2 - hunters will not hunt unknown players. distanceLimit: in meters. Only players closer than this from hunting group leader may be hunted by this group. Negative value (default) removes any distance limitation. updateInterval: in seconds. How often hunting parties will reevaluate movement destination. Note: if set too low, hunters may be stuck if their supposed to move far away, as path finding may take longer, than this value, so before they find a path, new destination will make them start path finding a new path. IMO don't go below default, which is 60 seconds, in fact probably no reason to change that value anyway. After executing, each hunting party will be stored inside RYD_CH_WildHunt global variable ( a single loop iterating through each hunting party each cycle/interval). Hunting group will move in the vicinity of closest player and if close enough (<100), members of this group may enter inside the building, if player is hiding in it. Edited October 29, 2023 by Gunter Severloh Updated script/demo with version 1.1 15 Share this post Link to post Share on other sites
EO 11275 Posted April 2, 2023 Cool script guys, cool artwork too. 1 Share this post Link to post Share on other sites
Gunter Severloh 4054 Posted April 2, 2023 The name for the script is from Herne the Hunter https://en.wikipedia.org/wiki/Herne_the_Hunter https://www.hypnogoria.com/herne.html https://mythopedia.com/topics/herne-the-hunter In the code itself Rydygier uses names such as Wild Hunt which is part of the Herne the Hunter folklore/mythology. 1 Share this post Link to post Share on other sites
Rydygier 1309 Posted April 3, 2023 I wonder, if anyone knows this: 3 Share this post Link to post Share on other sites
Gunter Severloh 4054 Posted April 3, 2023 Video added to the original post with a demonstration, configuration and setup. The video shows the very basics of setup groups with Herne. Idk if you guys ever seen this movie but its called The Ritual its setting is in Sweden but basically the creature in this movie (just an assumption here) is called Moder Child of Loki which is i think related to Herne as Herne was said to be folklore, mythology and or the God of the forest, anyways check it out pretty freaky movie, but this video explains what the movie is about and goes into the creature. I hope that it doesn't throw people off on the AI script as im mainly just referring being the lore behind the name we used for the script. Cheers! 1 1 Share this post Link to post Share on other sites
Melody_Mike 130 Posted April 4, 2023 On 4/3/2023 at 4:15 AM, Gunter Severloh said: That guy picks all the wrong mountain cabin AirBnB's: 1 Share this post Link to post Share on other sites
Gunter Severloh 4054 Posted April 4, 2023 Give Rydygier some likes he combined both codes and wrote the script, dont give me all the points, i just created the thread and the video and helped make this available to the Arma community, seriously the man can do some amazing stuff with code. You know you've played to much Arma when you can make the engine do what you want through code that would be Rydygier's statement in my thread here 😄 1 Share this post Link to post Share on other sites
Play3r 147 Posted April 5, 2023 Great script Rydygier and you came up with, i have been using the Hunt Player script in some of my SP games. How does the Ai decide what player they are going to hunt if i use it in a MP game with about 4 players ? Cheers Play3r Share this post Link to post Share on other sites
Rydygier 1309 Posted April 6, 2023 If there are many players, each hunting group goes after the closest one (to the hunting group's leader). Depending on settings, ignored may be (or not) players unknown to given hunting group. Another optional limitation is certain distance limit, but it is disabled by default. Yet another option to exclude some player from being hunted is marking him like this on the server: somePlayerUnitName setVariable ["RYD_CH_Protected",true]; or anywhere: somePlayerUnitName setVariable ["RYD_CH_Protected",true,true]; 1 2 Share this post Link to post Share on other sites
elpreguntadoro 3 Posted April 7, 2023 Hello, it's good to see two pioneers of the ARMA series, interacting with their works. It really is an invaluable contribution to the community. As a parent and with all the commitments that entails, I don't have the time I'd like to dedicate to this game. Rydygier, from time to time you use your ARMA 2 DRAGONS 😊 I still can't afford to make a medley of medieval mods for wizards to use.😧 But, I just downloaded the sample mission, so I think I know how to get the most out of it. 1 1 Share this post Link to post Share on other sites
Play3r 147 Posted April 7, 2023 27 minutes ago, elpreguntadoro said: Hola, que bueno ver a dos pioneros de la serie ARMA, interactuando con sus obras. Realmente es una contribución invaluable para la comunidad. Como padre y con todos los compromisos que eso implica, no tengo el tiempo que me gustaría dedicarle a este juego. Rydygier, de vez en cuando usas tu ARMA 2 DRAGONS 😊Todavía no puedo permitirme hacer una mezcla de mods medievales para que los usen los magos.😧Pero, acabo de descargar la misión de muestra, creo que sé cómo aprovecharla al máximo. plz keep the forum in english.. Share this post Link to post Share on other sites
elpreguntadoro 3 Posted April 7, 2023 Sorry, I don't know what you mean, I use the google translator and then "paste" the text. Maybe it's a browser effect (I think it has been corrected) Share this post Link to post Share on other sites
Rydygier 1309 Posted April 7, 2023 1 hour ago, elpreguntadoro said: Rydygier, from time to time you use your ARMA 2 DRAGONS The ones, Icewindo made to be used with my Rincewinder, Combat Effective Magick System? Also there was some melee script involved. Well, old days (I didn't run A2 since A3 appeared...) and some cool memories of working on those. 🙂 BTW Rincewinder was ported to A3, can be found on Steam Workshop. No true dragons though, only choppers pretending them... Still, here let's focus on Herne. Share this post Link to post Share on other sites
elpreguntadoro 3 Posted April 7, 2023 5 minutes ago, Rydygier said: Aún así, aquí centrémonos en Herne. That's right, I want to test that script and then comment. Greetings Share this post Link to post Share on other sites
Gunter Severloh 4054 Posted April 8, 2023 Hi guys, gunter here i'm on a flip phone. Was a headache to get here and post this, anyways i wanted to let you know especially rydygier as we were working on something through pm that my computer is down. Tuesday my computer wouldn't boot nor get to the desktop, i learned that from a friend of mine over the phone and from some tests that my win 10 operating system is corrupted. So currently im waiting for a cd with win 10 os on it to boot off of and reinstall the os on a new ssd i bought this morning from my friend who is a computer tech btw 😉 so i'm hoping by saturday afternoon i'll be back to normal, sunday the latest. No arma since tuesday 😞 be back soon! 2 Share this post Link to post Share on other sites
froggyluv 2136 Posted April 8, 2023 You know you've played too much Arma when it melts your gear back into the age of the Flip-Phones... 1 3 Share this post Link to post Share on other sites
Gunter Severloh 4054 Posted April 8, 2023 Ya, looks like i wont be back til after monday. Cd didnt arrive in today's mail :( dam fri, sat, and sun off from work and no arma. Share this post Link to post Share on other sites
froggyluv 2136 Posted April 9, 2023 Nah i feel for ya man - happened to me overdoing SkyrimVR mods and animations - whammied my whole install and had to re-buy windows. In the long run im happiers with my fresh install but the waiting game sucks. Also -should be a USB stick not a CD ya Boomer ! 1 Share this post Link to post Share on other sites
Soapbox0331 17 Posted April 12, 2023 Thanks for these scripts. 1) Any issues using this on MP dedicated server? 2) Is there a way to keep the AI from closing with the players beyond a certain distance? For example consider AI recon element tasked to shadow players, so in tight terrain, for this example, not close to within say 150m of a player? Share this post Link to post Share on other sites
Rydygier 1309 Posted April 12, 2023 1) No issues known to me - not tested but also not expected. It should work fine as long kept server side, along with affected AIs. 2) No. That would require quite different logic, more complex and hard to make reliably, I imagine. Covert following is out of scope here, probably also too specific for standalone script project. 1 Share this post Link to post Share on other sites
elpreguntadoro 3 Posted April 13, 2023 Hello again, I was testing the scripts. Herne The AI Hunter Script, and the code Gunter shared. I downloaded the test missions, but I made some modifications: I put the player's unit in a building, near the hospital in KAVALA; on the top floor. Not on the roof, but on the top floor, inside. The OPFOR units reach the building but with none of the scripts they go up to search. Even when I do some shots in the air. They only went up when I had the ASR AI3 mod active, but only after taking a few shots. It's a pity, imagine a scenario, where you would have to escape after eliminating a target and go up to the last floor and wait and resist for a period of time to be rescued by air or receive reinforcements by ground Share this post Link to post Share on other sites
Rydygier 1309 Posted April 13, 2023 Well, they should. If they don't do that in some case, there are various possible causes. If you provide vanilla repro - a mission, that doesn't require any mods or other scripts, where the problem occurs, there's a chance to determine, what's the exact cause and, if possible, to fix it. Share this post Link to post Share on other sites
Rydygier 1309 Posted April 13, 2023 Was the building one of those? If so, the probable cause is this line: private _blds = nearestObjects [_prey, ["house"],10,true]; So the script looks for any house object in 2D radius of 10m around the player. But those searches are in relation to the ground level center of the building, not to any point of it. Hence, if building is large enough, there may be positions inside it, that are farther, than 10m from that center. So I went into that building and found positions at the edges, that are >11m away from the house center (distance in 2D). Result: no building to be searched found. So if you want, try such a change: private _blds = nearestObjects [_prey, ["house"],30,true]; If that's the cause, it should help (in my tests with me closer to the center, AIs entered the building and found me eventually). So, why the radius is so small? Well, If you're in some large building close to the external wall, and just behind this wall is other building, very small, that small building may be closer to you, than the one, you're in. That's not good. But since 10m proven to be too little for some buildings, we probably need to accept some risk of that sort. 30 meters hopefully should cover (almost?) all cases - tested on Altis airport terminal building. I wouldn't go wider even, if there are larger buildings. 30m is already risky. 2 1 Share this post Link to post Share on other sites
major-stiffy 279 Posted April 13, 2023 I'm going to test this in MP in a few weeks. Might you see an issue if used with VcomAI? Share this post Link to post Share on other sites
Rydygier 1309 Posted April 13, 2023 Although never used vcom and do not know, what exactly it does an by what technical means, expected should be interferences with any AI mod, that tries to move AIs from place to place or manipulate its stance, behavior or combat mode. Simply imagine, what happens, when two different scripts tries to achieve two different things by manipulating in the same time the same unit... 🙂 Unless two AI mods are designed to work together or at least known to tolerate each other, universally good idea is to avoid mixing them. IMO best if hunter groups would be excluded from any other AI mod control, but of course feel free to experiment, who knows... Share this post Link to post Share on other sites