For the complete documentation index, see llms.txt. This page is also available as Markdown.

Spawning NPCs

Let's talk about placing characters onto a map. Each Bitpart archetype comes with their own character blueprint, which can be found within it's folder structure in the content browser. You can also use your own!

Table of Contents

What is a Spawn Target?

Spawn Targets are the assets we've created for our own spawn system. If you have your own spawn system, then you do not need to use ours.

  • BP_BitpartTargetPoint (found in the Content Browser under All → Plugins → Bitpart.AI Content → StarterPack → Blueprint) should be placed in your level at the location and rotation you want the NPC to be spawned. It should be the NPC's half capsule height above the floor, which in our case is 88 units

    • Once you have the spawn target in place, you'll need to specify which character spawns there using the cast spawner.

What is a Cast Spawner?

A cast spawner in a level

Cast spawners allow you to manage which NPCs are in a cast and where in the level they spawn. A cast, for those wondering, is a group of characters that will perform behaviors together or interact with each other. It's possible for a single character to be in a cast by themselves, but the purpose is generally to interact with other NPCs.

You'll use one cast spawner for every cast you want to add to your level. We'll speak to how exactly you would set-up a cast spawner in the Adding a Bitpart Character into a Level section below.

We also have a more in-depth dive into casts that you can read here.

Adding a Bitpart Character into a Level

There are two different ways to add a character into your level. You can either spawn them in dynamically or place them directly onto the map.

Spawning directly refers to the process by which characters spawn into the map when/where you want them to. Direct placement does not require a spawning and system and entails placing your desired character onto the map prior to runtime.

At a high level, these are the steps that go into both if you're using Bitpart's spawning system:

If spawning dynamically...

  1. Create character blueprint(s)

  2. Add the SpawnTarget to the map

  3. Add the CastSpawner

If adding character directly...

  1. Create character blueprint(s)

  2. Drag the character blueprint(s) onto your map

  3. Add the CastSpawner

Let's dig deeper and walk through both in full.

Spawning Dynamically

  1. Choose the character you'd like to add to the level. Each archetype has its own character blueprint found within it's folder structure in the content browser. If you'd prefer to use a pre-existing character of yours, you can turn it into a Bitpart character following these instructions.

  1. Add the SpawnTarget to the map.

    1. Search for BP_BitpartTargetPoint in the Content Browser. Place it in your level at the location and rotation you want the NPC to be spawned. It should be the NPC's half capsule height above the floor, which in our case is 88 units

  1. Add the CastSpawner to the map.

    1. Search for BP_CastSpawner in the Content Browser. Drag the spawner onto your map.

  • Navigate to the Details panel, and under the first Cast Spawner section add a new element. There are two fields to fill out. Here's what they are and why you would use them:

    • Specific for dynamic spawning:

      • PawnClass | select the character blueprint of the character you'd like added to the cast

      • SpawnPointActor | select the spawn target associated with your character

    • There is an optional Tags field in this section. You can use this to attach a gameplay tag to an NPC spawned at this particular target point. You can see an example of how to use this in our tutorial on Triggering Tasks via Blueprints. [MAKE THIS A LINK]

  • If you want a cast to be planned into as soon as it finishes spawning, make sure Start Planner for Cast under the second Cast Spawner section is toggled on

  • If you want this cast to be the cast that the player starts in then check on Player Initial Cast

To learn more about some of the other notable features found in the cast spawner, check out this segment of our documentation.

Adding a Character Directly

  1. Choose the character you'd like to add to the level. Each archetype has its own character blueprint found within it's folder structure in the content browser. If you'd prefer to use a pre-existing character, you can turn it into a Bitpart character following these instructions.

  2. Place the character onto your map.

  3. Add the CastSpawner to the map.

    • BP_CastSpawner (found in the Content Browser) is an example spawner. If you have your own spawning system for your game then you can use that instead. We'll be using BP_CastSpawner for this tutorial.

    • Drag the cast spawner onto your map

Specific for direct placement:

  • PawnPlacement | reference the placed NPC instance in this field

  • If you want a cast to be planned into as soon as it finishes spawning, make sure Start Planner for Cast under the second Cast Spawner section is toggled on

  • There is an optional Tags field in this section. You can use this to attach a gameplay tag to an NPC spawned at this particular target point. You can see an example of how to use this in our tutorial on Triggering Tasks via Blueprints. [MAKE THIS A LINK]

When would you not a cast to be planned into as soon as it finishes spawning? Glad you asked! Mainly if you To learn more about some of the other notable features found in the cast spawner, check out this segment of our documentation.

Adding Multiple Bitpart Characters to a Map

Every Bitpart reference map is set-up with only a single archetype, but they are meant to be integrated into your gameplay, which means operating alongside other archetypes. At a very high-level the process looks like this:

  1. Add a new Spawn Target to your map

  2. Add the character to a cast

For a more detailed step-by-step
  • Add another spawn target to your map. Instructions can be found here, if needed. This will be where the new character will appear once you start the level.

  • In order for the new archetype to appear here, we need to add the character to a cast.

    • If you don't want the characters to interact with each other, you'll need to place another cast spawner (instructions found here) in order to create a new cast.

  • If you do want the characters to interact with each other, then you'll want to add a new element to your existing cast spawner. Click on the spawner and navigate to the details panel. Add a new array element. Fill out the fields for the new element. As a reminder, they are as follows:

    • If you're spawning dynamically...

      • PawnClass | select the character blueprint of the character you'd like added to the cast

      • SpawnPointActor | select the spawn target associated with your character

      • If you want characters placed directly...

        • PawnPlacement | reference the placed NPC instance in this field. Ignore this field if PawnClass is used

  • You're good to go! Don't forget to save your changes.

Last updated