# MMO - Server monster handling

Dabbling with basic MMO code because it intrigues me.

How does the server handle monsters / mobs?

I understand that generally on each game tick, the server loops through each player to send them updated positions of each other nearby player or mob.

So every player loop you're also looping through every other player but is it just standard to loop through the entire mob list too? I mean there could be 1000+ mobs idling around the game world/zone. Would this just slow the loops down?

I thought maybe they keep a seperate list of ACTIVE mobs, ones that are either near a player or are chasing a player, but that would still require looping the idle ones to check if a moving player comes near one. Unless the aggro loop is less frequent (thinking out loud here)..

Is there some tricks or common workarounds involved? Or is that just how they work?

• Thanks, that makes sense. So just split up the idle mob list into map chunks or something, and only loop through the parts where players are. For mobs that chase a player and end up outside of their zone would be in the active mob list anyway (until they lose focus if the player escapes, then... dunno) Feb 20, 2019 at 12:26