Mr-Craig / AsyncTickPhysics

Access UE5s Async Physics event using C++ or Blueprints
76 stars 14 forks source link

Packaging problem in UE 5.4 when class is other then AsyncTickPawn #16

Open topyra opened 3 months ago

topyra commented 3 months ago

It is not an issue at all, but I think it may be helpful for others (I wasted few hours to find this) It seems to not exists in 5.2, only in 5.4. It is not a ATP plugin issue, because documentation is clear for using AsyncTickPawn to get an access to ATP functions, but it is easy to forgot about reparent class, and since it still works in editor it is hard to notice until building a package.

When class that DO NOT inherits from AsyncTickPawn use ATP Get Transform (possibly any other ATP function), everything still works fine when playing in editor, but when I try to do package build I got an errors:

UATHelper: Packaging (Windows): LogInit: Display: LogBlueprint: Error: [Compiler] In use pin  Component  no longer exists on node  ATP Get Transform . Please refresh node or break links to remove pin. from Source: /Game/ThirdPerson/Blueprints/BP_ThirdPersonCharacter.BP_ThirdPersonCharacter
UATHelper: Packaging (Windows): LogInit: Display: LogBlueprint: Error: [Compiler] In use pin  Return Value  no longer exists on node  ATP Get Transform . Please refresh node or break links to remove pin. from Source: /Game/ThirdPerson/Blueprints/BP_ThirdPersonCharacter.BP_ThirdPersonCharacter
UATHelper: Packaging (Windows): LogInit: Display: LogBlueprint: Error: [Compiler] Could not find a function named "ATP_GetTransform" in 'BP_ThirdPersonCharacter'.
UATHelper: Packaging (Windows): Make sure 'BP_ThirdPersonCharacter' has been compiled for  ATP Get Transform from Source: /Game/ThirdPerson/Blueprints/BP_ThirdPersonCharacter.BP_ThirdPersonCharacter
UATHelper: Packaging (Windows): LogInit: Display: LogPluginManager: Warning: Plugin 'AsyncTickPhysics' requires engine version '5.2.0' and may not be compatible with the current current engine version '5.4.0-33043543+++UE5+Release-5.4'
UATHelper: Packaging (Windows): LogInit: Display: LogLinker: Warning: [AssetLog] C:\Users\topyr\Documents\Unreal Projects\Sandbox54\Content\ThirdPerson\Blueprints\BP_ThirdPersonCharacter.uasset: VerifyImport: Failed to find script package for import object 'Package /Script/AsyncTickPhysics'

In 5.2 with same example (example third person game with ATP* functions used in main character blueprint) works.

I verified behavior in simple Pawn class with only one sphere mesh and it can be reproduced. When class is "Pawn" I got an errors during packaging. When class is reparented to AsyncTickPawn - everything works.

Suggestion is to do something in future version that would fail to build also in editor when ATP function is used outside AsyncTickPawn class.

My configuration: UE5 Version: 5.4.3-34507850+++UE5+Release-5.4 Platform: Windows 10 (22H2) [10.0.19045.4651] (x86_64) ATP v1.0.7 installed into project Plugin directory and rebuilt for 5.4 (automatically during start).

topyra commented 3 months ago

After deeper check, it looks like it is an issue.

In case when ATP* functions are used in Actor Component, issue occurs causing errors when game is packaged as release in UE5.4. So even when owner is Async Tick Pawn, but use Actor Component that use any of ATP function - packaging would fail.

It worked in UE5.2, does not work in 5.4.3-34507850+++UE5+Release-5.4

Mr-Craig commented 2 months ago

you shouldn't need to parent to asynctickpawn outside of unreal 5.0 because the async tick is exposed in newer versions, its only the older versions of the engine.

topyra commented 2 months ago

you shouldn't need to parent to asynctickpawn

Fully agree and in PIE env everything works. I found only issue with packaging game.

Exact error message is (When BP_Cone is Actor class) UATHelper: Packaging (Windows): LogInit: Display: LogBlueprint: Error: [Compiler] In use pin no longer exists on node ATP Add Impulse . Please refresh node or break links to remove pin. from Source: /Game/Assets/BP_Cone.BP_Cone UATHelper: Packaging (Windows): LogInit: Display: LogBlueprint: Error: [Compiler] In use pin Component no longer exists on node ATP Add Impulse . Please refresh node or break links to remove pin. from Source: /Game/Assets/BP_Cone.BP_Cone UATHelper: Packaging (Windows): LogInit: Display: LogBlueprint: Error: [Compiler] Could not find a function named "ATP_AddImpulse" in 'BP_Cone'.

Changing base class of BP_Cone to Async Tick Pawn - fixes the problem.

But this fix can't be done for classes that have to derive from other classes - like "Actor component"

Funny thing is that seems to be not related to Async Tick Pawn itself, but rather to compilation order, includes and all that hell around.

I declared empty class in AsyncTickPawn.h: `UCLASS(BlueprintType) class ASYNCTICKPHYSICS_API ANotAsyncTickPawn : public APawn { GENERATED_BODY()

public:

};`

And when BP_Cone derives from NotAsyncTickPawn - it works ok. When it derives from Pawn - package fails.

Hi-Im-Ghost commented 2 weeks ago

Has anyone found a solution? I have the same problem and unfortunately but I have to solve it because I have to build a project. It mainly occurs in widgets, which unfortunately cannot be changed to asyncpawn.