Encounter Manager

This walkthrough spotlights how a multi-component system can mix-and-match ways to create exciting Encounters and re-use the basic framework to layer on new Encounters.  This would ideally support live updates after release.

Parts

Encounter_Manager To orchestrate tactics of an Encounter.
Spawn_Controller To track the nuts-n-bolts of spawning lots of things from lots of locations.
Spawn_Point To describe a specific location where something is spawned.
Spawn_Profile To describe single or multiple NPC types to spawn, one source to update all places it’s used.
AMP_Component To package Animation and Interaction at any one location.
World_State_Manager To store variables, recall variables, and pick the right variable for the moment.

It’s worth noting these spawn systems shouldn’t be limited to NPCs.  They can be developed to support a variety of Actor types for things like specific player resources or random vegetation and props that change over the course of the game story.

thumbnail

Step 1

Anything can be spawned in game using only a Spawn Point (using a Spawn Radius or Volume if an exact location isn’t needed).  The Spawn Point contains a lot of conditions like how far away does the player have to be for it spawn or how many actors can appear here before depleted.

A Spawn Controller is a way to group all those locations under one director.  The Controller can then declare who will appear in any of those locations, track everyone’s life and death, and override any of the Spawn Point location settings if needed.

thumbnail

So where are the Spawn Points in this example above?  If you don’t need to change the default values at each location in the Game Map, then they don’t need to appear in the logic set-up other than linking them.

Here’s a topdown layout of a Wasteland area with a Spawn Controller reference showing links to each Spawn Point.

thumbnail

thumbnail

Use the built-in Radius on the Spawn Controller to decide when any of these locations can spawn AI.  Volumes can be used for more precision.

Step 2

What was declared above in the Spawn Controller is directly linked to an Actor Type.  This burns it into the game space and will only create that one AI Type for the whole game.  A Spawn Profile is an external wrapper declaring who the Actor Types are.  Using these means we can change any place this Profile is used without having to touch every Spawner in every level to find the right ones to update.

Each Spawner has a Pawn Label field to track any actors created from it.  This can be used to script group actions or listen for changes to any of the actors spawned.

thumbnail

If an NPC is spawned with nothing to do, it’ll simply cycle through its idle animations waiting for something to happen.  Adding AMPs to a scene give the NPCs something to do.  They can be assigned to specific NPCs by Type or from what Spawn Point it came from.

AMP (Action Motion Point) A spot in the game where NPCs or players can play a specific idle or series of actions. Sometimes called Smart Object

thumbnail

thumbnail

Step 3

A Spawn Controller is a raw group effort that leans on AI Behaviors to decide how NPCs act.  When you want specific gameplay at certain times in an Encounter, use the Encounter Manager to orchestrate how to use things spawned.  Encounter Managers can change anything found on existing Spawners.  Not embedding the Spawn information into a Encounter Manager means other Encounter Managers can use the Spawner’s information a designer has shaped to the local environment.

thumbnail

In the above image the Encounter Manager is changing the default Spawn Profile to use the Blood Baron Faction for a specific Chapter in the game story.  It also calls out its Scenario Name to help script messages to and from it.

In the game map below, a Encounter Manager reference has been added and linked to the Spawn Controller as a visual cue and shortcut to the Blueprint.  If desired, the Encounter Manager’s radius can be used to override the activation distance to trigger and despawn the Encounter.

Step 4

For variety, let’s add a couple NPC civilians.  These are non-combat AI types to show the world is alive beyond combatants. A new Spawn Controller is added to the map and script logic.  It takes over 2 existing Spawners used by the first Spawn Controller.  New Spawn Points could be added.  It’s less risky to use existing ones that have already been balanced to the area and other templated situations (like Prop Set Spawning … which isn’t discussed here yet).

thumbnail

thumbnail

The NPC count in the Encounter Manager has be increased from 4 to 6 to account for the the 2 new civilians.  A civilian Spawn Profile has been used.  The new controller has been given a group name for actors created from it.  A reference to it has been added to the map.

Step 5

All that sets the stage for what the player could see when he enters the area.  To then decide how they’ll react beyond basic behaviors, we add a second Encounter Manager to describe Phase 2.  Each Phase acts like an event in the encounter’s timeline.

thumbnail

Below we’ve added another Encounter Manager.  We’ve updated the group names to show which Phase they are.  Both Encounter Managers can use the Spawn Controllers when active. Scenarios can span multiple combat areas.  Phase 3 could use Spawners from this area and a separate new area.  For this example, everything takes place in the same arena.

When the NPCs spot the Player the Phase 2 Tactics kick-in.  The immediate response is watching the civilians flee for cover.

thumbnail

thumbnail

The group names for Encounter Managers and Spawners are used by external systems such as the World State Manager.  The WSM is how we’ll handle despawning and re-populating an Encounter.

thumbnail

Step 6

How’s the Faction Leader going to react to this?  He’s been scripted to become exclusive owner of AMP 4 which overlooks the area.  This triggers him to run to the overlook.

thumbnail

thumbnail

Step 7

What to do with the rest of the Blood Baron Faction?  In this example half of them have been told to defend their base on the east side.  The other half have been told to fight from the north or south entries depending on where the player entered the area.

thumbnail

thumbnail

 

Final Thoughts

Developing Spawn Systems that can be re-purposed depending on the Encounter, World State, or even Actor Type creates a flexible way to quickly create fun encounters.

  • This means less time recreating a baseline infrastructure and local placement balance.
  • More easy to track and change values without having to touch every instance of things in every map (including maps you might not know about!).
  • It lays the groundwork for easily balancing and updating the game afterits been released!