Niagara Systems Always Recompiling In Editor

I’ve been trying out Niagara and for the most part it works great! However, whenever I launch the editor, it has to recompile all my systems, even if they have not changed and the game source code has not changed. That means I have to run through whatever I’m trying to test twice, once to trigger everything to compile and then once after the VFX are ready.

It looks like it’s trying to compare things against a cache, but never gets a hit. In the debugger, NiagaraScript::AreScriptAndSourceSynchronized() is returning false for everything.

Is this normal?

Sample of logs:

[2019.05.05-01.06.32:167][  0]LogNiagaraEditor: OpNode Boolean::LogicAnd, Package /Niagara/Functions/System/SystemChangeState: reallocated existing pins to add new extension pin
[2019.05.05-01.06.32:167][  0]LogNiagaraEditor: OpNode Boolean::LogicAnd, Package /Niagara/Modules/System/SystemLifeCycle: reallocated existing pins to add new extension pin
[2019.05.05-01.06.32:171][  0]LogNiagara: AreScriptAndSourceSynchronized reference id 2 doesn't match. 273125784D49144FF7772483435FFD51 != BB8F240149222D314E52D68B0B720EB1, source /Niagara/Modules/Emitter/EmitterLifeCycle.EmitterLifeCycle:NiagaraScriptSource_0.NiagaraGraph_0
[2019.05.05-01.06.32:172][  0]LogNiagara: AreScriptAndSourceSynchronized reference id 3 doesn't match. 638487F74E3E3A7FFA10D680EE0BB138 != A49D05054EC85BB83EEE57AEFC2340FA, source /Niagara/Functions/Emitter/EmitterChangeState.EmitterChangeState:NiagaraScriptSource_0.NiagaraGraph_0
[2019.05.05-01.06.32:172][  0]LogNiagara: AreScriptAndSourceSynchronized reference id 4 doesn't match. 638487F74E3E3A7FFA10D680EE0BB138 != A49D05054EC85BB83EEE57AEFC2340FA, source /Niagara/Functions/Emitter/EmitterChangeState.EmitterChangeState:NiagaraScriptSource_0.NiagaraGraph_0
[2019.05.05-01.06.32:172][  0]LogNiagara: AreScriptAndSourceSynchronized reference id 5 doesn't match. 638487F74E3E3A7FFA10D680EE0BB138 != A49D05054EC85BB83EEE57AEFC2340FA, source /Niagara/Functions/Emitter/EmitterChangeState.EmitterChangeState:NiagaraScriptSource_0.NiagaraGraph_0
[2019.05.05-01.06.32:172][  0]LogNiagara: AreScriptAndSourceSynchronized reference id 6 doesn't match. 638487F74E3E3A7FFA10D680EE0BB138 != A49D05054EC85BB83EEE57AEFC2340FA, source /Niagara/Functions/Emitter/EmitterChangeState.EmitterChangeState:NiagaraScriptSource_0.NiagaraGraph_0

We’ve fixed these recompile issues, but unfortunately these fixes didn’t make the 4.22 release and will be in 4.23. If you’d like these changes sooner you can download the most recent changes from our Dev-Niagara development stream if you’re building from source.

Thanks, good to know!

Hi, it took me some time to find it:

Commit d9fd5515 by Frank Fella, 04/04/2019 10:06 PM “Niagara - Fix constant recompiling.”

I am cherry-picking this on top of UE4.22.3

There are actually several changes which are necessary to fix this completely, they are 4898277, 4974092, 4977660, 5271690, 5748275, 6087261, 6093788, and 6452690. These changes will all be available in 4.23 which will go into preview builds soon, so it might be better to wait for that.

Hi Frank,

So I ended-up cherry-picking these 8 changes. Then I also had to checkout and resave all the Niagara Systems assets.

After that, we now have most of the NiagaraScript displaying some nice is in-sync skipping compile.. :slight_smile:

But we still have some dependencies that are seen has changed, and requires some recompiling at each editor startup:

[2019.07.18-11.50.16:620][526]LogNiagara: Emitter /Game/FX/Weapon/Reload/NS_ReloadRifle_01.NS_ReloadRifle_01:P_MuzzleFlashBase_01_0-P_MuzzleFlashBase_01 is merging changes from source /Game/FX/Weapon/Shooting_Muzzles/P_MuzzleFlashBase_01.P_MuzzleFlashBase_01 because its Change ID was updated.
[2019.07.18-11.50.16:657][526]LogNiagara: Emitter /Game/FX/Weapon/Reload/NS_ReloadRifle_01.NS_ReloadRifle_01:P_SingleFlash_01_3-P_SingleFlash_01 is merging changes from source /Game/FX/Weapon/Reload/P_SingleFlash_01.P_SingleFlash_01 because its Change ID was updated.
[2019.07.18-11.50.16:703][526]LogNiagara: System /Game/FX/Weapon/Reload/NS_ReloadRifle_01.NS_ReloadRifle_01 being compiled because graph changes were merged for a base emitter.
[2019.07.18-11.50.16:771][526]LogNiagaraEditor: '/Game/FX/Weapon/Reload/NS_ReloadRifle_01' Precompile took 0.067589 sec.

Could it be some Engine Content assets dependencies I would need to resave?

It’s a lot better though, so thank you for your answers.

Sébastien

Are those revision numbers from perforce?
Have you got the commit SHAs for the GitHub repository?

sorry, yes these changelist numbers are from Perforce, and it’s not easy to match them to github since a few of them are in fact only visible squashed into a merge commit (from a non public dev branch)