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"

What is the most efficient way to modify each loop iteration?

I’m currently making a blueprint where speed and efficiency is absolutely essential. In the most crucial part of the blueprint I’m running a massive, nested for-loop that I’m trying to optimize as much as possible. A peculiarity of this loop is that I want to include some repeating variations to the looped functions. Here is a screenshot of a simplified blueprint that illustrates what I’m trying to achieve:

alt text

The first and third function will be the same each time, but for the second function I want four different input variables that are used in sequence, one different variable used for each loop iteration, restarting after four iterations. I know of several ways to achieve this, but what I’m trying to achieve is to make it as fast and efficient as possible.

Currently I’m using a sequence instead of a loop, and copied the content of the loop four times, with small variations changed for each. This does run fast, but I feel it makes the blueprint four times as big as it needs to be, and also makes it more difficult to make changes to the blueprint, as I have to repeat everything four times. What does the community think? If anyone knows of a better solution I would be very grateful.

Product Version: Not Selected
example loop.png (191.2 kB)
more ▼

asked Dec 12 '14 at 11:28 AM in Blueprint Scripting

avatar image

152 7 10 21

avatar image cgrebeld Dec 12 '14 at 03:48 PM

You actually notice a speed difference between using a sequence and a 4x loop?

avatar image Monokkel Dec 12 '14 at 11:00 PM

Not from using a loop itself. However, if I am to make repeating alterations to each loop iteration I have to include if-statements (e.g. if loop index 1 use this variable, if loop index 2 use this variable), while with a sequence that is not necessary, provided I connect a unique set of nodes to each point in the sequence. Using a loop with if statements is noticably slower than using a sequence with modifications.

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

0 answers: sort voted first
Be the first one to answer this question
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