I want to spawn some monsters using UE Blueprints.
Within a single area, three types of monsters can spawn, with adjustable quantities for each. Each spawn point must be at least 2 meters apart, and only on a flat plane.
Advanced:
If spawning across three areas, can I randomly select one area for monster spawns by adding a random number sequence?
If using a switch to trigger monster spawning, would adding a box collision with E-key interaction and setting a Boolean variable MonsterSpawn to True?
First, set the monsters’ number and types, and the area in which they are.
Then check the distance between the two monsters in the loop.
Finally, after the loop is completed, monsters spawn in the area.
Are there any logical issues? What aspects can be simplified or require attention?
I don’t see any issues with your logic. It shoudl work perfectly as you planned it.
The only suggestion I would make is that you use two actors for this system: a “Monster Spawner” and a “Spawner Manager.”
Monster Spawner: this actor will define the Spawn Area and the monster types that can spawn in that zone.
Spawner Manager: this actor will have references to all the Monster Spawners to randomly choose which one will be triggered and how many monster it will spawn at the same time.
This approach will give you a lot of flexibility, allowing you to customize different areas with different monsters or different spawn chances if you want.
Let me know if you need more detailed help when you start to implement it!
I had issues with randomly spawning monsters. Since randomness is computed, it’s not truly random. i think it’s called pseudo-random.
In my case, the spawn locations started repeating the same pseudo-random sequence after every reboot (or maybe after restarting the editor, I don’t quite remember).
I’m not entirely sure how Unreal handles randomness. Maybe someone else can elaborate on that. Still, using a seed is something you might want to consider regardless.
You can do all this with one Actor. Use billboard components as the spawn points.
Drop the actor in the level, doesn’t matter where.
Select it, then select a spawn point (billboard component), move the point to a spawn location. Do the same for the others.