Niagara Data Channel Conditional Read?

Hi,

Lately I’ve been experimenting with Niagara Data Channels and I had some questions about best practices. I was wondering if the Niagara Data Channel usage should be strictly “Spawn” -> “Read”? Is it possible to just read from the channel maybe with a new Read method (i.e. ReadConditional) that can read a specific entry in the channel that matches some condition, very much like SpawnConditional but without spawning anything?

The example scenario:

I have different pawns that write their data to a global data channel, in their currently used Niagara System i just need to retrieve the data that a specific Pawn wrote from game logic and use it however the Niagara System user wants.

Is spawning the particles via data channel a constraint of the technology or can this bypass be achieved? Perhaps am i missing something important for the proper use of the technology?

Many thanks,

Nicola

[Attachment Removed]

Hi,

Apologies for the delay.

Spawning via the Data Channels isn’t required.

You can just read data from the channel at any index you wish however the reader has no control over the contents of the channel so depending on what you want to do, things can get tricky.

You need to manage the writes and indices properly.

I think in your case, you could have a single place in game code/bp or a manager class etc that writes all your pawn data at once into the channel at the pawn’s index. The if the Niagara System for that pawn is given the same index via a user parameter then it can read that data from the channel.

Hope that helps.

Happy to assist further if you can give more detail about your use case.

Thanks,

Simon

[Attachment Removed]

Hi Simon,

Thank you for your response!

Unfortunately I have to keep the data channel write on the pawn side. Do you know if I can get the index of the write (for each pawn) in any way from the Writer or from some other API? Also can I be sure that the user parameter i read is always updated first before consuming the data from the data channel?

Right now, to bypass this potential issues i am using an ID shared by the system and the data channel, and used as condition for the SpawnConditional and later for the read. I was curious if a Read Conditional would be useful in the same way, but without being bound by the spawn with a data channel.

Thanks,

Nicola

[Attachment Removed]

HI.

Writing from separate code and BP doesn’t currently have a way to ensure the order of the resulting items in the NDC.

Nor do we currently have a read_conditional or a find() implementation. They would be useful I agree but currently there are no plans for them unfortunately.

So I think your best bet is to group the writes into some single manager logic. Why is that not viable?

Can you explain more about your use case and your workaround here.

[Attachment Removed]