Packaged Project Crashes on Startup

I’ve packaged my UE5 game with both Development and Debug configuration, but when I launch it, it gives this error message
Captura de ecrã 2022-09-05 225820

And when I try opening the shipping configuration build, I get this error
Captura de ecrã 2022-09-05 230306

It works perfectly in the editor.
Does anyone know how I can solve this problem? Thanks

Hey @Axaloty11! Welcome to the community! So it’s throwing an error in a check to get the byte size of a parameter and verify it’s the same size of T.

The entire function:

	FORCEINLINE_DEBUGGABLE bool SetParameterValue(const T& InValue, const FNiagaraVariable& Param, bool bAdd=false)
	{
		check(Param.GetSizeInBytes() == sizeof(T));
#if WITH_EDITOR
		ensure(FNiagaraTypeHelper::IsLWCType(Param.GetType()) == false);
		if (Param.GetType() == FNiagaraTypeDefinition::GetPositionDef())
		{
			check(HasPositionData(Param.GetName()));
		}
#endif
		int32 Offset = IndexOf(Param);
		if (Offset != INDEX_NONE)
		{
			//*(T*)(GetParameterData_Internal(Offset)) = InValue;
			//Until we solve our alignment issues, temporarily just doing a memcpy here.
			T* ParamData = reinterpret_cast<T*>( GetParameterData_Internal(Offset) );
			FMemory::Memcpy(ParamData, &InValue, sizeof(T));
			OnParameterChange();
			return true;
		}
		else
		{
			if (bAdd)
			{
				bool bInitInterfaces = false;
				bool bTriggerRebind = false;
				AddParameter(Param, bInitInterfaces, bTriggerRebind, &Offset);
				check(Offset != INDEX_NONE);
				//Until we solve our alignment issues, temporarily just doing a memcpy here.
				//*(T*)(GetParameterData_Internal(Offset)) = InValue;
				T* ParamData = reinterpret_cast<T*>(GetParameterData_Internal(Offset));
				FMemory::Memcpy(ParamData, &InValue, sizeof(T));
				OnLayoutChange();
				return true;
			}
		}
		return false;
	}

It’s acting as though a Niagara system is passing in either a T value that doesn’t exist or an FNiagaraVariable that doesn’t exist.

Is this the binary or source version of the engine?
Are you using any marketplace assets?

I’m using the regular version from the launcher and I am not using any marketplace assets.

Captura de ecrã 2022-09-06 124425
Captura de ecrã 2022-09-06 124411

I’m only ever changing values of floats that exist in the Niagara System.

This is probably not the reason for it but I do have to ask for my own knowledge. I’m primarily a C# programmer, so the dot behind the 0, is that a special syntax for something?

In other news, I’ve done a bit of digging and most of the time when this issue occurs there’s a data mismatch somewhere.

No, it isn’t. I just changed it to that because before it was 0.0f and maybe that was the issue but it still crashes when packaged

This is definitely a bug then. This has been a recurring bug that only shows itself during builds. I was looking through the issue tracker and noticed this has been an issue with certain parameter changing with Niagara systems for a while on and off.

Just an example (this one recent 5.0EA with Vector2 param changes)

Another from 2019 for bools

Unfortunately I don’t have any workarounds for this one. So it looks like we’re going to have to make a bug report.

I recently fixed it by deleting the check(Offset != INDEX_NONE); from engine code… Kind of “Do as I say, not as I do” situation, since it shouldn’t be fixed this way.

Also, if you’re using a material parameter collection driven niagara parameter collection, make sure that you got all of your NPC params in MPC with matching types.