Announcement

Collapse
No announcement yet.

Plugin Object Pool Component

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

    #91
    Originally posted by BrUnO XaVIeR View Post
    Issues like this is always due to the collision/physics settings you're using when spawning your projectile.
    Make sure you use correct physics settings on your spawn options.
    Yeah, I fixed it by checking the 'Reconstruct' boolean. You say, "This results on expensive respawn operation and will affect performance", how expensive? And how do I avoid using that option and make the projectile movement work?

    Comment


      #92
      Originally posted by Cerebros View Post
      Yeah, I fixed it by checking the 'Reconstruct' boolean. You say, "This results on expensive respawn operation and will affect performance", how expensive? And how do I avoid using that option and make the projectile movement work?
      A normal spawn actor, engine default, will take some impact on fps.
      If you leave the reconstruct option turned off, that impact using the OBJ Pool is reduced by 70%~90%;
      With that reconstruct option turned on, the OBJ Pool will reduce spawn impact by 40%~80%, so if you spawn a projectile every frame that would give your spawn function only 40% performance boost instead of ~90%.

      If the projectile isn't spawned every frame, that's fine.

      On construction script you can set the initial (exposed) velocity of the projectile, maybe that's why yours don't move, no speed set on spawn.
      Also make sure you use the custom projectile component provided; the default projectile movement component will not work on object pools.
      Last edited by BrUnO XaVIeR; 08-03-2017, 12:04 AM.
      | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

      Comment


        #93
        Originally posted by BrUnO XaVIeR View Post
        A normal spawn actor, engine default, will take some impact on fps.
        If you leave the reconstruct option turned off, that impact using the OBJ Pool is reduced by 70%~90%;
        With that reconstruct option turned on, the OBJ Pool will reduce spawn impact by 40%~80%, so if you spawn a projectile every frame that would give your spawn function only 40% performance boost instead of ~90%.

        If the projectile isn't spawned every frame, that's fine.

        On construction script you can set the initial (exposed) velocity of the projectile, maybe that's why yours don't move, no speed set on spawn.
        Also make sure you use the custom projectile component provided; the default projectile movement component will not work on object pools.
        Cheers. I fixed the velocity issue. I used the custom projectile movement. Sorry for all these questions but needs must.

        So, for any pool object, the standard Lifespan of the object should be set to zero and the set the Object Pool lifespan to whatever?

        In your tutorial, you say that you can put an empty actor in to your level with the Pool component attached and how would I get a reference to that pool inside the NPC blueprint?

        Comment


          #94
          You simply get reference to empty actor then get its pool component; from there the component has a bunch of exposed functions including the custom spawn nodes.
          | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

          Comment


            #95
            This OBJ Pool plugin 1.3.5 has been updated to the Unreal 4.17 version;
            Submitted to Marketplace staff.
            | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

            Comment


              #96
              Back again.. [MENTION=434]BrUnO XaVIeR[/MENTION]

              Code:
              LogBlueprint:Error: [Compiler BP_BaseWeapon_Projectile] Error COMPILER ERROR: failed building connection with '{ S} Pool Actor Reference is not compatible with BP Projectile Reference.' at  Spawn Actor From Pool :: {S} Pool Actor
              LogBlueprint:Error: [Compiler BP_BaseWeapon_Projectile] Error This blueprint (self) is not a BP_Projectile_C, therefore ' Target ' must have a connection.
              LogBlueprint:Error: [Compiler BP_BaseWeapon_Projectile] Error Variable node  Get Mesh  uses an invalid target.  It may depend on a node that is not connected to the execution chain, and got purged.
              So BP Projectile inherits from OBJPoolActor, and the object (BP Projectile Pistol) I'm trying to spawn inherits from BP Projectile with the native parent class being OBJPoolActor. I'm attempting to get the mesh of the spawned BP Projectile Pistol to ignore the character it was spawned from (ignore actor etc.) but the compiler spits out an error that the link to the target mesh from the resulting spawned BP Projectile Pistol is not compatible with BP Projectile?


              Annoyingly, these error only show up in packaged builds and even in packaged builds that succeed, the collision of these pool actors do not behave the same way they behaved in the editor version.


              Edit: Yeah it won't let links to 'target' variables, components etc. because it defaults to a BP Projectile reference.
              Last edited by Cerebros; 08-19-2017, 03:18 PM.

              Comment


                #97
                Originally posted by Cerebros View Post
                Back again.. [MENTION=434]BrUnO XaVIeR[/MENTION]

                Code:
                LogBlueprint:Error: [Compiler BP_BaseWeapon_Projectile] Error COMPILER ERROR: failed building connection with '{ S} Pool Actor Reference is not compatible with BP Projectile Reference.' at  Spawn Actor From Pool :: {S} Pool Actor
                LogBlueprint:Error: [Compiler BP_BaseWeapon_Projectile] Error This blueprint (self) is not a BP_Projectile_C, therefore ' Target ' must have a connection.
                LogBlueprint:Error: [Compiler BP_BaseWeapon_Projectile] Error Variable node  Get Mesh  uses an invalid target.  It may depend on a node that is not connected to the execution chain, and got purged.
                So BP Projectile inherits from OBJPoolActor, and the object (BP Projectile Pistol) I'm trying to spawn inherits from BP Projectile with the native parent class being OBJPoolActor. I'm attempting to get the mesh of the spawned BP Projectile Pistol to ignore the character it was spawned from (ignore actor etc.) but the compiler spits out an error that the link to the target mesh from the resulting spawned BP Projectile Pistol is not compatible with BP Projectile?


                Annoyingly, these error only show up in packaged builds and even in packaged builds that succeed, the collision of these pool actors do not behave the same way they behaved in the editor version.


                Edit: Yeah it won't let links to 'target' variables, components etc. because it defaults to a BP Projectile reference.
                Please send me a google drive link to download a sample project where you have these errors so I can debug them myself.
                The gun should not be a pooled actor, it should just have a pool component attached which spawns bullets from the pool.
                | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                Comment


                  #98
                  Originally posted by BrUnO XaVIeR View Post
                  Please send me a google drive link to download a sample project where you have these errors so I can debug them myself.
                  The gun should not be a pooled actor, it should just have a pool component attached which spawns bullets from the pool.
                  I won't be able to give you my project, but when I'm not busy next week, I'll try replicate the error in a blank project. The Pool component isn't in the gun.


                  So, spawning BP Projectile Pistol wasn't working correctly, but spawning BP Projectile Sniper and BP Projectile Shotgun were working - exact same execution chain etc. I'm using different pools for each ammo type; so I thought that it was the Pistol Pool component that was the issue: remade it and no, it didn't effect anything. So, I just deleted BP Projectile Pistol and yes, it worked as it should have and is working. I'm guessing that when I was tweaking the Pistol Pool component, it somehow corrupted BP Projectile Pistol irreparably.

                  And...
                  Code:
                  LogBlueprint:Warning: ExposeOnSpawn ambiguity. Property 'StructProperty /Engine/Transient.REINST_BP_Projectile_C_231:InitialDirection', MetaData 'False', Flag 'True'
                  LogBlueprint:Warning: ExposeOnSpawn ambiguity. Property 'ObjectProperty /Engine/Transient.REINST_BP_Projectile_C_231:InstigatorController', MetaData 'False', Flag 'True'
                  LogBlueprint:Warning: ExposeOnSpawn ambiguity. Property 'ByteProperty /Engine/Transient.REINST_BP_Projectile_C_231:CollisionChannel', MetaData 'False', Flag 'True'
                  LogBlueprint:Warning: ExposeOnSpawn ambiguity. Property 'StructProperty /Engine/Transient.REINST_BP_Projectile_C_231:InitialDirection', MetaData 'False', Flag 'True'
                  LogBlueprint:Warning: ExposeOnSpawn ambiguity. Property 'ObjectProperty /Engine/Transient.REINST_BP_Projectile_C_231:InstigatorController', MetaData 'False', Flag 'True'
                  LogBlueprint:Warning: ExposeOnSpawn ambiguity. Property 'ByteProperty /Engine/Transient.REINST_BP_Projectile_C_231:CollisionChannel', MetaData 'False', Flag 'True'
                  LogBlueprint:Error: [Compiler BP_BaseWeapon_Projectile] Error COMPILER ERROR: failed building connection with '{ S} Pool Actor Reference is not compatible with BP Projectile Reference.' at  Spawn Actor From Pool :: {S} Pool Actor
                  LogBlueprint:Error: [Compiler BP_BaseWeapon_Projectile] Error This blueprint (self) is not a BP_Projectile_C, therefore ' Target ' must have a connection.
                  LogBlueprint:Error: [Compiler BP_BaseWeapon_Projectile] Error Variable node  Get Mesh  uses an invalid target.  It may depend on a node that is not connected to the execution chain, and got purged.
                  LogBlueprint:Warning: [Compiler BP_BaseWeapon_Projectile] Warning [0021.22] Compile of BP_BaseWeapon_Projectile failed. 3 Fatal Issue(s) 0 Warning(s) [in 15 ms] (/Game/GenericShooter/BlueprintLogic/Weapons/BP_BaseWeapon_Projectile.BP_BaseWeapon_Projectile)
                  LogBlueprint:Warning: [Compiler BP_BaseWeapon_Projectile] Warning [0021.22] Compile of BP_BaseWeapon_Projectile failed. 3 Fatal Issue(s) 1 Warning(s) [in 0 ms] (/Game/GenericShooter/BlueprintLogic/Weapons/BP_BaseWeapon_Projectile.BP_BaseWeapon_Projectile)
                  LogBlueprint:Warning: [Compiler BP_BaseWeapon_Projectile] Warning [0021.22] Compile of BP_BaseWeapon_Projectile failed. 3 Fatal Issue(s) 2 Warning(s) [in 0 ms] (/Game/GenericShooter/BlueprintLogic/Weapons/BP_BaseWeapon_Projectile.BP_BaseWeapon_Projectile)
                  It's broken again except this time, the BP Projectile Shotgun isn't working. Closed it down and opened it up to see if all errors were gone...

                  Comment


                    #99
                    Unreal is still causing these blueprint corruptions in projects quite frequently for everyone;
                    The projects i've worked on they decided to base most development in code instead to avoid dealing with BP corruption on important gameplay features because of this. it's usually a mix of redirectors going crazy + slow HDD write in critical situations.
                    | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                    Comment


                      Originally posted by BrUnO XaVIeR View Post
                      Unreal is still causing these blueprint corruptions in projects quite frequently for everyone;
                      The projects i've worked on they decided to base most development in code instead to avoid dealing with BP corruption on important gameplay features because of this. it's usually a mix of redirectors going crazy + slow HDD write in critical situations.
                      So you don't have any idea why this is happening? It works completely fine in the editor and when it is packaged it throws up the error and I do get a warning about

                      Code:
                      UATHelper: Packaging (Windows (64-bit)): Cook: LogInit:Display: LogTemp:Warning: {S}:: Initializing Object-Pool Plugin.

                      Comment


                        Originally posted by Cerebros View Post

                        So you don't have any idea why this is happening? It works completely fine in the editor and when it is packaged it throws up the error and I do get a warning about

                        Code:
                        UATHelper: Packaging (Windows (64-bit)): Cook: LogInit:Display: LogTemp:Warning: {S}:: Initializing Object-Pool Plugin.
                        That warning I've put it there myself. it's just a basic log, nothing special happening because of this.
                        To know what is going on with your project, I'd need code to examine, I can't do anything without error logs or a project where you can reproduce the error you see because in every project I setup this plugin I don't see the error you describe above.

                        I will try to patch this based on the logs you post there, but I can't guaratee this is going to solve your problem since, again, there's nowhere I can see or test the error you posted.
                        | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                        Comment


                          Originally posted by Cerebros View Post
                          Code:
                          LogBlueprint:Error: [Compiler BP_BaseWeapon_Projectile] Error COMPILER ERROR: failed building connection with '{ S} Pool Actor Reference is not compatible with BP Projectile Reference.' at Spawn Actor From Pool :: {S} Pool Actor
                          LogBlueprint:Error: [Compiler BP_BaseWeapon_Projectile] Error This blueprint (self) is not a BP_Projectile_C, therefore ' Target ' must have a connection.
                          LogBlueprint:Error: [Compiler BP_BaseWeapon_Projectile] Error Variable node Get Mesh uses an invalid target. It may depend on a node that is not connected to the execution chain, and got purged.
                          It's broken again except this time, the BP Projectile Shotgun isn't working. Closed it down and opened it up to see if all errors were gone...
                          So is this solved for you or do you still have this problem?
                          I quite don't get your post; those logs look like you are trying to use object pool component with a class that is not a child of Pooled Actor class.
                          Please show at least screenshots of your blueprints and its parent settings. I can't help you in the dark like this, you need to share more info or repo project.

                          Seems like you have a lot of confusion between C++ classes, Blueprint classes, their parents, what should be a child of APooledActor and what shouldn't and then what should be connected the "Object Pool" pin on the spawn node. I've just re-tested the code I see none of the issue you post in all projects I packaged exe game.
                          | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                          Comment


                            Epic just released plugin for Unreal 4.17 today.
                            | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                            Comment


                              Originally posted by BrUnO XaVIeR View Post

                              So is this solved for you or do you still have this problem?
                              I quite don't get your post; those logs look like you are trying to use object pool component with a class that is not a child of Pooled Actor class.
                              Please show at least screenshots of your blueprints and its parent settings. I can't help you in the dark like this, you need to share more info or repo project.

                              Seems like you have a lot of confusion between C++ classes, Blueprint classes, their parents, what should be a child of APooledActor and what shouldn't and then what should be connected the "Object Pool" pin on the spawn node. I've just re-tested the code I see none of the issue you post in all projects I packaged exe game.
                              I'm trying to recreate the bug in a stripped down version of my project but it hasn't appeared yet. I don't think it has anything to do with my competency because everything is working correctly as it should. The problem is when for an unknown reason it won't compile the executable when packaging the game citing wrongly that an object isn't a child of its parent class and it is breaking a link to the spawn node every time I close and re-open the project: the link to define the instigating controller.

                              If I implemented it incorrectly, it wouldn't work right?





                              Attached Files

                              Comment


                                Originally posted by Cerebros View Post
                                The problem is when for an unknown reason it won't compile the executable when packaging the game citing wrongly that an object isn't a child of its parent class
                                Can you share the log you get that message from the engine when packaging?
                                Epic changes a lot of things in engine from version to version; this may be something I just didn't catch when upgrading plugin to 4.17.


                                Edit:
                                Btw, I just created again a fresh project and again no luck; this is my "Cook for Windows" output log:
                                Code:
                                UATHelper: Cooking (Windows): Cook: LogInit: Display: Warning/Error Summary (Unique only)
                                UATHelper: Cooking (Windows): Cook: LogInit: Display: -----------------------------------
                                UATHelper: Cooking (Windows): Cook: LogInit: Display: LogTemp: Warning: {S}:: Initializing Object-Pool Plugin.
                                UATHelper: Cooking (Windows): Cook: LogInit: Display:
                                UATHelper: Cooking (Windows): Cook: LogInit: Display: Success - 0 error(s), 1 warning(s)
                                UATHelper: Cooking (Windows): Cook: LogInit: Display:
                                UATHelper: Cooking (Windows): Cook:
                                UATHelper: Cooking (Windows): Cook: Execution of commandlet took:  44.45 seconds
                                UATHelper: Cooking (Windows): Cook: LogOnline: Display: Unloading online subsystem: NULL
                                UATHelper: Cooking (Windows): CommandUtils.Run: Run: Took 72,0142072s to run UE4Editor-Cmd.exe, ExitCode=0
                                UATHelper: Cooking (Windows): Project.Cook: ********** COOK COMMAND COMPLETED **********
                                UATHelper: Cooking (Windows): Automation.Execute: BUILD SUCCESSFUL
                                UATHelper: Cooking (Windows): Program.Main: AutomationTool exiting with ExitCode=0 (Success)
                                The warnings there are the ones I fire them myself from the plugin for convenience, so still I did not see the error you describe which is annoying because I hate hidden bugs :/
                                Last edited by BrUnO XaVIeR; 09-06-2017, 07:51 AM.
                                | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                                Comment

                                Working...
                                X