Board Thread:Suggestions forum/@comment-26172435-20160113120843

Objective
Encourage realistic player and NPC behaviour -> Discourage 'cheating' through grinding (position yourself as to enable hitting enemies without them not being able to hit you) -> Reduce success rate of NPCs running into grinding traps ->

1. Improve chance of NPCs recognizing they cannot hit the player while they are being hit (before they get killed).

2. Make NPCs realize they have suffered near-lethal injury and retreat and rest will improve their chances of recovery.

3. Make NPCs retreat to safe distance and stay there to recover before they re-engage in combat (or follow their leader: hired NPCs).

Assumptions
The experience orb system will remain the main source of experience, whatever the new enchantment (, smithing and/or trait) system may entail.

I assume that the grinding mechanism in itself is contradictory to the gameplay objectives as laid out in the mod and the official server set-up and rules. I hope this helps in achieving these objectives, but I do realize many players are rather used to grinding a lot, so quite a few won't be in favour of this or even start a little rant against this. :)

Background info / references
Following through on a discussion we had in this thread, I listed a number of possible measures to discourage grinding behaviour. When reconsidering the mechanism of grinding (see definition above), I realized the most effective measure will be to improve the NPC AI. Apparently it is possible to make ranged unit NPCs flee when they realize they're running danger ... so, it should also be possible with all vanilla MC coding options at hand, to code for AI that covers the 3 objected AI functionalities mentioned above.

I did a bit of research for earlier suggestions related to this, and found these: flee from mortal danger, take some time to heal and nothing more really. So I assume this aspect hasn't been thoroughly touched upon (at least publicly) before.

Additional specifications
Not all NPCS should obey the basic AI to avoid mortal danger. I propose to have any mounts and Berserker type units ignore these AI rules. It may also be considered to let NPCs that have strength and speed potion effects ignore them, until the effect is removed. As a general rule I propose to let NPCs retreat when their health level is at or below 6 hp. This parameter value may also be unit dependent.

When an NPC realizes it cannot hit a player (whether from melee strikes or ranged attempts), after completing a path-finding routine towards the player, the NPC should retreat to a position at a safe distance. When they reach a safe position (distance), a cooldown will start and dependent on the NPC type, they may start a new attempt to kill the player when they are partially or fully healed or after a certain cooldown time has ended. As a general rule I propose that heavy armored, high hp and/or generally unintelligent units will resume an attempt after they have either partially healed (up to 80% of full health) or when they are fully healed. Weak units and 'smarter' units like villagers should only resume an attack after a serious cooldown period (and when the player is still within range, of course).

The proposed AI will not be effective against players that are able to prevent NPCs from getting any hit chance against them. Therefore, in line with the measures proposed on enchantments here, I wish to stress the relevance of disabling a number of high level enchantments like Infinity and Knockback III or higher. Of course, this will depend on the system that will ultimately be adopted and implemented for enchanting anyway, of which we can still only speculate.

In case of hired units blindly following their leader, but ending up with lethal injury through fall damage, suffocation, burns, etcetera, they should simply obey the rule to simply 'stay put' until they have healed to full health. After full recovery they can resume to follow their ignorant leader.

Considerations
I had a quick look at some relevant AI currently in the mod and it seems to me the way the mod is set up should easily allow for addition of well thought-through AI rules. I realize the amount of work to code for this may not be the most appealing aspect of this improvement option, but would like to point out the opportunity of having the community assist in this by providing possible draft code formulations during the conceptual design process. I'm sure there's dozens of players out there with either command block or java experience who can easily prepare a draft concept of the sequence of checks, conditions and actions to be included in this.

Now shoot folks! (be gentle)

I will improve this OP as my own insight progresses and based on any constructive feedback/criticism. 