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

Refactor Carry-all logic so that "bringing new unit" and "transferring existing unit" is the same #584

Open
stefanhendriks opened this issue Jan 25, 2023 · 0 comments
Labels
improvement Quality of life or general improvement of a game mechanic refactoring Refactor work, will not be a new feature immediately, use with caution
Projects

Comments

@stefanhendriks
Copy link
Owner

Atm the code has a distinction for carry-all's bringing a new unit (it will spawn a new unit when it is at the destination) - or when transferring an existing unit (it remembers the ID of the unit being transferred, the unit that is being transferred is in a 'sort of dead' state, which is used to make it disappear on the map and not interact with other units/bullets/etc).

I think a better way would be to have a unit always spawned, then make it being transferred. Meaning, when a 'new' unit has to be brought to the map (ie a Harvester to a refinery), it should already be spawned. This makes the "how many harvesters do I have" logic a lot easier too when not having to deal with the weird "new to be spawned unit type" edge case.

And, even better, we might be even be able to make a carry-all to bring over more than 1 unit. Simply by having a vector of unit ids to bring over instead of 1 id. (used for OG Dune 2 reinforcements).

@stefanhendriks stefanhendriks added refactoring Refactor work, will not be a new feature immediately, use with caution improvement Quality of life or general improvement of a game mechanic labels Jan 25, 2023
@stefanhendriks stefanhendriks added this to Backlog in D2TM via automation Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Quality of life or general improvement of a game mechanic refactoring Refactor work, will not be a new feature immediately, use with caution
Projects
Status: Backlog
D2TM
  
Backlog
Development

No branches or pull requests

1 participant