ActorComponent doesn't correct destroy replication information

I have an Actor on the level. If I try to create replicated actor component in this Actor and destroy it and I will do this several times, after that network starting overload. I noticed, overloading happening when I strongly filling replicated TArray inside this actor component. But in EndPlay I properly clear this array, so that can’t be the reason of network overloading. Increasing network parameters in defaultengine.ini and defaultgame.ini doesn’t help. Maybe starting network stabilization from DDoS, or not deleting network cache, but something happening. And I noticed one else thing if I create this actor component in replicated character, everything will be okey.

How are you calling the destroy actor over the server and how many actors are you trying to destroy?

Without seeing the code it would be hard to tell. I don’t think it would be an issue with the .ini unless you have changed the defaults to a really low number.

You may be calling it on each client unnecessarily?

I’m tried create the same situation and I really can’t do this. In new project everything is ok. But I noticed some new things.

Short description of my problem: I have replicated trader actor who has inventory component. When I come close and press button will create replicated trader basket component on the server. After creation it is adding in replicated TArray. After updating the array on the client, creates UI. If I try fast copy objects from inventory to basket component and after that destroy basket with all created actors and repeat this process several times, then I will see, that my UI starts create slowly. You might to think, that I don’t destroy actors correctly, but I do. I check this many times, number actors before these processes and after is equal on the client and on the server. Even UObjects equal if I force garbage collect data.

I noticed problem will disappear when I reduce the creating item load. Usually if I fast copy items, my FPS drops from 80 to 20, now my FPS nearly 60. Another way to avoid a long waiting of loading trader basket is create actor who will hold trader basket component and instead of creation dynamic actor component you just spawning actor and after that you just destroy it and this is all.

I think happening something like cutting actor bandwidth for net optimization. Or it is just a bug.

It sounds like its duplicating your logic and running it multiple times over. Ive seen this kind of fps drop when items are compounding on each other, but arent readily obvious without debugging or using print strings. Are you running any of this on tick or for each loop? How many items are you actually creating in this inventory?

Try highlighting all the logic running these events and press F9 on your keyboard to create break points and then run your game and go through each event and see what its doing with the debugger tool.

Also try hooking up print strings off these destroy and or spawning events and see how many times it’ll print out. Id be willing to bet its probably creating your inventory too many times. Say you have 30 items you want to create, it may be creating those 30 items 30 times over if its spawning incorrectly. That could cause a drop in frame rate like that…

I think this is wrong logic. I have included a timer that shows the number of actors on stage every second. The timer works both on the client and on the server. When I start creating actors in the trader basket, the number of actors on the stage grows, but after closing the number of actors becomes the same as it was before opening the inventory on both the server and the client. That is, I want to say that if extra objects are created inside the cycle, then they are all cleaned up in the end normally. But the network for some reason starts to load more. This becomes especially evident after several seamless travels. By the way, the actor counter shows that before the seamless move and after the seamless move, the number of actors is the same. At the same time, there is a very interesting thing. If you, as a client, disconnect from the server and reconnect to it, then everything will be fine. It looks like the destruction of the actors is happening, but it’s not happening correctly or on the server, or on the client or in both. For me, the destruction of all replicated actors occurs only on the server through the Destroy () function. Maybe it needs to be done differently, but I don’t know.

I don’t know why, maybe this is the problem, but when I enter net.ListNetGUIDs in the console, a huge number of empty GUIDs are displayed. True, I could not find how to clean them up.