Souls-Like AI Spawners


In this section I will show you how to setup souls-like spawners.
I will use Example Project there for implementation but you can do it on your project.
Before doing this tutorial, please firstly follow Implementation Video to get familiar with the system.

Goals

  • When player kills AI Character, it doesn't respawn
  • When player dies, all AI Characters are being respawned

In first step I will setup few Spawners - AI Class, Amount, StartSpawningMethod, SelectingSpawnPointsMethod is up to you, it can have any settings depending on your game.
It is only important to set RespawnMethod - Undefined there, it's because we don't want AI Characters to automatically respawn when it dies.
We only want to do it when player dies, thus we need to respawn them manually at that moment.

Of course in your level you will need to position spawners to match your level
in this example I placed them near to each other just as an example.

Now as a player when I kill AI Character from one of those spawners, it will not respawn
So we can kill them all and clear the level easily


To respawn all AI when players dies, we need to add this code to our player character blueprint in moment of his death.
This will force all spawners to be restarted bringing back all AI characters that were killed.


In example above we simply took all spawners in the level and resetted them
but we could also add a bit of logic to for example only reset spawners with some tag.

With such setup we can populate our world with AI characters that will be well optimized and behave like in Souls-Like games.