NPC can be divided into two kinds: the simple NPC and the intelligent NPC, the two kinds of NPC's processing logic is different.
The difference between the two NPC is whether the NPC AI script exists.
The simple NPC does not have AI scripts, only the NPC moves, the simple response of the attack.
The smart NPC is controlled by AI scripts.
From the processing logic, the simple NPC does not need independent AI processing, and the intelligent NPC has an independent AI loop.
The intelligent NPC is an intelligent creature that responds to the game world when it is the same as the persona.
A simple NPC has the same treatment as an object, just some data, and if no intelligent creature can perceive them,
They do not need to exist and do not need to be processed by the game Master loop.
When the perceptual regions of intelligent organisms contain simple NPC, they are instantiated.
For example, two smart NPC will attack each other, regardless of whether there is a person looking around,
The server is always handling their movements and attacks.
And simple NPCs do not exist if there is no intelligent biological observation around them,
The server does not need to handle a simple NPC that does not have to be aware.
Intelligent NPC requires Game Master loop processing, should minimize quantity.
If the behavior of the smart NPC is OK and does not need to be handled at all times, it should be converted to a simple NPC.
For example, the gyrus of the NPC is determined, and the amount of T1 time is known, so when it enters the role perception at T2 time,
The amount of blood can be calculated from the time difference, not necessarily in the t1-t2 period
There is no need to think of it as a smart NPC for computing gyrus.
If the NPC can eat red drug gyrus under AI script control, the server cannot predict the gyrus amount,
The NPC is a smart NPC and must be handled at all times.
(Jin Qing's column)