GraylinKim / sc2reader

A python library that extracts data from various Starcraft II resources to power tools and services for the SC2 community. Who doesn't want to hack on the games they play?
http://sc2reader.readthedocs.org
MIT License
413 stars 85 forks source link

Count in UpdateCompleteEvent #171

Closed EHadoux closed 10 years ago

EHadoux commented 10 years ago

Hi,

sorry to bother you with all my questions (it won't be the last unfortunately). What is the purpose of the field countin UpdateCompleteEvent? Moreover, some names are awkward like PunisherGrenades -> ConcusiveShells instead?

Thank you very much,

Emmanuel

GraylinKim commented 10 years ago

I believe that count is the number of times the upgrade has been researched by that player.

The names are weird because they are the ability names that Blizzard uses internally. PunisherGrenades was probably the working name in development and they just never saw fit to change the internal name references.

One day I might introduce an ability name map so that people have more familiar names to work with. I'm leaving this issue open because I've realized that the tracker events documentation isn't generating correctly.

EHadoux commented 10 years ago

I believe that count is the number of times the upgrade has been researched by that player.

You mean that if I launch +1 Melee, cancel, relaunch, wait for completion and check for count it should be 2? I could figure it out myself but I cannot launch SC2 atm.

One day I might introduce an ability name map so that people have more familiar names to work with.

I began to do that in the UpgradeTracker plugin I will soon put on pull request but I had hard time to select names. I mean, for instance for the Metabolic Boost, some people will call it ZerglingSpeed, others Speedlings, etc.

GraylinKim commented 10 years ago

You can design an upgrade to have multiple levels in the Galaxy Editor. If you do, I believe that count will be the number of times the upgrade has been completed. I believe that SC2 uses a chain of single level upgrades instead of one 3 level upgrade. Not 100% sure that count works the way described above tough so please look into it and let me know what you find.

As far as name mappings, the only mapping I'd accept a pull for right now would use the enUS in game names. Mapping one informal name to another isn't that useful imo.

EHadoux commented 10 years ago

As far as name mappings, the only mapping I'd accept a pull for right now would use the enUS in game names. Mapping one informal name to another isn't that useful imo.

I dived into it and it's a complete mess. For instance we have: ResearchCombatShield when launched and ShieldWall when completed, ResearchConcussiveShells when launched and PunisherGrenades when completed, etc, but some are coherent like ResearchCharge and Charge.

GraylinKim commented 10 years ago

Yes, you should assume that there is no correlation between the name of the upgrade and the name of the command that researches it. Two separate maps would be needed to make them predictable and sane.

StoicLoofah commented 10 years ago

I saw you have the pull request to simplify some of the changes in naming over time. If it helps to get it human-readable, however, here's the mapping I use in Spawning Tool:

BUILD_OBJECT_NAMES = {
    'Archon': 'Archon',
    'Armory': 'Armory',
    'Assimilator': 'Assimilator',
    'Baneling': 'Baneling',
    'BanelingCocoon': 'Baneling',
    'BanelingNest': 'Baneling Nest',
    'Banshee': 'Banshee',
    'BansheeCloak': 'Cloaking Field',
    'Barracks': 'Barracks',
    'BarracksFlying': 'Barracks',
    'BarracksReactor': 'Barracks Reactor',
    'BarracksTechLab': 'Barracks Tech Lab',
    'Battlecruiser': 'Battlecruiser',
    'BattlecruiserBehemothReactor': 'Behemoth Reactor',
    'BattleHellion': 'Hellbat',
    'BlinkTech': 'Blink',
    'BroodlingEscort': 'Broodling Escort',
    'BroodLord': 'Brood Lord',
    'BroodLordCocoon': 'Brood Lord Cocoon',
    'Bunker': 'Bunker',
    'Burrow': 'Burrow',
    'Carrier': 'Carrier',
    'CentrificalHooks': 'Centrifical Hooks',
    'ChangelingZealot': 'Changeling',
    'ChangelingZergling': 'Changeling',
    'ChangelingZerglingWings': 'Changeling',
    'ChangelingMarine': 'Changeling',
    'ChangelingMarineShield': 'Changeling',
    'Charge': 'Charge',
    'ChitinousPlating': 'Chitinous Plating',
    'Colossus': 'Colossus',
    'CommandCenter': 'Command Center',
    'CommandCenterFlying': 'Command Center',
    'Corruptor': 'Corruptor',
    'CreepTumorBurrowed': 'Creep Tumor',
    'CyberneticsCore': 'Cybernetics Core',
    'DarkShrine': 'Dark Shrine',
    'DarkTemplar': 'Dark Templar',
    'DrillClaws': 'Drilling Claws',
    'Drone': 'Drone',
    'DroneBurrowed': 'Drone',
    'DurableMaterials': 'Durable Materials',
    'EngineeringBay': 'Engineering Bay',
    'EvolutionChamber': 'Evolution Chamber',
    'ExtendedThermalLance': 'Extended Thermal Lance',
    'Extractor': 'Extractor',
    'Factory': 'Factory',
    'FactoryFlying': 'Factory',
    'FactoryReactor': 'Factory Reactor',
    'FactoryTechLab': 'Factory Tech Lab',
    'FleetBeacon': 'Fleet Beacon',
    'Forge': 'Forge',
    'FusionCore': 'Fusion Core',
    'Gateway': 'Gateway',
    'Ghost': 'Ghost',
    'GhostAcademy': 'Ghost Academy',
    'GhostMoebiusReactor': 'Moebius Reactor',
    'GlialReconstitution': 'Glial Reconstitution',
    'GraviticDrive': 'Gravitic Drive',
    'GreaterSpire': 'Greater Spire',
    'haltech': 'haltech',
    'Hatchery': 'Hatchery',
    'Hellion': 'Hellion',
    'HighCapacityBarrels': 'Infernal Pre-Igniter',
    'HighTemplar': 'High Templar',
    'HiSecAutoTracking': 'Hi-Sec Auto Tracking',
    'Hive': 'Hive',
    'Hydralisk': 'Hydralisk',
    'HydraliskDen': 'Hydralisk Den',
    'hydraliskspeed': 'Grooved Spines',
    'HydraliskSpeedUpgrade': 'Muscular Augments',
    'Immortal': 'Immortal',
    'InfestationPit': 'Infestation Pit',
    'Infestor': 'Infestor',
    'InfestorBurrowed': 'Infestor',
    'InfestorEnergyUpgrade': 'Pathogen Glands',
    'Lair': 'Lair',
    'Locust': 'Locust',
    'LocustLifetimeIncrease': 'Enduring Locusts',
    'Marauder': 'Marauder',
    'Marine': 'Marine',
    'Medivac': 'Medivac',
    'MedivacCaduceusReactor': 'Caduceus Reactor',
    'MissileTurret': 'Missile Turret',
    'MothershipCore': 'Mothership Core',
    'Mutalisk': 'Mutalisk',
    'NeosteelFrame': 'Neosteel Frame',
    'Nexus': 'Nexus',
    'NydusCanal': 'Nydus Canal',
    'NydusNetwork': 'Nydus Network',
    'Observer': 'Observer',
    'ObserverGraviticBooster': 'Observer Gravitic Boosters',
    'Oracle': 'Oracle',
    'OrbitalCommand': 'Orbital Command',
    'OrbitalCommandFlying': 'Orbital Command',
    'Overlord': 'Overlord',
    'overlordspeed': 'Pneumatized Carapace',
    'overlordtransport': 'Ventral Sacs',
    'Overseer': 'Overseer',
    'PersonalCloaking': 'Personal Cloaking',
    'Phoenix': 'Phoenix',
    'PhoenixRangeUpgrade': 'Anion Pulse-Crystals',
    'PhotonCannon': 'Photon Cannon',
    'PlanetaryFortress': 'Planetary Fortress',
    'Probe': 'Probe',
    'ProtossAirArmorsLevel1': 'Protoss Air Armor Level 1',
    'ProtossAirArmorsLevel2': 'Protoss Air Armor Level 2',
    'ProtossAirArmorsLevel3': 'Protoss Air Armor Level 3',
    'ProtossAirWeaponsLevel1': 'Protoss Air Weapons Level 1',
    'ProtossAirWeaponsLevel2': 'Protoss Air Weapons Level 2',
    'ProtossAirWeaponsLevel3': 'Protoss Air Weapons Level 3',
    'ProtossGroundArmorsLevel1': 'Protoss Ground Armor Level 1',
    'ProtossGroundArmorsLevel2': 'Protoss Ground Armor Level 2',
    'ProtossGroundArmorsLevel3': 'Protoss Ground Armor Level 3',
    'ProtossGroundWeaponsLevel1': 'Protoss Ground Weapons Level 1',
    'ProtossGroundWeaponsLevel2': 'Protoss Ground Weapons Level 2',
    'ProtossGroundWeaponsLevel3': 'Protoss Ground Weapons Level 3',
    'ProtossShieldsLevel1': 'Protoss Shields Level 1',
    'ProtossShieldsLevel2': 'Protoss Shields Level 2',
    'ProtossShieldsLevel3': 'Protoss Shields Level 3',
    'PsiStormTech': 'Psionic Storm',
    'PunisherGrenades': 'Concussive Shells',
    'Pylon': 'Pylon',
    'Queen': 'Queen',
    'QueenBurrowed': 'Queen',
    'Raven': 'Raven',
    'RavenCorvidReactor': 'Corvid Reactor',
    'Reactor': 'Reactor',
    'Reaper': 'Reaper',
    'Refinery': 'Refinery',
    'Roach': 'Roach',
    'RoachBurrowed': 'Roach',
    'RoachWarren': 'Roach Warren',
    'RoboticsBay': 'Robotics Bay',
    'RoboticsFacility': 'Robotics Facility',
    'SCV': 'SCV',
    'SensorTower': 'Sensor Tower',
    'Sentry': 'Sentry',
    'ShieldWall': 'Combat Shields',
    'SiegeTank': 'Siege Tank',
    'SiegeTankSieged': 'Siege Tank',
    'SpawningPool': 'Spawning Pool',
    'SpineCrawler': 'Spine Crawler',
    'SpineCrawlerUprooted': 'Spine Crawler',
    'Spire': 'Spire',
    'SporeCrawler': 'Spore Crawler',
    'SporeCrawlerUprooted': 'Spore Crawler',
    'Stalker': 'Stalker',
    'Stargate': 'Stargate',
    'Starport': 'Starport',
    'StarportFlying': 'Starport',
    'StarportReactor': 'Starport Reactor',
    'StarportTechLab': 'Starport Tech Lab',
    'Stimpack': 'Stimpack',
    'StrikeCannons': '250mm Strike Cannons',
    'SupplyDepot': 'Supply Depot',
    'SupplyDepotLowered': 'Supply Depot',
    'SwarmHost': 'Swarm Host',
    'SwarmHostBurrowed': 'Swarm Host',
    'TechLab': 'Tech Lab',
    'Tempest': 'Tempest',
    'TemplarArchive': 'Templar Archives',
    'TerranBuildingArmor': 'Building Armor',
    'TerranInfantryArmorsLevel1': 'Terran Infantry Armor Level 1',
    'TerranInfantryArmorsLevel2': 'Terran Infantry Armor Level 2',
    'TerranInfantryArmorsLevel3': 'Terran Infantry Armor Level 3',
    'TerranInfantryWeaponsLevel1': 'Terran Infantry Weapons Level 1',
    'TerranInfantryWeaponsLevel2': 'Terran Infantry Weapons Level 2',
    'TerranInfantryWeaponsLevel3': 'Terran Infantry Weapons Level 3',
    'TerranShipArmorsLevel1': 'Terran Ship Armor Level 1',
    'TerranShipArmorsLevel2': 'Terran Ship Armor Level 2',
    'TerranShipArmorsLevel3': 'Terran Ship Armor Level 3',
    'TerranShipWeaponsLevel1': 'Terran Ship Weapons Level 1',
    'TerranShipWeaponsLevel2': 'Terran Ship Weapons Level 2',
    'TerranShipWeaponsLevel3': 'Terran Ship Weapons Level 3',
    'TerranVehicleAndShipWeaponsLevel1': 'Terran Vehicle and Ship Weapons Level 1',
    'TerranVehicleAndShipWeaponsLevel2': 'Terran Vehicle and Ship Weapons Level 2',
    'TerranVehicleAndShipWeaponsLevel3': 'Terran Vehicle and Ship Weapons Level 3',
    'TerranVehicleAndShipArmorsLevel1': 'Terran Vehicle And Ship Armor Level 1',
    'TerranVehicleAndShipArmorsLevel2': 'Terran Vehicle And Ship Armor Level 2',
    'TerranVehicleAndShipArmorsLevel3': 'Terran Vehicle And Ship Armor Level 3',
    'TerranVehicleArmorsLevel1': 'Terran Vehicle Armor Level 1',
    'TerranVehicleArmorsLevel2': 'Terran Vehicle Armor Level 2',
    'TerranVehicleArmorsLevel3': 'Terran Vehicle Armor Level 3',
    'TerranVehicleWeaponsLevel1': 'Terran Vehicle Weapons Level 1',
    'TerranVehicleWeaponsLevel2': 'Terran Vehicle Weapons Level 2',
    'TerranVehicleWeaponsLevel3': 'Terran Vehicle Weapons Level 3',
    'Thor': 'Thor',
    'TransformationServos': 'Transformation Servos',
    'TunnelingClaws': 'Tunneling Claws',
    'TwilightCouncil': 'Twilight Council',
    'Ultralisk': 'Ultralisk',
    'UltraliskCavern': 'Ultralisk Cavern',
    'Viking': 'Viking',
    'VikingAssault': 'Viking',
    'VikingFighter': 'Viking',
    'Viper': 'Viper',
    'VoidRay': 'Void Ray',
    'WarpGate':  'Gateway',  # can't build a WarpGate, but you can kill one
    'WarpGateResearch': 'Warp Gate',
    'WarpPrism': 'Warp Prism',
    'WarpPrismPhasing': 'Warp Prism',
    'WidowMine': 'Widow Mine',
    'WidowMineBurrowed': 'Widow Mine',
    'Zealot': 'Zealot',
    'ZergFlyerArmorsLevel1': 'Zerg Flyer Armor Level 1',
    'ZergFlyerArmorsLevel2': 'Zerg Flyer Armor Level 2',
    'ZergFlyerArmorsLevel3': 'Zerg Flyer Armor Level 3',
    'ZergFlyerWeaponsLevel1': 'Zerg Flyer Weapons Level 1',
    'ZergFlyerWeaponsLevel2': 'Zerg Flyer Weapons Level 2',
    'ZergFlyerWeaponsLevel3': 'Zerg Flyer Weapons Level 3',
    'ZergGroundArmorsLevel1': 'Zerg Ground Armor Level 1',
    'ZergGroundArmorsLevel2': 'Zerg Ground Armor Level 2',
    'ZergGroundArmorsLevel3': 'Zerg Ground Armor Level 3',
    'Zergling': 'Zergling',
    'zerglingattackspeed': 'Adrenal Glands',
    'ZerglingBurrowed': 'Zergling',
    'zerglingmovementspeed': 'Metabolic Boost',
    'ZergMeleeWeaponsLevel1': 'Zerg Melee Weapons Level 1',
    'ZergMeleeWeaponsLevel2': 'Zerg Melee Weapons Level 2',
    'ZergMeleeWeaponsLevel3': 'Zerg Melee Weapons Level 3',
    'ZergMissileWeaponsLevel1': 'Zerg Missile Weapons Level 1',
    'ZergMissileWeaponsLevel2': 'Zerg Missile Weapons Level 2',
    'ZergMissileWeaponsLevel3': 'Zerg Missile Weapons Level 3',
}

ABILITY_OBJECT_NAMES = {
    '250mmStrikeCannons': '250mm Strike Cannons',
    'BlindingCloud': 'Blinding Cloud',
    'BuildAutoTurret': 'Auto-Turret',
    'CalldownMULE': 'MULE',
    'Contaminate': 'Contaminate',
    'Corruption': 'Corruption',
    'EMPRound': 'EMP Round',
    'Feedback': 'Feedback',
    'ForceField': 'Force Field',
    'FungalGrowth': 'Fungal Growth',
    'GravitonBeam': 'Graviton Beam',
    'GuardianShield': 'Guardian Shield',
    'MassRecallMothership': 'Mass Recall',
    'MothershipMassRecall': 'Mass Recall',
    'MothershipCorePurifyNexus': 'Photon Overcharge',
    'MassRecallMothershipCore': 'Mass Recall',
    'InfestorNeuralParasite': 'Neural Parasite',
    'BuildPointDefenseDrone': 'Point Defense Drone',
    'HallucinationArchon': 'Hallucination',
    'HallucinationColossus': 'Hallucination',
    'HallucinationHighTemplar': 'Hallucination',
    'HallucinationImmortal': 'Hallucination',
    'HallucinationPhoenix': 'Hallucination',
    'HallucinationProbe': 'Hallucination',
    'HallucinationStalker': 'Hallucination',
    'HallucinationVoidRay': 'Hallucination',
    'HallucinationWarpPrism': 'Hallucination',
    'HallucinationZealot': 'Hallucination',
    'PsionicStorm': 'Psionic Storm',
    'ScannerSweep': 'Scanner Sweep',
    'SeekerMissile': 'Seeker Missile',
    'SniperRound': 'Snipe',
    'SpawnLarva': 'Spawn Larva',
    'ExtraSupplies': 'Extra Supplies',
    'ChronoBoost': 'Chrono Boost',
    'QueenTransfusion': 'Transfusion',
    'YamatoGun': 'Yamato Cannon',
    'Abduct': 'Abduct',
    'TemporalField': 'Time Warp',
    'Envision': 'Envision',
    }
EHadoux commented 10 years ago

I'm glad to see I converged towards this in 128a685f61d36d5c704fb2bb54487c019798efa4 :)

EHadoux commented 10 years ago

It seems that you lack some names (like Yamato upgrade), see 6842239ca38df201ff70e15608c771aeb95894f2 and previous.

StoicLoofah commented 10 years ago

Ah, thanks for the tip there. I'm now extra-glad that I posted the list. I'll be sure to include those!