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"

Functions are executed the same time

If in blueprint in a sequence a function A is called and from the next sequence pin another function B is called, the second function B should only start executing after function A has finished. Correct? If not, this is not bug.

If I clear an array in function A in a quite slow way with doing a for each loop and manually destroying the actors inside and remove them from the array, and in function B I add new actors to the array, then, depending on the speed of execution of function A and B, some of the actors I add in B are still destroyed and cleared by function A.

This would be the intended behavior for a event, but not for a function as far as I know.

It's easy to workaround this, just append the array in function A to a new local array and clear the array directly after this and do the for each loop on the local array.

Product Version: Not Selected
Tags:
more ▼

asked Apr 01 '15 at 06:05 PM in Bug Reports

avatar image

John Alcatraz
1.3k 60 139 127

avatar image Ben Halliday STAFF Apr 01 '15 at 08:37 PM

Hi John,

Function B should only fire once Function A is resolved, however I have seen instances in earlier versions of the engine in which it did not. I haven't been able to reproduce in 4.7.3 or our main internal build, though. Can you post an image of what you're doing in Function A so we can try to reproduce it? Thanks!

avatar image John Alcatraz Apr 01 '15 at 09:01 PM

Sure, this is function A:

alt text

And this is function B:

alt text

And this function is executing both:

alt text

Draw Points is just called every tick.

"Add Points" just does a For each loop on the Input Array:

alt text

Actually the "workaround" with copying the array first into a new local array does not help.

avatar image John Alcatraz Apr 01 '15 at 09:09 PM

The output I get is this:

 LogBlueprintUserMessages: Remove Child at index 1
 LogBlueprintUserMessages: Remove Child at index 1
 LogBlueprintUserMessages: Remove Child at index 1
 LogBlueprintUserMessages: Remove Child at index 1
 LogBlueprintUserMessages: Added Child at Index 1
 LogBlueprintUserMessages: Added Child at Index 2
 LogBlueprintUserMessages: Added Child at Index 3
 LogBlueprintUserMessages: Added Child at Index 4
 LogBlueprintUserMessages: Array Lenth: 4  --  Children Count: 5
 LogBlueprintUserMessages: -----
 LogBlueprintUserMessages: Remove Child at index 1
 LogBlueprintUserMessages: Remove Child at index 1
 LogBlueprintUserMessages: Remove Child at index 1
 LogBlueprintUserMessages: Remove Child at index 1
 LogBlueprintUserMessages: Added Child at Index 1
 LogBlueprintUserMessages: Added Child at Index 2
 LogBlueprintUserMessages: Added Child at Index 3
 LogBlueprintUserMessages: Added Child at Index 4
 LogBlueprintUserMessages: Array Lenth: 4  --  Children Count: 5
avatar image John Alcatraz Apr 01 '15 at 09:09 PM

And so on.

But the child widget is not drawn on the parent widget. If I have enough Child widgets (more than 7) then I can actually see some of them (4) and the more child widgets I have, the more I can see.

If I disconnect the "Reset Points" function in "Draw Points" then I see all the points correctly, but of course they are all drawn on top of each other with new ones added every frame...

avatar image John Alcatraz Apr 01 '15 at 09:29 PM

If I remove the "Reset Points" function call from "Draw Points" and instead set a timer for it in Event Construct so it's executed every .5 seconds, I can also see the all points, they just flicker every .5 seconds.

avatar image Ben Halliday STAFF Apr 02 '15 at 10:33 PM

I still can't reproduce this (in 4.7.4, released today). I have a few ideas what might be happening:

First, your method for removing Points is overly complex. Something like this would do the same thing:

alt text

Still, doing it your way didn't cause a delay in when the first function fired, so that in itself doesn't appear to be the problem.

Second, it looks like your Add nodes are old. Is this an older project converted up to 4.7? If so, you might want to replace the old array nodes (Add, Clear, etc) with new versions. I can't confirm it's what makes the difference, but yours are passing by reference, and the new ones don't do that anymore.

Third, it might help if you add a check in your sub function, AddPoint, to see if Points is empty. If it is, it doesn't need to create a widget at all.

