Make AI stand ground?

wokkelwakker

New Member
Hello,

First of all, DZAI works perfectly for me. I saw a big difference on the performance of my server since i switched from sarge to DZAI. And they seem to function very good too.

I also posted this as an idea, but i was wondering if it's possible to make certain custom static AI stand their ground, so i can make them fortify e.g. a base?

This would be a neat feature because it allows you to place them on top, and inside buildings.
 
I have sort of done this. I use setMarkerSize to a very small value like 5,5.

Example of a NEAF marker I have:

_this setMarkerShape "ELLIPSE";
_this setMarkerType "Empty";
_this setMarkerBrush "Solid";
_this setMarkerSize [5, 5];
_marker_21 = _this;
 
The AI in DZAI are intended to patrol a large area (100m+ radius) so super-small areas may cause very strange behaviors visually-speaking. In an upcoming update the AI will not be assigned any waypoints if their marker size is set to 1,1, but this will leave the AI staring straight in the same direction. The best solution for this would be to use a script to periodically change their facing direction instead of a patrol script, but there would have to be exceptions to combat situations (you don't want this to happen in a gunfight). I will be adding something to solve the direction issue as soon as I can find an efficient and performance-friendly solution.

Having AI precisely placed on/in buildings won't mesh nicely with DZAI units because the AI spawn function specifically avoids buildings or objects, and searches for the nearest empty space. This is necessary because it prevents static and dynamic AI from spawning on buildings then falling off or spawning wedged in a narrow space and becoming stuck.

If you need super-precise spawning control then it's far easier to write your own AI spawning script for your specific case. Doing this with DZAI is like using a jackhammer to perform brain surgery - far more trouble than it's worth. If you want AI situated on top of buildings you'll also need to disable their movement, otherwise they will likely move during combat and probably fall. DZAI's findKiller option (if enabled) doesn't help this in the least.

The problem with AI entering buildings is that the Arma2 AI has always been incredibly buggy when it comes to moving through buildings. If you've ever seen DayZ zombies or even DZAI AI units looking for loot piles in buildings you'll understand what I mean. They'll often get stuck or simply phase through walls, and sometimes completely ignore players who are right in their faces. The AI behavior script that Sarge AI uses has measures implemented to fix the "stuck" situations, but I highly doubt it would be server performance-friendly.
 
I tried Carp's method and placed one AI on top of a enterable building (set the marker on 2,2). As long as the AI didn't spot me, it would stay on top within the 2 meters and moving around a little. When it spotted me, as buttface said, the DZAI's findkiller function immediately took place, and the AI found it's way pretty quick out of the building (without glitching or dying, i was surprised!) and would then leave the marker zone.

Although this worked better than i expected, it isn't really what i'm looking for.
DayZ Origins has a good example on Salvation Island of what i'm trying to achieve. They have placed several AI on top of buildings, which do exactly what you want to solve (the direction issue): They stay at the same exact position, and each x seconds change their facing direction to scan for players. These AI would also never leave their place, since some of them were placed on high & not enterable buildings.

I know the AI, most of the time, don't work properly within buildings. DayZ Origins Secret lab is a good example of this. While the AI on salvation island were badasses, the ones in the lab were (most of the time) complete idiots.

I don't have a lot of scripting experience with the ARMA 2 engine, but i'm learning. I'm looking forward to the changes you're gonna make in the upcoming update, and in the meantime i will spawn in custom AI to try some functions like disableAI "MOVE" etc.

Thanks for your reply.
 
Back
Top