I will note that while this will work in PvP, it may not be practical.
We used to have purges spawn in our build, but after a significant amount of testing on a private server, we figured out the pathing system.
Now, when we get a purge at our main base, we open the gates and keep them open. The spawns occur outside, and they make their way to the gates. It has worked at every build without fail.
People who build on top of plateaus or rock formations consistantly get spawns in or on top of their bases. We countered that with a big access staircase (Not PvP friendly), and the spawns have started in the valley ever since.
You can disagree with me if you wish, but I have 3 years and forty plus purges that say this works.