I tried reproducing your setup bit by bit, exactly the way you have in your images, both in an Actor Blueprint and inside a Widget Blueprint, with over 100 Actors. It worked fine for me. If you can look into the things I suggested and let me know if any fix the issue, please let me know so we can find the cause. Also, if you don't mind, the clearest way to tell that function B is starting before Function A finishes is to place a Print String at the end of A and at the beginning of B. Can you add those and confirm for me that the log shows B and then A? Thanks!

funca.png (78.7 kB)
avatar image John Alcatraz Apr 02 '15 at 11:59 PM

Thanks for looking into this! I am myself using 4.7.4 from today.

I only did it the way I do it in function A because I hoped it would fix the problem, at first I had it that simple as you described. I now changed it back to the simple way, it does not change anything.

I also intentionally used the "old" pass by reference add nodes because I hoped it would fix the problem, but it didn't, now I changed all back to the "new" non-pass by reference nodes. Does not change anything.

I dont't really need to check whether Points is empty since in my game there are always at least 1 Point inside. If Points is empty, the For each Loop in Add Points will just not execute the loop.

I really wonder you are not able to reproduce this... So you recreated the exact way I am doing this, so you add widgets to a UMG Canvas Panel, and remove all of them in the next frame and so on, and you can see all the widgets you add?

As you see in the log function A does not seem to be executed after function B. Function A is logging "Remove Child ..." while function B prints "Added Child ...". So in theory it should work, but it does not.

Could this be an issue with the way widgets are added to a UMG Canvas Panel? Something like they are not drawn in the same frame as they are added? The fact is, if I don't execute "Reset Points" every frame it does work, so there has to be a bug somewhere in how widgets are added or removed.

Again, thanks a lot for trying to find the cause for this bug...

avatar image Ben Halliday STAFF Apr 03 '15 at 08:56 PM

Hey, sorry for the delay in response, been a crazy day for me.

I only tested for a possible order of function firing bug, and didn't really focus on the UMG part of it (aside from using a base widget for the function tests). I believe this may be an entirely different issue, and I'll need to examine it as a possible UMG bug. Can you post some screenshots of your widget graph setup? You may be right about the order of operations in widgets, I'll look into that. If you're able to set up a smaller test project that does the same thing, I'd be happy to look at that as well. Thanks!

avatar image John Alcatraz Apr 03 '15 at 10:38 PM

Screenshots from what widgets graphs? I have posted screenshot from all the important parts.

I have tried setting up the same stuff in a new test project and I can't reproduce this. I don't get it. I did it the exact same way, but it does work. Why does it work in a new project?

avatar image John Alcatraz Apr 03 '15 at 11:31 PM

I believe I found the cause for this... If I set the ZOrder of the created widgets to 1, I can see them even with removing them the next frame.

So it seems to be something like, if a new widget is created it has a ZOrder of 0 which gets automatically set to some higher value the next frame. If I don't set it manually to 1 in the first frame it get's drawn below the background image. I guess this is a bug, but it's clearly not related to functions executing at the same time :)

avatar image Ben Halliday STAFF Apr 06 '15 at 05:34 PM

Sorry, I said graphs by mistake but I meant the design screen. I mostly want to see how you have your CanvasPanelSlot and MovePanel set up, but I should be able to test with a simple widget-in-widget setup regardless.

I'll check in with our widget guy to see if they're aware of any zorder issues. You mentioned this doesn't happen in a new project, so does that mean the zorder issue only occurs in your current project, or that you set it up differently in the new project?

avatar image John Alcatraz Apr 06 '15 at 10:09 PM

In the new project I had set up the ZOrder differently because I thought they would not be important...

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

1 answer: sort voted first

Hello John Alcatraz

I was able to reproduce this issue on our end. I have written up a report (UE-13486) and I have submitted it to the developers for further consideration. I will provide updates with any pertinent information as it becomes available. Thank you for your time and information.

Make it a great day

more ▼

answered Apr 08 '15 at 08:18 PM

avatar image

Rudy Q ♦♦ STAFF
47.4k 545 132 525

(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