Blizzard / s2client-proto

StarCraft II Client - protocol definitions used to communicate with StarCraft II.
MIT License
3.76k stars 431 forks source link

Add energy cost to AbilityData #32

Open Dentosal opened 6 years ago

Dentosal commented 6 years ago

Currently there seems to be no way to find out how much energy using an ability costs

Cost itself is already mentioned in a comment in data.proto. I suppose this means energy cost, because for building units and researching upgrades the cost data is already available, and for others there is no mineral or vespene cost:

// Stuff that may be important: cost, range, Alignment, targetfilters.
KevinCalderone commented 6 years ago

Yes it looks like we are missing energy cost currently. Good suggestion.

To be more general, maybe we should have a health cost too. (eg. Stim)

kuzi117 commented 6 years ago

Would it be better to have an additional field that specifies what resource it's using? Are there any other resources than energy and health and is health only used by stim? I can't think of anything else.

Dentosal commented 6 years ago

Void Ray slowdown?

kuzi117 commented 6 years ago

Err, I think there's no cost associated with Prismatic Alignment beyond the cooldown. I figure the slowdown is an effect and not a cost.

Dentosal commented 6 years ago

That sounds right. How about archon merge, Zerg morphs and nuke calldown, that result to loss of other units? Probably not an issue either, since it should be quite clear what happens with those.

kuzi117 commented 6 years ago

I feel like nuke calldown is interesting because nukes could be considered a resource, but it's a global resource instead of per unit. Merge and morph are interesting, I'm not sure if the unit could be considered a "cost" in this sense though. Perhaps there's something different that could specify it? Maybe for archons is makes sense because it costs "another unit" but otherwise don't have a cost. You bring up another good point with morphs though. Morphing is an ability that costs minerals/gas. I believe the definition for abilities they gave also includes things like Terran buildings creating attachments. Those also have an associated cost.

Dentosal commented 6 years ago

All Zerg morphs create a new unit that cannot be obtained otherwise (at least currently), and you can always check the cost of the new unit. GameData contains repeated UnitTypeData field that contains following info on baneling:

unit_id: 9
name: "Baneling"
available: true
cargo_size: 2
attributes: Biological
movement_speed: 2.5
armor: 0.0
mineral_cost: 50
vespene_cost: 25

Other related case would be buildings. Do their abilities need to have the cost listed, or is it enough to be able to fetch it from the unit list. I think it is, but I'm not completely sure.

Dentosal commented 6 years ago

Another interesting case is Oracle energy: The ability itself costs 25 energy to activate, and then some energy per every second. Viper has similar ability, Consume. Both abilities take hp, but oracle targets moving units, and viper friendly structures. Moreover, Consume gives energy instead of reducing it, but that could just be marked with negative energy cost. Maybe using two values, energy_cost and energy_cost_per_second could be possible?

noxiaz commented 5 years ago

Would still be nice getting an energy_cost for an ability :)