#How would I create an NPC System

1 messages · Page 1 of 1 (latest)

ocean ether
#

Yes, I have coding experience. I'm not a newbie asking how to code an entire system

I have almost everything for the Mob completed, one of the things I don't is a Follow & Damaging Method.

Since I do plan for this to be an RPG, I would prefer to not have loops constantly checking in a Player is close enough to an Enemy since there will a high quantity of Enemies in a game. I settled on the idea that I'd make it so when a Player Joins, there'd be a loop applied to them instead, this way, there's only be loops for the number of players In-game.

The thing is, I have no clue how to do this. This is how I'm currently doing things but with this, everything is ran on the server and I'd like to keep it that way. Here are some problems that arise:

  • The Enemy Walks Into Players
  • If an Enemy is already following a Player, the Player will have to get closer to another Enemy than the one following it for that newEnemy to follow
frail lion