Hero AI won't ever be added to DZAI because of the following two reasons:
1. I disagree with the concept of friendly AI (so, I won't do it)
2. It's a technical impossibility if you want to do it 100% bug-free (so, I can't do it)
It is difficult enough to have AI selectively
not attack any units unless they're attacked, but if you want to complicate it by adding in arbitrary variables like humanity (a DayZ-only system that doesn't exist in Arma2), and then only a certain level of humanity, that's just not possible as far as I know.
Why isn't friendly AI possible? I'll try to give an explanation.
Suppose a player has -5000 humanity. If the AI side is set to be friendly to the player side, then the only way that you can have the AI attack the player is if the
addRating command was used to make the player hostile to everyone. This is what Sarge AI does if my understanding is correct.
The addRating command works to a certain degree - all AI will attack the -5000 humanity player. The problem that this causes is that the player is now (from Arma2's point of view) also hostile to
all players, so a low-humanity player and a high-humanity player won't be able to use the same vehicle. Sarge AI gets around this issue by creating a small trigger attached to every vehicle that reverses the addRating command's effects, reverting the hostile player's side back to the normal player side.
The problems with this method as I see it:
- On servers with numerous vehicles (hundreds or thousands), you have equally many tiny triggers attached to each vehicle. Each trigger constantly checks for players within its area every 0.5 seconds. So if you have 1000 vehicles on your server, you have 2000 checks for players per second.
- Players can simply escape from AI hostility by running to a vehicle.
- The fix doesn't always get applied to every single vehicle, especially if you have a large amount of vehicles. It also won't be applied to vehicles spawned after the game starts, for example: deployable bikes and other vehicles, Epoch vehicles bought at traders.
- A script needs to constantly check for nearby players and evaluate their humanity level. Too short of a search range means that friendly AI will be blind to a bandit player until the player kills one of the AI. Too long of a search range will be costing the server performance.
The other reason why I don't ever implement friendly AI is because players who want this
will never actually be satisfied. I've seen requests for Sarge AI like:
- I want some AI to attack players with x amount of humanity, and some other AI to attack players with y amount of humanity (Flat out impossible)
- I want AI to only attack players that don't have this playerUID (Possible, but constantly checking for both humanity and playerUID will have server performance effects)
- I don't want AI to be hostile in safezones or trader areas (I don't believe in the concept of safe zones in the zombie apocalypse)
- I want AI to do a funny tapdance with both thumbs up their butts (maybe not this one, but I won't be surprised if I see it eventually)