--		debug.profilebegin("AI Offload Loop")

		local activate, deactivate = {}, {}
		local num = 0 
		for _,critter in next,workspace.Critters:GetChildren() do
			num = num + 1
			if critter.PrimaryPart and character and character.PrimaryPart then
				local distance = (character.PrimaryPart.Position - critter.PrimaryPart.Position).magnitude
				
				if distance < ACTIVATE_AI_RANGE then
					table.insert(activate, critter)
				else
					table.insert(deactivate, critter)
				end
			end
			
			if num % 10 == 0 then
				RS.Heartbeat:Wait()
			end
		end
		Rep.Relay.AI.AIUpdated:FireServer(activate, deactivate)
		elapsed = 0