Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pirate squad system refactor #17

Open
Razoric480 opened this issue Feb 28, 2020 · 1 comment
Open

Pirate squad system refactor #17

Razoric480 opened this issue Feb 28, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@Razoric480
Copy link
Collaborator

Razoric480 commented Feb 28, 2020

Currently, the way the pirates coordinate between one another is a little awkward. You have a squad leader, and different behaviors are used in the same state machine state depending on whether a pirate is a squad leader or not.

When a leader dies, this leads to situations where the state has to be 'reset' so that new behaviors are recreated, and the correct signals connected to.

Alternative ideas

  • Double up states: You have leader states and squaddie states. When a new leader is selected, he transitions to the leader-version of his currently assigned state. The squaddies don't need to change - they are just waiting for a signal to switch to rest/patrol/attack.
  • Overseer: Squads are built inside of a squad controller parent object. It is the squad leader, in effect, as a nebulous overseer entity over the squad. All squaddies are followers, but follow-the-leader style behaviors are configured by the overseer.

The former would be simple in implementation, while the second one could help with extension down the line or more complex behaviors if the game expands that far.

Since, ultimately, it'd be nice to have pirates that do different jobs - attackers, miners and workers, transports that go to their own station, etc - the latter will probably be more useful in the long run.

@Razoric480 Razoric480 added the enhancement New feature or request label Feb 28, 2020
@Pomb
Copy link
Contributor

Pomb commented Aug 20, 2020

@Razoric480 This sounds like the same system that could be used for #27 Drones, where drones are squaddies - with a different set of behaviours and where the player is set as the Leader.
I imagine you could have a property on a ship/drone that allows it to be a leader, so that when a leader dies, the squad can get notified and a new leader can be chosen from those who are able.
This could be quite interesting, because it means if you killed a leader and there's no ship in the squad that is capable the ships can disperse and become angry lone wolves, lost in the belt, much easier to fight one ship at a time, would give fighting an tactic of trying to kill the leader first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants