Resolved Custom Mob Faction AI: Mob vs. Mob & Priority Targeting Player

fa1thDEV

Baron
Customer
Hello everyone,

I'm trying to create a custom AI for an instanced event that involves two opposing teams of mobs, but I'm struggling with the logic and could use some guidance.

The Goal:

I want to create two opposing factions of mobs (let's call them Team A and Team B). The desired behavior for their AI is as follows:

Mob vs. Mob Aggro: Mobs from Team A should automatically attack mobs from Team B when they are in range, and vice-versa. They should see each other as enemies.

Player Priority Targeting: If a mob from Team A sees a player from the enemy team, it should prioritize attacking the player over any enemy mobs in the area.

Return to Mob Combat: After the enemy player is killed or leaves their aggro range, the mob should resume fighting against the enemy mobs (Team B).

The Problem:

I am having trouble figuring out the best way to implement this logic. I'm not sure how to make mobs recognize other mobs as valid targets based on a faction or team, and how to create a targeting priority that prefers enemy players over enemy mobs. There are forum posts that discuss making mobs fight each other, but the specifics of implementing it are unclear.

Is there a way to manage the AI's target priority list to always focus on players first?,
Any code snippets, links to relevant guides, or even just logical pseudo-code would be incredibly helpful.
 
Last edited:
У мобов есть фракции тебе надо всех мобов разделить на разные фракции и в ии это прописать поведение
По сути ты сам и ответил на свой вопрос.
 
As Roysylik said. You have already some examples like mobs with aggro range, you can add extension like <faction name="queen_ant_clan" range="1000"/> (already in core) you can make your own for attacking other mobs/players. You can check Ketra Orcs ↔ Varka Silenos: hostile factions;
or better check the guards they also attack mobs. I am unable to provide you with code today bcs I'm finishing the dressme for weapons/accessories for interlude.
 
As Roysylik said. You have already some examples like mobs with aggro range, you can add extension like <faction name="queen_ant_clan" range="1000"/> (already in core) you can make your own for attacking other mobs/players. You can check Ketra Orcs ↔ Varka Silenos: hostile factions;
or better check the guards they also attack mobs. I am unable to provide you with code today bcs I'm finishing the dressme for weapons/accessories for interlude.
The guards not attack mobs, I test it, only karma players
 
The guards not attack mobs, I test it, only karma players
I’m not sure if this will help, but a few days ago, players “faked” the Baium fight — everyone died, and then the angels started attacking Baium, and Baium fought back. The angels ended up killing him.


It seems that when players are inside, the angels target the players, but when no players are present, they turn on Baium instead.
 
I’m not sure if this will help, but a few days ago, players “faked” the Baium fight — everyone died, and then the angels started attacking Baium, and Baium fought back. The angels ended up killing him.


It seems that when players are inside, the angels target the players, but when no players are present, they turn on Baium instead.
Acredito que seja o contrário, o Baium ataca os anjos se não tiver players, e eles revidam. Deve ser por causa de algum parâmetro de IA dele.
 
Acredito que seja o contrário, o Baium ataca os anjos se não tiver players, e eles revidam. Deve ser por causa de algum parâmetro de IA dele.
ai eu não reparei mas tem essa função. Apenas notei que eles se atacam
 
Back
Top