at the start of development i used boids for the enemy movement which didnt cause lag but when i added walls the enemies didnt avoid them so i had to switch to pathfinding... which is really laggy when u have more than 50 - 100 enemies