I'm trying to work out how Factions would work in any Standard MMO
If the player is hostile with a faction, then the NPC's of that faction would attack on sight.
If the player is neutral> with a faction, then the NPC's of that faction wouldn't attack on sight.
The "Reputation Value" would be an integer.
Hostile = 0 Unfriendly = 2000 Neutral = 4000 Friendly = 6000 Honored = 8000 Revered = 10000 Exalted = 12000
When the player Logs in. The Bandit faction must find out the Player's Reputation Value towards them.
if Player.Bandit.UNFRIENDLY or Player.Bandit.HOSTILE: the NPC would be able to attack the player on-sight. if Player.Bandit.NEUTRAL or FRIENDLY or HONORED or REVERED or EXALTED: the NPC won't be able to attack the player on-sight.
ReputationValue = Player.Bandit.Reputation if ReputationValue > 4000 the NPC won't be able to attack the player on-sight. else the NPC will be able to attack the player on-sight.
This is more complicated than it initially appears. Every player has a FactionList, and the FactionList ReputationValue can change potentially, multiple times per second.
For the player, it is relatively simple, they have a FactionList which contains the FactionName and FactionReputation for each Faction. Clientside, they can attack anything as long as it's 5999 or below.
But for the Enemy, Serverside. they need to check the players FactionList and not only for a single player, but for potentially hundreds of players.
For ANY entity to KNOW if they can or can't attack, they first NEED to know the SPECIFIC player's FactionList ReputationValue for their Faction.
the FactionList ReputationValue is a constantly changing value which must be obtained potentially every few seconds from Each Player.
How does this check work?
When is it performed?
How often is it performed?
I'm assuming Each Faction performs this check whenever a player logs in. Adding this players value to a list.
Performing this check as part of an Aggro-radius would be insanely inefficient.