Skip to content
This repository has been archived by the owner on Sep 19, 2022. It is now read-only.

Refactor System Marker Components and Rename Creeps #53

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

owen-mccormick
Copy link
Collaborator

@owen-mccormick owen-mccormick commented Feb 11, 2021

Description

This PR replaces separate marker components for different movement and proximity attack systems with individual enum components. Ultimately, this will help reduce the number of components that certain systems need access to and mitigate the issues caused by the argument limit on systems. A minor naming change from creeps to pawns was also performed.

@owen-mccormick owen-mccormick changed the title Refactor Movement and Proximity Attack System Marker Components Refactor System Marker Components and Rename Creeps Feb 12, 2021
Copy link
Contributor

@AnneKitsune AnneKitsune left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice PR!
However, I have some doubts on the merging of the two components into an enum. I'm wondering if it would be possible to split the movement and attack components into multiple, smaller components and systems. For example, if we look at the leader2_simple_movement_system, we see that a good part of the code is duplicated.
We could split those into a Caught System and Movement system. Furthermore, I can barely see a difference between the leader's movement system and the pawn's movement system.
The two difference I see are:

  • different targeting ranges (we can use a variable in the component for this, and a second, more specific system to override the default movement system's behavior after it has run).
  • Only one of them takes action points into account. I assume this is a bug? I think it could be worth looking into a way where we could separate the movement systems (setting the destination target) and handling action points for movement (consuming points if a movement target is set, and removing it for this frame if not enough action points are available.)

Let me know what you think!

if let Some((target, _)) = closest {
let damage = stat.unwrap().stats.get(&Stats::Attack).unwrap().value;
v.push((e.unwrap().clone(), target.clone(), damage));
if let ProximityAttackSystems::Leader1ProximityAttack(radius) = proximity.unwrap() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that the component/enum contains the word Systems is quite confusing. Could we change it to something else?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants