Arma 3
(DEV) AI Pathfinder Improvement
72 Comments
ImmortalTheOwl  [author] Aug 22 @ 6:24am 
I should think so.
Gadunaro Aug 22 @ 3:47am 
is this compatible with DCO squad FSM/DCO soldier fsm
or meant to be used with vanilla ai?
_mickey_ Aug 19 @ 11:34am 
@ImmortalTheOwl Enjoy the summer, we won't have even two weeks left :(
_mickey_ Aug 19 @ 11:32am 
@Glendening

this is exactly what I described below. I am with you.
ImmortalTheOwl  [author] Aug 19 @ 8:06am 
My apologies for the lack of updates lately.
ImmortalTheOwl  [author] Aug 19 @ 8:05am 
Oh, I thought I'd posted my little break update but I'll post it now. I was meant to post something a week or so ago stating that I'm taking a short break from updating the dev branch to enjoy the summer holidays for a bit and to finish up some 3D Modelling projects. I'll let you all know when I'll resume updates.
Glendening Aug 9 @ 11:10am 
As someone who plays a lot of Antistasi and "loves" when my AI crew walk into a building then stand there forever or drive into a tree over and over. Please Yes on the better stuck check stuff. :steamhappy:
_mickey_ Aug 6 @ 2:21pm 
You have the right to do as you see fit, but this is my opinion. For now, just put doorways aside and be sure to try doing tests with LAMBS, see how the AI uses doorways in an urban environment. I think this will be enough!

1) Try teaching AI drivers to bypass obstacles by his way and stop if allied infantry is near the vehicle. Very often, AI drivers crush allied infantry on their way. I use the @TPW mod, which has a module called "SANITY", which smooths out this problem but does not work stably. There are several settings. What speed should a vehicle have if there is its own infantry nearby (setting radius) May be you will improve this system!

2) try creating a c“stuck-check” in which the AI driver gets stuck. At such moments, there may be a tree that does not break, or a building, or another vehicle in the driver's path. If the check shows that the vehicle is stuck, you need to create a maneuver (moving backwards followed by a turn)
_mickey_ Aug 6 @ 1:59pm 
"I’ll tweak the “stuck-check” logic"

As I personally think, AI (infantry) does not get stuck, because it goes through all obstacles. Probably, AI vehicles will need this system.

Only if you can use the Anti-Wall-Glitch mod system (where the wall physically prevents AI infantry from passing through) then “stuck-check” logic" might be useful for infantry also.
_mickey_ Aug 6 @ 1:54pm 
Regarding doorways, I don't know how much of this work can be done in Arma3 engine, but I highly recommend you to do your tests together with LAMBS, because this mod has already done the work related to doorways! Just see it! The AI will enter houses, go up to the second floor and will go down! This is even without special waypoints! So most likely, you will not need to do this work again!
_mickey_ Aug 6 @ 1:50pm 
"I really appreciate all the testing and the detailed feedback,especially that Steam Workshop link"

in turn, I appreciate you as a person who understands Arma3 scripting and wants to make such important improvements! I am ready to help you in any way I can!

So I have done more detailed tests in my old missions and I want to say that you are on the right way! I have been shot more often than usual, because with your mod the enemy AI infantry becomes more mobile and there the most unpredictable.
Units move faster and I (as a player) do not have time to keep track of them!

Good work!
ImmortalTheOwl  [author] Aug 6 @ 12:19pm 
I really appreciate all the testing and the detailed feedback,especially that Steam Workshop link, I’ll dive into it.

A few things I shall work on for the next build:

Use doorways as waypoints
Instead of treating every opening as an obstacle, I can probably try raycast in the four cardinal directions to detect valid gaps (doors, fence holes, etc.) and force the AI to path through those or thereabouts.

Maintain formation and stability
I’ll tweak the “stuck-check” logic so it only re-issues orders when a unit truly can’t move, and otherwise respects the group’s formation commands. That should stop units from dropping out or freezing.

Perhaps I could borrow proven techniques
I’ll examine the Workshop mod you shared for any smart routing tricks and ensure we don’t regress on preventing units from clipping through walls or fences.

Expect a test build soon, thanks again for sticking with this and helping me nail down the behaviour we'd want!
_mickey_ Aug 6 @ 12:06pm 
it says in your description - "ai avoiding terrain obstacles, cliffs, interior doorways"

should ai avoid doorways? i think not, it should use them!

Please try using the developments of this mod -
https://steamcommunity.com/sharedfiles/filedetails/?id=2904714255

I used this mod for a long time, but unfortunately this mod has two problems that made me quit it:
1) it does not work stably
2) it makes some AI units leave the formation and permanently lose the ability to move.

Maybe you can use it. Anyway, in 90% of cases the mod prevents AI from penetrating walls and fences, even other AI!
_mickey_ Aug 6 @ 11:58am 
Please try to describe what exactly the AI should do. How should it find its paths? Where to move? For example, if the battle is in urban conditions. Personally, what I don't like most is that in Arma3, the AI goes through walls and fences. It doesn't go around, but looks for ways through obstacles.
_mickey_ Aug 6 @ 11:55am 
Please note that I use LAMBS, with this mod the AI always additionally enters nearby buildings
_mickey_ Aug 6 @ 11:48am 
I sent 4 squads (2x2 opposite) at each other and gave them the SEEK AND DESTROY waypoint. It seemed to me that the squads became more mobile. They moved more, quickly entered and exited buildings, in general, they moved more often. Before, some units could stop and stand/lie in one place for a some time. When the squads were exhausted, the remaining units could enter a building and stay there forever. Now in your case, it seemed to me that they moved until the end, until they were destroyed or until they themselves destroyed all the opponents.
ImmortalTheOwl  [author] Aug 6 @ 11:15am 
The current update only applies to Infantry at the moment, once we're done testing and we're happy with the outcome of the infantry I can move onto vehicles.

Also what did you meant by that last part you mentioned 'do they move more and faster?'
_mickey_ Aug 6 @ 10:52am 
Now I've done some additional tests with infantry squads in the city. The only thing that seemed to me is that the units have become more mobile. With your mod they move more and faster?
_mickey_ Aug 6 @ 10:50am 
@ImmortalTheOwl so your updates only apply to ai-vehicles? am i right? or does it also apply to infantry units?
ImmortalTheOwl  [author] Aug 6 @ 10:43am 
The rest of the squad had no issues whatsoever pathfinding around stuff, so if I can get the squad leader to sorta do the same thing then it's happy days and I can try get the ai to pathfind across bridges n such before moving onto vehicles or possibly trying the interior stuff again.
ImmortalTheOwl  [author] Aug 6 @ 10:39am 
Oh right, I keep forgetting to add changelogs, whoops.
The recent update is on AI infantry and how they dynamically path find around obstacles, either preplaced in eden or placed live by the zeuses. My recent test shows a sorta 60/40 ratio that the ai will pathfind just fine, it was the squad leader who had problems initially.
_mickey_ Aug 6 @ 10:25am 
@ImmortalTheOwl I think you should describe in the mod description what functions each of your DEV versions adds. In this case, it will be clearer to test
_mickey_ Aug 6 @ 10:15am 
@ImmortalTheOwl I tried running 4 AI squads in urban environments. I also use Lambs Danger mod, I really hope they won't conflict
_mickey_ Aug 6 @ 10:12am 
@ImmortalTheOwl good day Bro!

Well, you have an achievement, for the first time I didn't encounter any errors!

However, I haven't seen anything special in the AI's behavior yet.
However, I looked into it, I only had one test.

Please describe what new behavior you added to the AI? What does the AI do that's new?
ImmortalTheOwl  [author] Aug 6 @ 7:03am 
Terribly sorry for the delay, I have updated the DEV branch with the dynamic pathing included in the smartmove script. I'm going to be testing this as well to make sure it'll all good and working.
ImmortalTheOwl  [author] Jul 28 @ 12:07pm 
Alright, next update which should be soon will focus on the dynamic pathing of the AI to more or less avoid obstacles being placed right in front of them on the fly. Hopefully, without them having to clip through stuff or do the arma thing and crawl under em. My apologies for the delays in getting these updates out. I appreciate your patience in all this.
ImmortalTheOwl  [author] Jul 23 @ 12:47pm 
@X_Wing_Ian It can be ran either way to be honest.
X_Wing_Ian Jul 23 @ 12:37pm 
Before the todays update I got the error from below, but this has been fixed with the latest update
8:30:29 Error in expression <nterval", 5]];

if (isNull _grp || _grp isEmpty) exitWith {};

_grp deleteWaypoi>
8:30:29 Error position: <isEmpty) exitWith {};

_grp deleteWaypoi>
8:30:29 Error Missing )
8:30:29 File AIPathfinderImprovementV2\scripts\fn_smartMove.sqf..., line 3
8:30:29 Error in expression <nterval", 5]];

if (isNull _grp || _grp isEmpty) exitWith {};

_grp deleteWaypoi>
8:30:29 Error position: <isEmpty) exitWith {};

_grp deleteWaypoi>
8:30:29 Error Missing )
8:30:29 File AIPathfinderImprovementV2\scripts\fn_smartMove.sqf..., line 3

But I am watching this mod very closely and excited to see where it goes
X_Wing_Ian Jul 23 @ 12:32pm 
Hello been testing this on ops and I don't see any errors on dedicated server now after loading the latest update, also should this be server mod line or regular mod line?. I put on the server mod line.
ImmortalTheOwl  [author] Jul 23 @ 9:55am 
I've updated the dev branch once again, I'm giving it one last chance before I ask for help from the discord server.

I've had to strip the hell out of the smartMove script on this one, and add a tiny init script to be used as a diag_log script.

If no errors persist, great, if it does, then I'll just do what I initial said I'd do.

The main focus for this is the pathfinding of infantry units to go around placed objects in eden or zeus.

I will be testing this as well so theres more than one report of... whatever it is that might be.
_mickey_ Jul 20 @ 3:56pm 
I tried to run it today

1:50:31 Error in expression <dd ((_targetPos vectorDiff _currentPos) vectorNormalized) vectorMultiply _obstac>
1:50:31 Error position: <vectorNormalized) vectorMultiply _obstac>
1:50:31 Error Missing )
1:50:31 File AIPathfinderImprovementV2\scripts\fn_smartMove.sqf..., line 22
1:50:31 Error in expression <dd ((_targetPos vectorDiff _currentPos) vectorNormalized) vectorMultiply _obstac>
1:50:31 Error position: <vectorNormalized) vectorMultiply _obstac>
1:50:31 Error Missing )
1:50:31 File AIPathfinderImprovementV2\scripts\fn_smartMove.sqf..., line 22
ImmortalTheOwl  [author] Jul 20 @ 7:49am 
The current dev branch update only affects AI infantry, so I don't think it should conflict with some of the other AI mods out there like vcom and vice versa.
HazeNoir Jul 19 @ 8:58pm 
Does this mod work with lambs?
HazeNoir Jul 19 @ 7:44am 
I see, thanks
ImmortalTheOwl  [author] Jul 19 @ 7:32am 
@HazeNoir I did make it so that newly spawned AI should also be affected after mission start. (or if not thats still the plan)

Now, if only I can get the AI to respond properly to objects being spawned in front of them on the fly. That would be ideal.
HazeNoir Jul 19 @ 5:46am 
Does this mod work with Impasse Total War? Since it spawn in unit during the match and I remembered seeing a comment about unit spawned mid match is not supported for now.
ImmortalTheOwl  [author] Jul 18 @ 4:57pm 
Now it's got the version with only smartMove in it that I spent the last couple days rewriting. And load and behold, line 22 missing ) error, I'm not even surprised.
ImmortalTheOwl  [author] Jul 18 @ 4:45pm 
Yeah I noticed the error as well so I reverted back to the previous version for now.
_mickey_ Jul 18 @ 2:59pm 
I posted the errors related to your mod in the corresponding topic
_mickey_ Jul 18 @ 2:55pm 
I don't even want to clutter up the chat, there are kilometer-long lines there
_mickey_ Jul 18 @ 2:53pm 
@ImmortalTheOwl bro, when I launch the game with your mod there are a bunch of errors again.
ImmortalTheOwl  [author] Jul 18 @ 11:23am 
annnnd script not found, whoops, lemme just fix that real quick.
ImmortalTheOwl  [author] Jul 18 @ 11:13am 
New DEV branch update available (read changelogs for details)
ImmortalTheOwl  [author] Jul 16 @ 10:45am 
@Astromad I'd say it is highly likely that the mod will interfere with ALIVE AI commanders, specifically regarding the waypoints ALIVE creates for AI groups, or even other mods that uses a similar function for waypoint creations.
Astromad Jul 15 @ 7:26pm 
Would this interfere with ALiVE AI commanders? As in the tasking way-points it creates for AI groups.
ImmortalTheOwl  [author] Jul 15 @ 3:35pm 
Any help whether that be improving the scripts so that they function and vice versa would also be greatly appreciated. ^v^
LuizBarros99 Jul 15 @ 3:13pm 
There is also this website that I found useful for debugging sqf scripts. Helped me a bit, I wonder if it could help you too
https://sqfvm.arma3.io/vm/
ImmortalTheOwl  [author] Jul 15 @ 2:40pm 
And reading the errors on there, I think I might know what it could be now. I'll adjust them and update the dev branch when its ready.
ImmortalTheOwl  [author] Jul 15 @ 2:37pm 
Yep, seems like that did the trick.
LuizBarros99 Jul 15 @ 2:36pm 
Yeah, check the advanced parameters section and the options in the launcher for anything related to error reporting (or even rtp file related). Maybe the problem could be there?