Announcement

Collapse
No announcement yet.

Plugin Object Pool Component

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

    Originally posted by BrUnO XaVIeR View Post

    I would then assume it's a bug in Unreal, that popup shouldn't happen when binaries already exist (I ve never seen that happen by the way).
    Well, what I had to do was this - I removed "engine version" like from ObjectPool.uplugin and I no longer get the pop-up (engine source builds, depending on the fork, have weird version "number", that that string in the .uplugin file will never match anything but launcher's version of UE4)

    Comment


      BrUnO XaVIeR



      This doesn't seem right.. What am I doing wrong (I am working with my gun actor in the video)?

      Comment


        To generate input pins you have to specify the 'Pooled Class' on the node before connecting anything.

        It will reject any connections until you define the target class, because the reflection code needs a direct pointer to the class to build the pins even though there is already class info in the pool component.
        | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

        Comment


          Originally posted by BrUnO XaVIeR View Post
          To generate input pins you have to specify the 'Pooled Class' on the node before connecting anything.

          It will reject any connections until you define the target class, because the reflection code needs a direct pointer to the class to build the pins even though there is already class info in the pool component.
          So basically I need to specify my projectile class to be spawned (in the spawn from pool node) and then connect pool component to the node ?
          Last edited by motorsep; 06-22-2020, 10:51 AM.

          Comment


            Originally posted by motorsep View Post

            So basically I need to specify my projectile class to be spawned (in the spawn from pool node) and then connect pool component to the node ?
            Yes. Wasn't like that, the node, but I did this to shield against possibility of a silent bug. Not required in c++
            | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

            Comment


              BrUnO XaVIeR

              Also, while we are at it, would this be a correct setup: Gun has Pool component, projectile that is spawned by the gun will be a Pool Actor, but also will have a Pool Component that will spawn particle effects and sounds when projectile hits something (which are also going to be Pool Actors) ?

              Comment


                No, don't add nested pool components in pooled actors, bad idea.
                Possible, but not good idea.

                Pooled Actor classes automatically search for particle components and disable them when actor is returning to pool.
                | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                Comment


                  Originally posted by BrUnO XaVIeR View Post
                  No, don't add nested pool components in pooled actors, bad idea.
                  Possible, but not good idea.

                  Pooled Actor classes automatically search for particle components and disable them when actor is returning to pool.
                  I am a bit lost here.. So Pool Component should only be in the gun actor (or pretty much anywhere in the game as long as I pass the pool component into any other actor that spawns pooled actors, via BPI for example) ?

                  Comment


                    Yes, you can set the transform of the actor spawned from pool, so there's no need to have pool components attached to pooled actors.
                    Pooled Actor classes also have blueprint interface events fired when they spawn or return to pool.

                    If you are not paying attention, you have PoolComponentA spawning PooledActorA... then you add PoolComponentA as a component to PooledActorA what happens is you are going to cause an infinite cycle of PooledActorA spawning and possibly a crash. So it's not recommended to deal with that unless you are certain you won't do that kind of mistake.

                    Also you can attach common actors to pooled actors as children, that cause no issue.
                    | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                    Comment


                      Originally posted by motorsep View Post
                      BrUnO XaVIeR



                      This doesn't seem right.. What am I doing wrong (I am working with my gun actor in the video)?
                      OH MY GOD - I can't believe all we had to do was specify the Pooled Class before connecting the Object Pool. I reinstalled the engine twice just because of this bug - not being able to simply drag off of an Object Pool component and Spawn Actor From Pool.
                      Mind numbing.

                      Comment


                        Hmm.. I guess I should add a Blueprint compiler error there explaining why you are expected to pick a class on the node before connecting pins..
                        | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                        Comment


                          BrUnO XaVIeR Or better yet a tutorial (video or typed) explaining proper setup and use cases

                          Comment


                            @BrUnO XaVIeR - Is Insantiate on Demand working in 4.251? It seems to work in editor but not in compiled projects.

                            ( thanks for all the support on this plugin, btw )

                            :]
                            Last edited by Ghoztt; 07-06-2020, 12:41 AM.

                            Comment


                              Originally posted by Ghoztt View Post
                              @BrUnO XaVIeR - Is Insantiate on Demand working in 4.251? It seems to work in editor but not in compiled projects.
                              The engine may be failing to load config files.
                              If you have c++ compiler installed, you can edit the settings and recompile plugin;

                              In OBJPool.cpp file you just have to change it to "true":
                              Code:
                              UPoolSettings::UPoolSettings(const FObjectInitializer &OBJ) : Super(OBJ) {
                                  NeverFailDeferredSpawn = false;
                                  KeepOrphanActorsAlive = false;
                                  ReinitializeInstances = true;
                                  InstantiateOnDemand = false;
                              
                                  LoadConfig();
                              }
                              | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                              Comment


                                I am moving those settings from config to properties of Pool Components;
                                Will submit an update for that this week:


                                | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                                Comment

                                Working...
                                X