A Better Way For Random Spawns?

Hello (Devfourmers?) Not sure what to introduce with – anyways…

I’ve been developing a wave based game, similar to Killing Floor, for a few months now.
So far its been going great but my spawn system is kind of bugging me since it requires me to do alot of work.

There is a pool of maps to pick from and each map is required to be set up in a specific way before being used in-game.
One of these things are spawn nodes that tell my script where exactly it can spawn an enemy.

They are just parts that I copy paste around the map, but it takes quite a substantial amount of time for every map I wish to add. Not to mention my sloppiness when trying to rush through it has led to enemies spawning outside of the map on multiple occasions.


So, to try and speed it up i’ve been thinking of marking some areas as “floors” either through names or tags that allows enemies to spawn on top of those parts, and raycasting upwards to make sure that where they are trying to spawn doesn’t contain a part itself.

Something like this:


Before I dig my toes into this and spend a few hours making this, and then converting all of my maps to use this spawn method, I do have one question:

Should I follow through with this? Or is there a better solution that I haven’t come across yet?

This is a pretty good way to do it. You could also use a part to make an area that “rains” raycasts to choose random spawns, that way spawns are always on top of the highest part. You could use another part to mark areas where rain should be cancelled and the spawn should be re-drawn.

The approach Roblox used for SpawnLocations was to place players within an area determined by the spawn part’s position and size.

Another approach that could work is to distribute enemies evenly to every single possible spawn. Although this has some issues where the enemies might not spawn close to the player and the spawn order being deterministic. It could still be feasible depending on your game.