How to override IsNetworkCompatible to true?

Hi, how can I make FNetworkVersion::IsNetworkCompatible to always return true without building engine from source code?
I have to install the whole engine from source if I can’t make this. Thanks in advance.

I want to completely disable version control in my release builds. I will build from source while distributing but I don’t want to build from source yet, so I want to use builds compiled from different computers. I don’t want any version mismatch errors.

hi, what are you trying to achieve with this?

are you on a team with more than 1 programmer?

I am alone for now but I use two computers. They produce different version hashes. This is apparently a override feature but I just don’t know how to use it: FNetworkVersion::FIsNetworkCompatibleOverride FNetworkVersion::IsNetworkCompatibleOverride;

There’s a static delegate you can bind to, see FNetworkVersion::IsNetworkCompatibleOverride. You could bind to that and have it always return true regardless of the versions given.

FNetworkVersion::IsNetworkCompatibleOverride.BindLambda([](uint32 LocalNetworkVersion, uint32 RemoteNetworkVersion)
{
    return true;
});

There’s also FNetworkVersion::GetLocalNetworkVersionOverride which you can bind to to override the version generation logic.

1 Like

Somewhere during your game module initialisation. It would probably also be worth wrapping it in an #if !BUILD_SHIPPING block to make sure you don’t accidentally ship the override code!

Thank you very much, but where should I put this code to? Anywhere in cpp classes of my project?

I am adding this code but getting this error: Use of undeclared identifier: FNetworkVersion

I included these but still same:
#include “Runtime/Core/Public/Misc/NetworkVersion.h”
#include “Runtime/Core/Private/Misc/NetworkVersion.cpp”

Could you please help me? I am poor at C++.

Okay I resolved it by adding these lines only to header:

#include “Runtime/Core/Public/Misc/NetworkVersion.h”

struct FNetworkVersion;

If your module is dependant on the “Core” module (which basically everything is). then that include can just be:

#include "Misc/NetworkVersion.h"

You also shouldn’t need the forward declaration of the type since you’re including it.