Spawning NPC when the NPC Spawner is too far from any player, spawn doesn't happen

Summary

Spawning NPC when the NPC Spawner is too far from any player, the spawn doesn’t happen
At least one player needs to be close to it for the spawn to work

Please select what you are reporting on:

Creative

What Type of Bug are you experiencing?

AI

Steps to Reproduce

  • Position a NPC Spawner near the world origin
  • Create some way to verify if the NPC was spawned, either by using Verse print, teleport the NPC to the player after spawn or getting close to it)
  • Position a trigger to spawn the NPC somewhere very far from the world origin (not sure how far it must be yet)
  • Join the session alone
  • Interact with the trigger (The NPC will not spawn)

Expected Result

Spawn the NPC regardless there is a player close to the device or not

Observed Result

By joining the session with 2 players, and keeping one player close to the spawner device, when the other player triggers the spawn, it gonna work

Platform(s)

All

Island Code

8039-8238-9814

We didn’t test with default NPC, only with Custom. So not sure if it happens for both

Thank you for flagging! Reported to team to look into!

1 Like

The status of FORT-792250 incident has been moved from ‘Ready for QA’ to ‘Closed’. Resolution Reason: ‘Duplicate’

Also, what build version are you currently running? TY! Are you running on 31.30?

It happens in the current version on UEFN session. Our published map is not facing issues (Mainly because we made a workaround keeping all the spawners below the starting point and making sure the player will not move far from it until we spawn all required npcs), only the new feature we’re creating for it.
However it always has been an issue, since we started making the first tests with NPC few months ago

1 Like

Sounds like a fix was implemented for a similar issue before. Can you try to enable the new option on the NPC Character Navigation Modifier called `Always generate Navigation?’ This should help when NPCs are spawning too far away. Let us know if that helps!

1 Like

Sure, we’ll test and comment here the result! Thank you so much!

Awesome! Thank YOU

1 Like

First test:

  • Added the suggested solution as an Additional NPC Character Modifier directly into the NPC Spawner Device
    Result:
  • Spawn still doesn’t work when there is no player close to the spawner device
  • The video shows the spawn (The Big pet above the button the the cat right after it) working when a new player joins the session (which is close to where the NPC spawner is)

Second test:

  • Added the suggested solution directly inside the NPC Character
    Result:
  • Same as above

======================
The button that we use which triggers the spawn is at: (X=47974.831739,Y=19537.726690,Z=85.583008)

The Spawner is at: (X=-1348.298659,Y=671.624413,Z=-442.000101)

Currently we have streaming active, however the previous tests months ago, we didnt have it active, so not sure if currently it only happens with streaming on or not

Our streaming settings are:
(GridName=“MainGrid”,CellSize=9362,LoadingRange=7870.416992,bBlockOnSlowStreaming=False,Origin=(X=0.000000,Y=0.000000),Priority=0,DebugColor=(R=0.500000,G=0.500000,B=0.500000,A=1.000000),bClientOnlyVisible=False,HLODLayer=None)

2 Likes

Thanks so much for all the info and context! Sharing!

1 Like

Thank you!

Another thing that I’m not sure if changes anything in the result is that we call the Spawn() from verse and not using event binding. We can make a test if you think it can have different behavior

We have this same issue. We tested your suggested fix moments ago, but unfortunately it did not resolve the issue (just as another data point in a separate project from the tests above).

When requesting a Spawn to the device, if the NPC limit is not reached, the NPC will always spawn. The OnSpawned event was sent (up to 32.00) only when all the players in the relevancy bubble of the NPC confirmed its spawning locally on their machine. So if there was not players around, no OnSpawned event was sent - that is the issue you were seeing.

On 32.00, we have changed it to sent the event even if there is no player in the relevancy bubble at time of spawning.

Note that if you use Open World Streaming and you spawn an NPC where players are not there to stream in the level, you will have to make sure that the environment required for the NPC to behave is loaded.

Hi.
What do you mean with “you will have to make sure that the environment required for the NPC to behave is loaded.”?
That I need to have like at least a ground that is not spatially loaded below the spawner?

Thank you

We tried setting the ground below the spawners as Not spatially loaded but it still didn’t help. Still requiring a player to be close to it

Yes, that is what I meant

The fix will come in 32.00

3 Likes

Just stumbled on this too, Glad to see that its going to be fixed really soon, thank you!