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"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

Copying group of actors may be very slooooow

Hi,

I have a map with 20k+ actors and when I'm trying to copy a group of actors 200+ the editor can freeze even for +20 minutes. My current engine version is 4.4.

I can easily reproduce this behavior on 4.3 shoter game HighRise map, I copied actors that whole level contains ~3300 actors and grouped 315 actors, then copy, editor freezed for ~30 seconds.

Bigger map, more actors, bigger groups = more pain and I believe the main bottlenect is within:

 void UEditorEngine::SetActorLabelUnique( AActor* Actor, const FString& NewActorLabel ) const

Best regards

Pierdek

Product Version: Not Selected
Tags:
more ▼

asked Aug 21 '14 at 07:26 AM in Using UE4

avatar image

Pierdek
2.6k 73 49 131

avatar image Pierdek Sep 01 '14 at 06:23 AM

bump bump

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Hi Pierdek,

How long it takes to copy a large amount of actors depends on the complexity of the actors themselves and your hardware setup. The scenario you described in Shooter Game is standard behavior when copying that many actors.

As for what you are seeing in your project, 20k actors in one scene is quite a lot. You may want to consider Level Streaming, hiding groups of assets that you aren't working on, using Unlit Mode, or turning off certain process heavy features in the Perspective Viewport (Anti-aliasing, Particle Sprites, etc.).

TJ

more ▼

answered Oct 13 '14 at 05:30 PM

avatar image

TJ V ♦♦ STAFF
41.1k 1009 183 493

avatar image Pierdek Oct 14 '14 at 06:42 AM

HI TJ

I do not agree with you, my rig(I7,32 GB RAM, GeForce GTX 770), isn't bad for UE4. Our level is divided on smaller subleveles, yes we were preparing streaming.

 using Unlit Mode, or turning off certain process heavy features in the Perspective Viewport (Anti-aliasing, Particle Sprites, etc.).

These setting doesn't affect copying actors!

But take a look on function UEditorEngine::SetActorLabelUnique

 void UEditorEngine::SetActorLabelUnique( AActor* Actor, const FString& NewActorLabel ) const
 {
     check( Actor );
 
     FString Prefix             = NewActorLabel;
     FString ModifiedActorLabel = NewActorLabel;
     int32   LabelIdx           = 0;
         
         //Pierdek: first loop
     for (;;)
     {
         // Check for a duplicate actor name
         bool Duplicate = false;
                 //Pierdek: second loop this creates iterator from level _P which iterating over all actors, not only on level where actor is placed, so streaming doesn't gives any advantages
         for (FActorIterator It(Actor->GetWorld()); It; ++It)
         {
             if (Actor != *It && It->GetActorLabel() == ModifiedActorLabel)
             {
                 Duplicate = true;
                 break;
             }
         }
 
         
     }
 
     Actor->SetActorLabel( ModifiedActorLabel );
 }


Check my comments in code and as you see there is O(n^2) - 2 loops in this function with simple hashmap you can get O(1) which is much faster.

avatar image TJ V ♦♦ STAFF Oct 14 '14 at 06:37 PM

I got with our devs on this and it seems a optimization fix was just submitted for this bit of code. Copying large amounts of actors will still be an expensive operation, but this fix helps streamline the process.

Look for the adjustment to be included of a future editor update.

TJ

avatar image Pierdek Oct 14 '14 at 08:36 PM

Sure, thanks ;)

(comments are locked)
10|2000 characters needed characters left
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