Blizzard / Blizzard/s2client-api

Additional Information Required in UnitTypeData

Open
#158 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
1.7k
Forks
280
PR merge metrics
No merged PRs in 30d

Description

One piece of critical information remaining to include in the API is to query which unit type performs a given ability. This is necessary to deduce which unit builds a building, trains a unit, etc, which is necessary for build order functionality. Currently Command Center hard-codes a huge table of relevant values, for which this is the only remaining value that currently isn't in the API.

I think that the best place to put this would be in the corresponding AbilityData entry. It may also need to be a vector since in some cases, multiple unit types can perform the same Ability: for example, a Hatchery and a Lair can both research Burrow (or at least they could in BW).

Similarly, it would be beneficial to also annotate UnitTypeID with a corresponding UnitTypeID for what builds the given type (ex: probe builds pylon). This could be inferred from the type's ability, but that's a pretty annoying 2-step query to make so it might be worth it to include this separately for units.

**Edit**: Merging this issue with additional requested information, as follows:

Right now, each UnitTypeData has a tech_requirement field. However, there are two separate prerequisite types for building units: buildings, and upgrades, for example:

Dark Templar requires a DT shrine to build.
Warp Gate requires sc2::UPGRADE_ID::WARPGATERESEARCH to build

I think there should be two separate fields to distinguish this for completeness. Also, tech_requirement is a bit of a misnomer since there aren't any 'techs' in the api, just unit types or upgrades. I suggest that UnitTypeData have the following fields:

required_unit_types = vector of unit types required to build the given unit type
required_upgrades = vector of upgrade types required to build the given unit type

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.