DOREPLIFETIME causes crash

Ok so there’s not going to be much data here because I already wrote this once before but it should be pretty straight forward. If you don’t want to answer because of the lack of information, I get it. I’m frustrated too.

Anyway, I am crashing on DOREPLIFETIME(AGeneratedMesh, MeshData); Could it be caused by structs or cause by inheritance? or something else?

GeneratedMesh.h

UCLASS()
class ALPHA_API AGeneratedMesh : public AActor
{
	GENERATED_UCLASS_BODY()

public:
	UPROPERTY(ReplicatedUsing = OnRep_SetGeneratedMeshData)
		FGeneratedMeshData MeshData;
	UFUNCTION()
		virtual void OnRep_SetGeneratedMeshData();

private:
	UGeneratedMeshComponent* _componentMesh;
};

GeneratedMeshData.h

USTRUCT()
struct ALPHA_API FGeneratedMeshData
{
	GENERATED_USTRUCT_BODY()

public:

	UPROPERTY()
	FSimpleMeshData SceneProxyMeshData;
	UPROPERTY()
	TArray<FVector2D> SceneProxyUVData;
	UPROPERTY()
	FSimpleMeshData PhysicsMeshData;
};

FSimpleMeshData.h

USTRUCT()
struct ALPHA_API FSimpleMeshData
{
	GENERATED_USTRUCT_BODY()

public:
	UPROPERTY(EditAnywhere, Category = "GeneratedMesh")
	TArray<int32> Indices;
	UPROPERTY(EditAnywhere, Category = "GeneratedMesh")
	TArray<FVector> Vertices;

	void AddVertice(FVector vertice);
	void AddTriangle(FTriangle triangle);

	int32 IndiceCount() const;
	int32 VerticeCount() const;
	int32 TriangleCount() const;
	FTriangle GetTriangleByIndex(int32 index);

	FBoxSphereBounds CalcCurrentBounds() const;
};

GeneratedMesh.cpp

void AGeneratedMesh::OnRep_SetGeneratedMeshData()
{
	if (this->Role < ROLE_Authority)
	{
		this->_componentMesh->SetGeneratedMeshData(this->MeshData);
		this->_componentMesh->SetMaterial(0, this->DefaultMaterial);
	}
}

void AGeneratedMesh::GetLifetimeReplicatedProps(TArray< FLifetimeProperty > & OutLifetimeProps) const
{
	Super::GetLifetimeReplicatedProps(OutLifetimeProps);

	// Replicate to everyone
	DOREPLIFETIME(AGeneratedMesh, MeshData);
}

Hi MJLaukala`,

Sorry for the delayed response. What version of the Engine are you using, and are you using the binary version installed by the Launcher, or did you build the Engine from source code? Do you receive a callstack when this crash occurs? Would you be able to provide that? Also, if you have any project and/or Editor logs from when the crash occurs, those may be helpful as well.

What version of the Engine are you using, and are you using the

I am using 4.6.1. I am using the version installed by the launcher. I did not receive a call stack. The messagebox indicated that the crash was occurring in msvcr120.dll. I’ve just finished refactoring some of my code and no longer have this error thrown. I would have previously posted more info but I was very tired and got the “Post a question” button and “ask question” button mixed up and lost the original question.

I am glad to see that you were able to get the error to stop occurring. If you run into this again, please feel free to re-open this issue and we can dig into it to try to find out what is happening.

I will also make myself a note to check with someone after the holiday break to see if there is anything we can do to better differentiate between the “Post A Question” and “Ask Your Question” buttons.

That would be amazing! Also, I found the issue to be that amount of data that I am replicating is too much. If the data sent is a smaller amount it works just fine. There is also a point where the data is sent and replicated properly(it seems) but the OnRep_SetGeneratedMeshData function is never called on the client. I’ve searched and asked another question concerning the best ways to replicate large amounts of data but still haven’t received any answers. I’m currently looking into tcp sockets to solve the current limitations.

Also, if you know of any documentation, official or not, for c++ replication, I could really use it. There’s just not a lot of information concerning the technical details out there at the moment.

We have a few documentation pages relating to replication here, and some examples (using Blueprints, but the functionality should be similar in code) here. I have submitted a request to see if we can improve/expand on this information (UEDOC-774).

I will see if I can get one of our networking specialists to take a look at your other question once they are back in the office. They may be able to provide you with some specific information or ideas that will help.

I’ve checked those out previously. I did some digging in source and the problem turns out to be that there are limits set for dynamic arrays. the max item count can’t exceed 2048 and the max size can’t exceed 1024 * 16. DOREPLIFETIME is called when the size of the array changes. I’m currently in the process of modifying my engine to allow for big data by adding the key “BigData” as a UFUNCTION specifier.