help with aggression

gabo-hanzo

Well-known member
Hello everyone!!! What is the ideal aggression for enemies? Since I adjusted 'range' and 'rangez' so that enemies hit accurately and do not hit the air, it has resulted in them taking a long time to throw a punch, giving the player an absurd advantage. I have researched it, but I'm not sure if I should include aggression or adjust something else. Thank you for your attention.

Example:
name williams
health 100
speed 8
type enemy
gfxshadow 1
diesound data/sounds/die0.wav
icon data/chars/williams/icon.gif
paingrab 1
noquake 1
running 10 3 2 1 0
subtype chase
aimove chasex
jumpheight 2.7


anim attack1
range 0 25
loop 0
delay 14
offset 55 111
rangez -7 7
bbox 47 77 19 34
frame data/chars/williams/a100.gif
delay 18
attack 59 81 18 8 8 0 0 0 0 7
frame data/chars/williams/a101.gif
attack 0 0 0 0
delay 14
frame data/chars/williams/a102.gif
attack 59 88 18 11 8 0 0 0 0 7
delay 18
frame data/chars/williams/a103.gif
delay 14
attack 0 0 0 0 0 0 0 0 0 0
frame data/chars/williams/a104.gif
attack 59 81 18 8 14 1 0 0 0 7
delay 25
frame data/chars/williams/a105.gif
delay 20
attack 0 0 0 0 0 0 0 0 0 0
frame data/chars/williams/wk2.gif
 
Hello everyone!!! What is the ideal aggression for enemies? Since I adjusted 'range' and 'rangez' so that enemies hit accurately and do not hit the air, it has resulted in them taking a long time to throw a punch, giving the player an absurd advantage. I have researched it, but I'm not sure if I should include aggression or adjust something else. Thank you for your attention.

Example:
name williams
health 100
speed 8
type enemy
gfxshadow 1
diesound data/sounds/die0.wav
icon data/chars/williams/icon.gif
paingrab 1
noquake 1
running 10 3 2 1 0
subtype chase
aimove chasex
jumpheight 2.7


anim attack1
range 0 25
loop 0
delay 14
offset 55 111
rangez -7 7
bbox 47 77 19 34
frame data/chars/williams/a100.gif
delay 18
attack 59 81 18 8 8 0 0 0 0 7
frame data/chars/williams/a101.gif
attack 0 0 0 0
delay 14
frame data/chars/williams/a102.gif
attack 59 88 18 11 8 0 0 0 0 7
delay 18
frame data/chars/williams/a103.gif
delay 14
attack 0 0 0 0 0 0 0 0 0 0
frame data/chars/williams/a104.gif
attack 59 81 18 8 14 1 0 0 0 7
delay 25
frame data/chars/williams/a105.gif
delay 20
attack 0 0 0 0 0 0 0 0 0 0
frame data/chars/williams/wk2.gif

IMO the ranges are a bit too tight. It’s definitely good practice to refine attack ranges - especially if enemies are swinging at nothing - but in this case, you've probably over-corrected. A 14-pixel Z-axis window (rangez -7 7) is very narrow. For comparison, the engine’s default is usually closer to a 30-pixel Z range, which gives enemies a lot more wiggle room to line up with the player.

Obviously, the goal isn’t to make enemies whiff like morons - but giving them slightly more range than their hit boxes can actually make them behave more realistically. The AI doesn’t have player-level awareness. It doesn’t anticipate, it just reacts when the numbers say it should. So when your detection windows are too strict, enemies hesitate, miss opportunities, or look passive - even if they’re right next to the player.

Widening the range a bit gives them breathing room. It lets the AI engage more decisively, which translates into smoother and more believable combat. Ironically, looser conditions often make enemies feel smarter, not dumber.

HTH,
DC
 
Thank you for these words, which can lead to a better understanding of enemy and NPC behavior.
It's indeed counterintuitive to validate areas where they would attack slightly from the side.
Perhaps it would also be a good idea to code attacks or movements that would break the distance between the enemy and the target so that they can more easily follow up with a proximity attack.
 
Back
Top Bottom