Announcement

Collapse
No announcement yet.

Plugin Object Pool Component

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

    Update for Unreal 4.20 submitted to Marketplace for review.
    | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

    Comment


      Hey Bruno, everyone.

      Just brought and implemented the object pooling plugin and its working great, I'm creating an endless runner for mobile and after a lot of testing / figuring out performance bugs, I've finally cracked it. The game runs well, 120fps on my Mac and 35 fps on my android, no performance lags, just continuous frame rate, the pooling has given me that so thanks sooo much!

      but

      Im having trouble with my respawned coins. I'm finding that if I have hit them before or if they are picked up by a magnet kinda thing, that when they are respawned next time, they keep those magnetized settings, or they won't get picked up before because they have already been picked up on the last spawn.

      I guess whats happening is that when a coin is sent back to the pool, it is not being told to revert back to its original coin state, its being kept in 'magnet state' and flying from its spawn point in the distance to the player.

      Is there a way to reset the coin to its original settings/state on return to pool, or a setting / checkbox that I've overlooked? I'm only about a month or so into learning unreal so yea a bit of a noob.

      any help is much appreciated,

      cheers
      a

      Comment


        Originally posted by amartis111 View Post
        I guess whats happening is that when a coin is sent back to the pool, it is not being told to revert back to its original coin state, its being kept in 'magnet state' and flying from its spawn point in the distance to the player.

        Is there a way to reset the coin to its original settings/state on return to pool, or a setting / checkbox that I've overlooked?
        You will have to tell your pooled class to reset its properties on either one of these Events:

        Click image for larger version

Name:	OBJPool_Events.PNG
Views:	32
Size:	81.7 KB
ID:	1504733
        | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

        Comment


          Right, makes sense. How are you getting those nodes? what do I right click and type to get them, or are they pulled in from variables?

          Comment


            All Blueprints children of PooledActor have them;
            Right click graph and search below "Add Event" context menu category.
            | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

            Comment


              ahh, yep I have the event nodes, I mean the 'set initial speed' 'set max speed' nodes. Are you setting them from the float variable (green Bullet speed) , if so how do I get access to the target option.? or are you right clicking and calling something?

              Comment


                They aren't relevant to your issue.
                It's just an example, just the red nodes matter there...
                You just need to reset your magnet properties from one of those Events like the example image.
                | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                Comment


                  Fixed, I had marked a coin as used and that was getting carried into the pool and still active on respawn... rookie mistake Cheers for the help Bruno, plugin is magic!

                  Comment


                    Update for Unreal 4.20 released.
                    | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                    Comment


                      Thanks for a quick update!

                      I'm wondering if it would be useful to add native events do PooledActor (and similar classes) on begin/end play.
                      We already BlueprintImplementableEvent (EVENT_OnPoolBeginPlay, EVENT_OnPoolEndPlay) and delegate (OnPoolBeginPlay, OnPoolEndPlay).

                      In my project I extend PooledActor class in C++, so native events come handy.
                      Of course, it's not a big deal. I used to add few lines for it after every update

                      Comment


                        Cheshire Dev you mean "BlueprintNativeEvent" or do you mean pure cpp delegates?
                        | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                        Comment


                          I mean BlueprintNativeEvent

                          Comment


                            Hey Bruno, I'm running 4.20.1 and either I am overthinking the entire process, or I really can't understand your guide for implementing this plugin using blueprints. I have a gun and I want it to shoot pooled bullets using your method. I won't go into detail for all the different ways I have attempted to solve this but I can assure you I've managed to crash my engine in at least 5 different ways. I understand I need to create an ObjectPoolComponent then I need to reparent my BulletProjectileBP to "PoolActor". This is all I KNOW how to do. Now I am not sure where to put the component...

                            If I put it in my gun my game crashes on simulation.... if I try putting it in an empty actor.... it crashes as well. I'm at a loss for what to do. If you could help me understand this process I will gladly re-write your instructions so you can post it as an addendum (or preferably a replacement) to your guide... English is my native language and I am really clear with written directions.... Thanks.

                            Comment


                              Originally posted by jdukeunrealdev View Post
                              Hey Bruno, I'm running 4.20.1 and either I am overthinking the entire process, or I really can't understand your guide for implementing this plugin using blueprints. I have a gun and I want it to shoot pooled bullets using your method. I won't go into detail for all the different ways I have attempted to solve this but I can assure you I've managed to crash my engine in at least 5 different ways. I understand I need to create an ObjectPoolComponent then I need to reparent my BulletProjectileBP to "PoolActor". This is all I KNOW how to do. Now I am not sure where to put the component...

                              If I put it in my gun my game crashes on simulation.... if I try putting it in an empty actor.... it crashes as well. I'm at a loss for what to do. If you could help me understand this process I will gladly re-write your instructions so you can post it as an addendum (or preferably a replacement) to your guide... English is my native language and I am really clear with written directions.... Thanks.
                              Some times ppl attach Pool Components to Pooled Actor and that causes crash (loop).

                              Without crash logs I cannot know why your project crashed.
                              Optimal report would be:

                              1) You run Unreal Editor launched from within Visual Studio (VS will tell you why and where the crash happens, which line and from which function)

                              2) Unreal generates crash report logs, you send me the latest log so I can read it.

                              3) An isolated project reproducing the crash I can use to fix it in case of bug.


                              But up to now, as said above, some people are causing loops attaching Pool Components to Pooled Actors, it's the only crash I know of right now.
                              | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                              Comment


                                https://youtu.be/aYOnNkc2RAM

                                Hello, I set "PooledProjectile" component instead of "Projectile Movement" component to my bullets.
                                I set initial speed and activate them on pool begin play. But bullets with pooled projectile did not moved. How did I set something wrong ?
                                This project is in Unreal Engine 4.20.1

                                Comment

                                Working...
                                X