Announcement

Collapse
No announcement yet.

Plugin Object Pool Component

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Yes, I've added new node to both versions.
    The easiest way to know when there's an update is check the "Library" in UE4 Launcher. it will display a warning icon the things that have update available in your library...

    From there many use perforce diff tools to know what exactly have changed then they merge only the things that matters to their (modified) version of plugin.
    I love when they do this because they require less support from me (having a programmer managing this kind of stuff is less margin for human error when dealing with code updates)

    For example, I'm not working on 4.18 but 4.19... Have Marketplace version installed on 4.18 and source moved to Project/Plugins on 4.19.
    After updating (original code) on 4.18, diff source against 4.19 and merge new lines of new functions needed. Very safe to perform a plugin update this way.
    | Finite State Machine | Savior | USQLite | Object-Pool | Sound-Occlusion | Property Transfer | Magic Nodes | MORE |

    Comment


      Cheers Bruno, all's working properly *thumbsup

      Comment


        There was a regression related to Particle System Components (this was fixed before on older versions of Unreal, but came back to UE4.18 and UE4.19)
        Particles Components from pooled Actors can't "rewind" emitters because Unreal will ignore a certain function call if any of the Particle Component's parents is hidden/innactive...

        I've fixed that *again* and will submit update 1.5.5 to Epic:


        | Finite State Machine | Savior | USQLite | Object-Pool | Sound-Occlusion | Property Transfer | Magic Nodes | MORE |

        Comment


          Epic already processed the fix above
          | Finite State Machine | Savior | USQLite | Object-Pool | Sound-Occlusion | Property Transfer | Magic Nodes | MORE |

          Comment


            Hello,

            Is there a way of resetting the rotation of the pooled objects? My goal is to have all instances use the rotation specified in their classes, but after getting pooled out and then in, I think they're still at the same rotation they were before.

            Comment


              You can input transform property in Spawn from Pool node options.

              On return to pool they are set to zero rotation.

              On Pool end play event you could reset transform to defaults.
              | Finite State Machine | Savior | USQLite | Object-Pool | Sound-Occlusion | Property Transfer | Magic Nodes | MORE |

              Comment


                Hello Bruno Me again haha

                I have your plugin files setup in my Plugin folder, so, not using the Engine installed one. It is setup in the build.cs as a dependency "OBJPool", it is set as installed and everything works like a charm in the Editor. But, when I packaged the game for release, the plugin doesn't work and it seems like it isn't getting packaged. Is there some step that I am missing?

                Edit: Actually, while looking at the logs, I just found this "Trying to Parse Object-Pool Component, but:: Pool Component is Invalid!", the game works fine in the Editor or Standalone, but packaged doesn't. Does the warning have any effect here?
                Last edited by LatFoued; 06-18-2018, 09:34 AM.

                Comment


                  Originally posted by LatFoued View Post
                  Hello Bruno Me again haha

                  I have your plugin files setup in my Plugin folder, so, not using the Engine installed one. It is setup in the build.cs as a dependency "OBJPool", it is set as installed and everything works like a charm in the Editor. But, when I packaged the game for release, the plugin doesn't work and it seems like it isn't getting packaged. Is there some step that I am missing?

                  Edit: Actually, while looking at the logs, I just found this "Trying to Parse Object-Pool Component, but:: Pool Component is Invalid!", the game works fine in the Editor or Standalone, but packaged doesn't. Does the warning have any effect here?
                  I need logs from packaged game built in developer mode to take a look.
                  | Finite State Machine | Savior | USQLite | Object-Pool | Sound-Occlusion | Property Transfer | Magic Nodes | MORE |

                  Comment


                    Alright,
                    This is the first time I use plugins and especially ones that are put inside the project's plugin folder, not from the Engine. So, which log files do you need exactly? Because that might help me too as I might find the issue myself

                    Comment


                      You package your game (not Shipping mode) to desktop.
                      launch game, play a little; there should be a Logs folder within "Saved" folder inside your packaged directory after you play the game. There should be logs recorded in there.

                      -----

                      Btw, I just packaged one of my personal home projects, and pooling is working on the packaged game (4.19).
                      That error you see in your logs usually means that the Pool Component or its Owner has been deleted or is marked "Pending Kill" while Pooled Actors were still being pooled from that Component.

                      That shouldn't happen, this is why I wrote that warning to show up there. It says something is wrong about the lifetime of your Pool Component (probably destroyed for some reason)
                      | Finite State Machine | Savior | USQLite | Object-Pool | Sound-Occlusion | Property Transfer | Magic Nodes | MORE |

                      Comment


                        LatFoued I'd suggest you take a look at your Blueprint Graphs and make sure you don't have "Spawn from Pool" nodes with unlinked Pool pins as well.

                        If you believe there's something wrong with this warning, you can double-check the code.
                        This warning comes from this file:

                        K2Node_SpawnActorFromPool.cpp:
                        Code:
                            const TArray<UEdGraphPin*>* PinsToSearch = InPinsToSearch ? InPinsToSearch : &Pins;
                            //
                            UEdGraphPin* PoolPin = GetPoolPin(PinsToSearch);
                            UClass* SpawnClass = nullptr;
                            //
                            if (PoolPin && (PoolPin->LinkedTo.Num()>0)) {
                                auto LinkedPin = PoolPin->LinkedTo[0];
                                UClass* PoolClass = (LinkedPin) ? Cast<UClass>(LinkedPin->PinType.PinSubCategoryObject.Get()) : nullptr;
                                UObjectPool* PoolComponent = Cast<UObjectPool>(PoolClass->ClassDefaultObject);
                                if (PoolComponent) {
                                    SpawnClass = PoolComponent->TemplateClass;
                                } else {
                                    UE_LOG(LogTemp,Warning,TEXT("{Pool}:: %s"),TEXT("Trying to Parse Object-Pool Component, but Pool Component is Invalid!"));
                                }
                            } return SpawnClass;
                        You can see there the errors shows up because for some reason your Pool Component came out as a nullptr.
                        Maybe this node is executing in your Blueprints before the engine has generated PoolClass's "Default Object".
                        | Finite State Machine | Savior | USQLite | Object-Pool | Sound-Occlusion | Property Transfer | Magic Nodes | MORE |

                        Comment


                          I see, I'm currently debugging the project using packaged builds in development. It feels like it is because of the way I have it setup and not from the Plugin, which is nice as I can debug my own code better

                          I'll let you know when I come to the conclusion. But, for that invalid component error, it actually was when I started packaging, no ingame.

                          Comment


                            WHEN I DO Nativization MY BLUEPRINT PROJECT TO C++ PACKAGING THIS ERRORS OCCURED , HOW DO I SOLVE THIS ISSUES? ANY IDEAS?

                            Comment


                              flower011red I have never in my life used Blueprint Nativization, sorry.

                              Many devs have implemented nativization themselves, but I have never used it, so I have no idea why nativization causes that.
                              I think you could try to disable it for the plugin instead; since the plugin is already running on C++ there's really no reason to "nativize" this. It is already native C++ code.
                              | Finite State Machine | Savior | USQLite | Object-Pool | Sound-Occlusion | Property Transfer | Magic Nodes | MORE |

                              Comment


                                For a heads up on the issue I was having with the Packaged project not working properly, it basically was UE not properly saving my Object-Pool project settings. I need "Instantiate on Demand" for my project to work and the default is "False", but in project settings I set it to "True" and all works fine, but after packaging, it acts as if it isn't working.

                                So what I did is simply add the default values I needed to the Config/DefaultGame.ini

                                Code:
                                [/Script/OBJPool.PoolSettings]
                                ReinitializeInstances=True
                                InstantiateOnDemand=True
                                NeverFailDeferredSpawn=False
                                KeepOrphanActorsAlive=False

                                Comment

                                Working...
                                X