[AI] SEE_CREATURE and LookNeighbor

Blitzkrieg

Знающий
Участник
Сообщения
66
Розыгрыши
0
Решения
2
Репутация
38
Реакции
88
Баллы
403
Hi, I'd like to share my test results regarding see_creature handler and Lookneighbor () function and hopefully get some more input regarding their functionality.

Test: Change AI and type of NPC and check how it detects PC and another NPC (citizen). GF PTS.

Results

1) For Boss type NPC

Without LookNeighbor:
Boss detects PC (see_creature initialization) for radius = agro_range (npcdata parameter) and keeps detecting it even with the slightest PC movement. It will not detect PC if PC stops moving. NPC is not detected at all.

With LookNeighbor:
Boss detects PC (see_creature initialization) for radius = agro_range (npcdata parameter) and keeps detecting it even with the slightest PC movement.
It also spots immobile PC / NPC. This happens every 30 seconds and if you want it to work again you need to have LookNeighbor run continuously in a timer loop. Basically see_creature checks if lookneighbor has been executed and sets it to zero after execution.


2) For Warrior / citizen type NPC

Without LookNeighbor:
Warrior / citizen detects PC (see_creature handler) inside radius of ~ 400 (standard). In order to detect it again, PC must leave radius (move further away) and enter again.

With LookNeighbor:
See_creature handler is initialized (for ~ 400 standard radius) and it spots both PC / NPC. This happens every 30 seconds and if you want it to work again you need to have LookNeighbor run continuously in a timer loop.


Overall, I found no use of Lookneighbor argument (I initially thought it would be the radius that NPC is looking for other npcs). Whether I used 20 or 2000 values, I had the same results. This is further confirmed by the behavior of guards at gludio airship attacking zealot of silen. I spawned a zealot of silen outside of the broadcast range script (ai_fanatic_of_silen) to avoid alerting the guards. When the guard (ai_guard_of_airharbor1) got close, he ignored the zealot even though there is this code:
EventHandler NODE_ARRIVED (script_event_arg1, script_event_arg2) {
LookNeighbor (1000);
}

I believe this happened because of guard's bad timing ( 30 seconds expired and see_creature got initialized when he got out of 400 radius range, therefore he didn't attack zealot). I run this test more times and there were a few cases that he did attack, so it's indeed a timing thing.

 

Назад
Сверху Снизу