x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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);
 }
Product Version: Not Selected
Tags:
more ▼

asked Dec 16 '14 at 07:00 AM in Bug Reports

avatar image

MJ_01
822 38 39 241

avatar image Tim C ♦♦ STAFF Dec 23 '14 at 11:29 PM

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Dec 25 '14 at 05:10 AM

avatar image

MJ_01
822 38 39 241

avatar image Tim C ♦♦ STAFF Dec 26 '14 at 07:53 PM

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.

avatar image MJ_01 Dec 26 '14 at 11:37 PM

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.

avatar image Tim C ♦♦ STAFF Dec 30 '14 at 11:49 PM

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.

avatar image MJ_01 Dec 31 '14 at 04:14 PM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question