Opened 9 years ago
Last modified 7 years ago
#3403 closed enhancement
Show graphs in the summary screen — at Initial Version
Reported by: | elexis | Owned by: | |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 22 |
Component: | UI & Simulation | Keywords: | patch |
Cc: | Patch: |
Description
Concept We should have some charts in the summary screen, so that the advancement of the game can be understood. The particular score should be plotted on the Y-axis with time on the X-axis. We should show the same categories that we already display for the end of the game.
Implementation
Saving stats over time:
As seen in leaveGame()
in session.js
, we would only need to capture Engine.GuiInterfaceCall("GetExtendedSimulationState").players
every N minutes and pass it to the summary screen. It currently contains the following data per player:
{ "unitsTrained": { "Infantry": 0, "Worker": 0, "Female": 0, "Cavalry": 0, "Champion": 0, "Hero": 0, "Ship": 0, "Trader": 0, "total": 0 }, "unitsLost": { "Infantry": 0, "Worker": 0, "Female": 0, "Cavalry": 0, "Champion": 0, "Hero": 0, "Ship": 0, "Trader": 0, "total": 0 }, "unitsLostValue": 0, "enemyUnitsKilled": { "Infantry": 0, "Worker": 0, "Female": 0, "Cavalry": 0, "Champion": 0, "Hero": 0, "Ship": 0, "Trader": 0, "total": 0 }, "enemyUnitsKilledValue": 0, "buildingsConstructed": { "House": 0, "Economic": 0, "Outpost": 0, "Military": 0, "Fortress": 0, "CivCentre": 0, "Wonder": 0, "total": 0 }, "buildingsLost": { "House": 0, "Economic": 0, "Outpost": 0, "Military": 0, "Fortress": 0, "CivCentre": 0, "Wonder": 0, "total": 0 }, "buildingsLostValue": 0, "enemyBuildingsDestroyed": { "House": 0, "Economic": 0, "Outpost": 0, "Military": 0, "Fortress": 0, "CivCentre": 0, "Wonder": 0, "total": 0 }, "enemyBuildingsDestroyedValue": 0, "resourcesGathered": { "food": 0, "wood": 0, "metal": 0, "stone": 0, "vegetarianFood": 0 }, "resourcesUsed": { "food": 0, "wood": 0, "metal": 0, "stone": 0 }, "resourcesSold": { "food": 0, "wood": 0, "metal": 0, "stone": 0 }, "resourcesBought": { "food": 0, "wood": 0, "metal": 0, "stone": 0 }, "tributesSent": 0, "tributesReceived": 0, "tradeIncome": 0, "treasuresCollected": 0, "lootCollected": 0, "percentMapExplored": 16, "teamPercentMapExplored": 16, "percentMapControlled": 12, "teamPercentMapControlled": 12, "peakPercentMapControlled": 0, "teamPeakPercentMapControlled": 0 }
This takes about 10kb space for 8 players. So saving a state every minute would cost roughly 1MB memory every 2 hours.
In case #3258 will be implemented, it should save those states using zip compression, reducing the file size by maybe 90%.
Displaying the charts: We could have a checkbox somewhere (for example besides the button) to toggle between charts and numbers. This way you can switch between tabs and correlate the graphs of the different tabs.