- Thread starter
- Admin
- #251
That is VERY odd... What they do on my test map, is run around like mad trying to find a way to get to you. After about 20 seconds of that, they give up and clear their targets (go back into wander mode until they see another enemy, or spot you again.)
Meh, I won't get another chance to work on this until the 28th (alien kidnapping), which is dangerously close to the release date, and I've got several critical things to add which I've not yet done. :\
Two things I've added but may not have the chance to test:
This is added to huntcycle when NPCATK_TARGET is set (ie. monster has a target). Downside is that it is yet another conditional added to this hunt cycle. (more conditionals in hunt cycle = more lag) But, in short, it ensures that a closer enemy will always be favored, if it can see one.
Also (in game_struck - PARAM1 = incoming damage):
This is similar to the old AI's method of frustration check. NPC_FRUSTRATION resets each time the monster manages to make an attack against the opponent. NPC_FRUST_THRESHOLD defaults to 10. Meaning if the monster is struck for more than 4% of it's HP (default FLINCH_DAMAGE_THRESHOLD ), more than 10 times without making any return attacks, it will run away in an attempt to acquire a new target or a better position on its existing target. (I use the flinch damage threshold so things like poison or burn damage don't make the monster go running mad, lest it's so weak and the damage so strong that it really should be doing so anyways.)
Meh, I won't get another chance to work on this until the 28th (alien kidnapping), which is dangerously close to the release date, and I've got several critical things to add which I've not yet done. :\
Two things I've added but may not have the chance to test:
Code:
if ( $cansee(enemy) )
{
if $get(ent_lastseen,id) != NPCATK_TARGET
if $get(ent_lastseen,range) < $get(NPCATK_TARGET,range)
dbg temp MONSTER_ID Changeing target in favor of closer
callevent npcatk_settarget $get(ent_lastseen,id) "change_in_favor_of_closer"
}
Also (in game_struck - PARAM1 = incoming damage):
Code:
if ( PARAM1 > FLINCH_DAMAGE_THRESHOLD )
{
add NPC_FRUSTRATION 1
dbg temp MONSTER_ID Frustration NPC_FRUSTRATION
}
if ( NPC_FRUSTRATION > NPC_FRUST_THRESHOLD )
{
//hit too many times without hitting back
dbg temp MONSTER_ID Fleeing from frustation
callevent npcatk_flee $get(ent_laststruck,id) 2000 10.0
setvard NPC_FRUSTRATION 0
}
This is similar to the old AI's method of frustration check. NPC_FRUSTRATION resets each time the monster manages to make an attack against the opponent. NPC_FRUST_THRESHOLD defaults to 10. Meaning if the monster is struck for more than 4% of it's HP (default FLINCH_DAMAGE_THRESHOLD ), more than 10 times without making any return attacks, it will run away in an attempt to acquire a new target or a better position on its existing target. (I use the flinch damage threshold so things like poison or burn damage don't make the monster go running mad, lest it's so weak and the damage so strong that it really should be doing so anyways.)