Skip to content

Commit

Permalink
make the 1.36 adjustment in a smarter place so that economic stats ar…
Browse files Browse the repository at this point in the history
…e backward compatible more generally, including in Staircase stats
  • Loading branch information
dsjoerg committed Apr 8, 2016
1 parent 2eb5999 commit b913a3c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions sc2parse/sc2reader_to_esdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,10 @@ def gatherstats(now, stats, matchblob):
matchblob['Lost'][ident_id].append(pstats.resources_lost)
matchblob['VespeneCurrent'][ident_id].append(pstats.vespene_current)
matchblob['MineralsCurrent'][ident_id].append(pstats.minerals_current)
matchblob['VespeneCollectionRate'][ident_id].append(pstats.vespene_collection_rate)
matchblob['MineralsCollectionRate'][ident_id].append(pstats.minerals_collection_rate)
# starting with 3.2 the resource collection rates were reported as faster numbers.
# we shift them back so that we dont have to make changes everywhere else and deal with a discontinuity
matchblob['VespeneCollectionRate'][ident_id].append(pstats.vespene_collection_rate / 1.36)
matchblob['MineralsCollectionRate'][ident_id].append(pstats.minerals_collection_rate / 1.36)
matchblob['WorkersActiveCount'][ident_id].append(pstats.workers_active_count)
matchblob['SupplyUsage'][ident_id].append((pstats.food_used, pstats.food_made))
else:
Expand Down Expand Up @@ -257,10 +259,7 @@ def gatherstats(now, stats, matchblob):
setattr(player,attr_name, sum(values)/len(values))

for player in players_we_track:
# starting with 3.2 the resource collection rates were reported as faster numbers.
# we shift them back so that we dont have to make changes everywhere else and deal with a discontinuity
player.average_resource_collection_rate = (player.average_vespene_collection_rate + player.average_minerals_collection_rate) / 1.36

player.average_resource_collection_rate = (player.average_vespene_collection_rate + player.average_minerals_collection_rate)
player.average_unspent_resources = player.average_unspent_minerals + player.average_unspent_vespene
player.workers_created = len([u for u in player.units if (u.is_worker and u.finished_at is not None)])

Expand Down

0 comments on commit b913a3c

Please sign in to comment.