You need to split your World in multiple chunks. Each Chunk is a new Level, with NPCs, Enemies… etc
Now you need Level Streaming to generate a full world out of your chunks. Only Load visible Levels inside Player Radius. Unloaded Levels and theor NPCs won‘t consume resources.