Building Ability System on Mover Plugin and NPP

I’m trying to use the latest Mover plugin with Network Prediction Plugin as its backend, but I am not sure how to build a compatible ability system with it. It seems like there are multiple ways to do so:

  1. There is a MockFlyingAbilityComponent example in the NP Extras plugin, but the show case ability is movement related, so it inherited the NP component which implenments NP related functions like ProduceInput, FinalizeFrame etc.. Its InputCmd is derived from the corresponding InputCmd, so it contains all the input variables needed for handling movement. If I code my ability component like this, it would be coupled with the movement component.
  2. Build my own ability component like GAS:
    a. I can add the player input to InputCmd in MoverComponent, then pass to the SyncState (which isn’t ideal as the NPP indicated). Get the input from SyncState if it is controlled by player, and from AI if it is not. This will require the ability system do the rollback itself.
    b. Implement ability component inside NPP, this would require extra InputCmd and SyncState to be set up. AI controlled actors with ability should all be managed by NPP, this can cause lots of overhead because NPP constantly checks ProduceInput every tick. Binding more than one ProduceInput on one character causes more overhead on NPP tick for player controlled characters. Also, ticking order between Mover, ability system and other world actor would be messy, since AI and most other module of the engine ticks after NPP.

I really want to explore more with NPP and its reliable network rollback system, but it is way too complicated for me if I want to build any gameplay codes besides the movement system. I am sincerely appreciated if anyone shares more idea on this topic.

1 Like