Niagara Data Channel unreliable

I find the Niagara data channel writer to be unreliable. It’s not writing to the data channel until I open the data channel asset and change any setting. After that it starts to work, but only until I change level or restart the editor. (see attached video)

If the niagara system gets disabled by a niagara effect type and reactivated it also stops working until you change something in the NDC asset.

[Attachment Removed]

Steps to Reproduce
Create a setup that use niagara data writer interface to spawn another system upon particle collision

For example:

[Image Removed]

[Image Removed]

[Image Removed]

[Image Removed]

create a new level and place the system in the map.

Notice that the append event is called, but no particles are emitter from the impact emitter.

Now, go in the NDC asset and change any option and put it back to what it was.

now the impact particles are emitted correctly.

Change level and it stops working again.

[Attachment Removed]

Hi,

Hmm that does look to be a bug somewhere. I’ll try to reproduce here but the fastest path would be if you can upload an example project that demonstrates the issues and I’ll take a look.

This is only in editor right? PIE or cooking this map works as expected or does that also fail?

Thanks,

Simon

[Attachment Removed]

[Attachment Removed]

HI, Sorry for the delay.

I’m going to put in a fix for the issue when a listener has completed while a writer holds onto the cell reference.

Incoming data will reactivate spawned systems.

You can locally apply to test if you need.

Replacing the map base tick with this.

I’ve placed this on a CVar so it can be toggled off if there is wider fallout.

void FNDCMapEntryBase::Tick(float DeltaTime, ETickingGroup TickGroup, FNiagaraWorldManager* OwningWorld, const FNDCMapKey& Key)
{
	if (Data)
	{
		const int32 NumPublishRequests = Data->ConsumePublishRequests(Owner, TickGroup);
		if (NDCMapLocal::bRestartCompletedReceivers && NumPublishRequests > 0 && Data->HasData())
		{
			// Writers can retain this entry after its receivers complete, so new data must wake them.
			for (UNiagaraComponent* Comp : SpawnedComponents)
			{
				if (::IsValid(Comp) && Comp->IsComplete())
				{
					Comp->Activate();
				}
			}
		}
	}
}

Let me know if this works for your cases.

Thanks,

Simon

[Attachment Removed]

Hey

Sorry for the delay. This just went in here.

https://github.com/EpicGames/UnrealEngine/commit/cade1f3f9a0fcf66ea4be5287e9a0c082c006388

[Attachment Removed]

Hi,

It doesn’t work in PIE either, I haven’t tested in builds, but I assumed it won’t.

I made a repro project, just drop the SYS_NDC_Caster in a new map and place it so the particles can detect collisions.

Nothing will happen upon collision, but if you open the NDC_Impact_Niagara asset and toggle off/on some parameters it will start to work.

Thanks!

[Attachment Removed]

[mention removed]​

Hi,

I think I found the issue, though it’s still a weird behavior.

If I use the global mode for the NDC and put the listener system in the map along with the writer it now works in a more reliable way.

I’m not sure if this is the expected way to use it?

Remaining issue is that if the system gets culled by an effect type, then it stops working forever in the editor mode, but it seems to work fine in PIE.

[Attachment Removed]

Hey Simon!

Do you have this checked in to your engine yet? If so can I get the change list so we could cherrypick it?

Thanks!

[Attachment Removed]