OpenPF2 / Plugin

Core C++ Game Logic for OpenPF2 (Status: Pre-alpha)
https://www.openpf2.org/
Other
23 stars 6 forks source link

[Developers] Refactor Encounter MoPRS Logic into AI Behavior Trees and Command Pattern Queuing #23

Closed GuyPaddock closed 1 year ago

GuyPaddock commented 2 years ago

As a Developer maintaining OpenPF2, I wish that the pattern we were following for queuing and executing actions during encounters was more straightforward and broken into smaller, easier to understand components so that I am not working around quirks and limitations in deferring execution of a Gameplay Ability.

Acceptance Criteria

Given I'm a Developer who needs to invoke a character action that respects queuing:

  1. Rather than instantiating the target ability directly, I'd expect to be able to create a Command object that wraps the action I'm invoking.
  2. I'd expect to be able to queue the Command object up through the MoPRS.
  3. I'd expect the MoPRS to either execute or queue the Command.
  4. Given the MoPRS opts to queue the Command:
    1. Rather than the MoPRS maintaining its own queue of Commands, I'd expect there to be a component within the PF2 Character that maintains the queue of Commands for the character.
    2. I'd expect the MoPRS to queue-up the Command in the character's queue.
  5. Given the MoPRS executes the Command:
    1. I'd expect the Command to instantiate the Gameplay Ability (GA).
    2. I'd expect the Command to confirm the source Character is eligible to perform the GA.
    3. I'd expect the Command to execute the GA on the Character.