Adjust creature state machine to remove retreating state and instead:
if creature is isolated and player gets in aggro range, it just gets locked in place, not moving forwards or backwards, and keeps shooting the ranged attack, until player gets into melee range, then it goes immediately into defensive pose. When player gets out of ranged attack range it just goes back to idle/patrol.
if creature is grouped, and is of the ranged type, then it will also be locked in place and shoot ranged attacks, but now when the player gets in melee range it switches to the melee attacks instead of defensive pose. This creature will actually chase the player when it goes out of ranged attack range, but it will only chase until it’s back in ranged attack range (with some slight random offset), it won’t chase any closer than that.
then when creatures is grouped and of the melee type, it acts the same as currently, actively chases + attacks with melee at all times, unless getting to melee range is not possible (player on different platform) then it attacks with ranged
Also, when creatures is in Melee Attack state make it only able to change direction on the first tick of each melee attack.
Adjust creature state machine to remove retreating state and instead:
if creature is isolated and player gets in aggro range, it just gets locked in place, not moving forwards or backwards, and keeps shooting the ranged attack, until player gets into melee range, then it goes immediately into defensive pose. When player gets out of ranged attack range it just goes back to idle/patrol.
if creature is grouped, and is of the ranged type, then it will also be locked in place and shoot ranged attacks, but now when the player gets in melee range it switches to the melee attacks instead of defensive pose. This creature will actually chase the player when it goes out of ranged attack range, but it will only chase until it’s back in ranged attack range (with some slight random offset), it won’t chase any closer than that.
then when creatures is grouped and of the melee type, it acts the same as currently, actively chases + attacks with melee at all times, unless getting to melee range is not possible (player on different platform) then it attacks with ranged
Also, when creatures is in Melee Attack state make it only able to change direction on the first tick of each melee attack.