npruehs / ue4-rts

Real-time strategy plugin and showcase for Unreal Engine 4.
MIT License
747 stars 151 forks source link

UE4.25 support #113

Closed JaredP94 closed 4 years ago

JaredP94 commented 4 years ago

Hi @npruehs,

This pull request adds plugin support for 4.25.

Also includes:

npruehs commented 4 years ago

Is there any way of preserving compatibility with UE 4.24? :) Maybe we should introduce helper functions for this.

JaredP94 commented 4 years ago

I've done some backward compatibility testing and it appears there are two unsupported changes:

  1. Removing the SelfActor key from affected tasks/decorators where the workaround in #112 was discussed. The method of getting the AI controller and it's controller pawn still works as expected, however, the task/decorator seemingly becomes invalid if the SelfActor key is not present (even though unused). I'll add the key back into the affected tasks/decorators to remedy this.

  2. The deprecated bIsABot call on line 60 of RTSGameplayLibrary.cpp.

    An engine version check solves this:

    #if ENGINE_MINOR_VERSION < 25 return OwnerComponent->GetPlayerOwner() && OwnerComponent->GetPlayerOwner()->bIsABot; #else return OwnerComponent->GetPlayerOwner() && OwnerComponent->GetPlayerOwner()->IsABot(); #endif

    Should you want to move this to a helper function, would you want to create a utility class or keep the function localised to the affected class since it's a single occurrence?

npruehs commented 4 years ago

Thanks for checking, and thanks for adding the SelfActor key back!

I thought about adding a utility class, and which one(s) (e.g. one utility class per engine version, one per feature domain, or none at all).

In this case, with that single instance, let's do it with just a single helper function right there, and see how this goes in the future :)

Thanks!

JaredP94 commented 4 years ago

I've made the changes to the tasks/decorators and was able to successfully use them in both 4.24 and 4.25.

I've also added the helper function as discussed so all should be in order with cross-version support.

Please let me know if there's anything else you'd like to look into before accepting the changes :)

npruehs commented 4 years ago

Fabulous! Thanks for even updating the documentation images! :)

Thanks for everything!