I need "Begin Overlap Event" work like a FIFO event queue!!


OLD POST UPDATE: (to see the original post please read after this)


I found out what the real problem was that the events were arriving out of order… everything was working perfectly but since the events were arriving in reverse order the item became invisible and then visible giving the impression that it was never invisible…

So I think the problem is that I just receive the fastest running event first…

I don’t know how event queues work internally in Unreal… or if really they are threads…

But I would like to know if it can be forced to be FIFO (first in first out)…

Putting a simple 0.1 second delay at the beginning of each event makes the events arrive in the correct order. (on my computer).
fifo

I’m 100% sure this won’t work in an online multiplayer game.

So my new question is:
Is there a way to make reliables FIFO event queues?

Thank you very much!!


The old post below


TITLE: How to sync overlapping among several actors?

The following happens while the begin overlap event is running.

Overlap between two actors:
When an pawn overlaps with an item (other actor) the item is attached to that pawn and becomes invisible.

When an pedestal (other actor) overlaps with the item, the item is attached to that pedestal and becomes visible.

Overlap between more than two actors: (here comes troubles)
When a pawn brings the item to the pedestal. But on the pedestal there is another pawn this happens.

1º - The item is detached from thge first pawn (it does works ok)

2º - The item is attached to the pedestal (it does works ok but it’s too fast to appreciate it)

3º- The item is attached to the second pawn
Here attach works but make invisible fails.

That is “Set Actor Hidden In Game” either doesn’t run… or runs at the wrong time.

What am I thinking about this?
I’m thinking that maybe the Begin Overlap event is a separate thread from each actor running concurrently and asynchronously.

In this supposed case, “Set Actor Hidden In Game” may be a function that takes a long time to complete its task. If so, it is possible that these functions are not running in the order that I want them to.

Otherwise, the “Set Actor Hidden In Game” function is simply failing.

My questions are:
-What is really happening?
-if it is a thread… How to synchronize it? There are semaphores or mute, or something available?

Thank you very much!!

It’s definitely a synchronization problem.

I still don’t know if it’s because independent threads are running… or if it’s a communication delay (replication) between the server and the copies on the clients.

So far “I have managed” to solve the problem in this way. However I know that is not the right way to do it. In fact, I know that it is a very bad solution and not recommended at all.

So please let me know how to fix this problem properly.

Thank you very much!!


Below the wrong solution


Wait/block for a while if there is another process (event) is running.

Thank you so much!!

Id use a Set timer event when attached to the pedestal. Add a bool to the item (bCanTransfer?). If true it can, otherwise it cannot. On transfer set it to False. Timer sets it to true.

1 Like

Hi
I will try it.
Thank you so much for the idea.