Originally posted by BrUnO XaVIeR
View Post
Announcement
Collapse
No announcement yet.
Plugin Object Pool Component
Collapse
X
-
Originally posted by Cerebros View PostYeah, 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?
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.
Comment
-
Originally posted by BrUnO XaVIeR View PostA 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.
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
-
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.
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
-
Originally posted by Cerebros View PostBack 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.
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.
The gun should not be a pooled actor, it should just have a pool component attached which spawns bullets from the pool.
Comment
-
Originally posted by BrUnO XaVIeR View PostPlease 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.
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)
Comment
-
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.
Comment
-
Originally posted by BrUnO XaVIeR View PostUnreal 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.
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.
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.
Comment
-
Originally posted by Cerebros View PostCode: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.
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.
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.
If I implemented it incorrectly, it wouldn't work right?
Comment
-
Originally posted by Cerebros View PostThe 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
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)
Last edited by BrUnO XaVIeR; 09-06-2017, 07:51 AM.
Comment
Comment