Controlling the Narrative: Scalable Spawner by Diogo Vieira Avila


As we move along to version 0.0.2 of our game, we were able to set up a good deal of things, however an obvious feature was required. How would we be creating the spawn system for the game? This could be done in a simple way by creating an array of BP class references and using an actor to spawn them in the scene, or even circumventing the issue by preplacing the characters. None of these solutions are properly scalable with the vision of the project, ironically, even though we are Lazy Dev Studios, we put a lot of effort in our work! The challenge here is creating a spawner that is able to handle:

  • Able to handle dynamic combinations of BP Classes (different player and enemy groups and individuals)
  • Easily interact with current systems (able to provide references for inquiries regarding the spawned actors)
  • Limited dependency to minimize failure points

The first step to overcoming this was to come up how that Actor would be placed in the world. Since we are making a grid based combat game, the spawner places actors in the grid. As such it needs the grid to be created to work, therefore I made the decision to make the grid spawner also create the character spawner, that way I can guarantee that there wont be any access conflicts. 

With initialization being taken care of, the hardest part would be how would I make sure I can hold a lot of different kinds of information in an organized way, and easy to change and add to on the design part. Well it would be hard, if I hadn't been told Unreal Engine already has Data Tables available for use! This was a HUGE time saver for me, as after creating a custom "Character Sheet" struct, I just created two tables (enemy, and player) and loaded them on the character spawner. The spawner then proceeds to iterate through the rows, deferred spawning the actors, so their data can be initialized with data values, and later, storing their pointers.


Creating things this way will allow me to create a scalable system, as I will be able to potentially put different data tables, in lists, and parse through that, provide the AI Controller, and Player Character (which actually acts as a pseudo "possess by click" controller), with their available units for the combat encounter, however much they may be, along with any other references making dynamic combat events viable.

Get Project Banner

Leave a comment

Log in with itch.io to leave a comment.