Skip to content

Statistics Modal#97

Merged
1brucben merged 8 commits into
v0.2.0from
statistics
Nov 18, 2025
Merged

Statistics Modal#97
1brucben merged 8 commits into
v0.2.0from
statistics

Conversation

@1brucben
Copy link
Copy Markdown
Owner

This pull request introduces a new in-game statistics tracking and display system for players, along with a refactor of economic terminology from "GDP" to "Industrial Production" throughout the codebase. The statistics feature collects key player metrics over time and adds a UI modal for viewing them. The economic terminology update ensures consistent usage and corrects formulas related to trade and player metrics.

Statistics feature additions:

  • Added StatDefinitions.ts and StatsStore.ts to track and compute player statistics over time, including metrics like gold, population, productivity, investments, structures, and technology progress. ([[1]](https://github.com/1brucben/Terratomic/pull/97/files#diff-5baf6266e796f97461a07cab75aa29a1e9671d261d602675edd633ce8eda1adeR1-R210), [[2]](https://github.com/1brucben/Terratomic/pull/97/files#diff-670dde409b528ee3a8ea32a5c1f9a65898a53fa4310b234d81d83e70d383d5a3R1-R112))
  • Integrated stats collection into ClientGameRunner, initializing tracking for all available metrics and updating stats on each game tick. ([[1]](https://github.com/1brucben/Terratomic/pull/97/files#diff-b256b0f1505dbe2f408d26fd2bee677538c547700ec1cae2d98a8bee3843f787R243-R260), [[2]](https://github.com/1brucben/Terratomic/pull/97/files#diff-b256b0f1505dbe2f408d26fd2bee677538c547700ec1cae2d98a8bee3843f787R312))
  • Added a statistics button to the control panel UI (ControlPanel2) that opens a modal displaying tracked player stats. Ensured the modal is registered and styled the button for accessibility. ([[1]](https://github.com/1brucben/Terratomic/pull/97/files#diff-06e5267ac6d5a923f03363b82774e68eec9c2a741aa355bd887f5085b3fd914bR27), [[2]](https://github.com/1brucben/Terratomic/pull/97/files#diff-06e5267ac6d5a923f03363b82774e68eec9c2a741aa355bd887f5085b3fd914bR969-R999), [[3]](https://github.com/1brucben/Terratomic/pull/97/files#diff-06e5267ac6d5a923f03363b82774e68eec9c2a741aa355bd887f5085b3fd914bR1235-R1248))
  • Minor UI adjustments to accommodate the new statistics button and modal, including layout tweaks in index.html and control panel styling. ([[1]](https://github.com/1brucben/Terratomic/pull/97/files#diff-f85ce1576c94e1e36e5c117441a2772114649e1bdf9dacf0478a827db28d46c6L265-R265), [[2]](https://github.com/1brucben/Terratomic/pull/97/files#diff-f85ce1576c94e1e36e5c117441a2772114649e1bdf9dacf0478a827db28d46c6R275), [[3]](https://github.com/1brucben/Terratomic/pull/97/files#diff-06e5267ac6d5a923f03363b82774e68eec9c2a741aa355bd887f5085b3fd914bL1150-R1182))

Economic terminology and trade formula updates:

  • Renamed "GDP" to "Industrial Production" in all relevant interfaces, formulas, and comments (Config, Player, PlayerUpdate), and updated trade gravity calculations to use industrial production instead of GDP. ([[1]](https://github.com/1brucben/Terratomic/pull/97/files#diff-2642ba97cfb236b407d471ea067073daf91387e758835b1faa1e52a20a8c743fL128-R129), [[2]](https://github.com/1brucben/Terratomic/pull/97/files#diff-2642ba97cfb236b407d471ea067073daf91387e758835b1faa1e52a20a8c743fL156-R156), [[3]](https://github.com/1brucben/Terratomic/pull/97/files#diff-ee2fcbca50d87cc09d2c7d2667210defe2e3e111239820c89c40283be5385b64L1139-R1140), [[4]](https://github.com/1brucben/Terratomic/pull/97/files#diff-e76c8773aaac0de32060a5c943e0753a9621a629d4925071be31c912bd983dd3L613-R614), [[5]](https://github.com/1brucben/Terratomic/pull/97/files#diff-14aef6956113929162722927cdba9071288ec4f3dc2eac3c539768cc11ca66bbL179-R190), [[6]](https://github.com/1brucben/Terratomic/pull/97/files#diff-aa77a10b69c26dd62bc28408bb3143ee9fb5f14ba19c8632f161a8b64de7ffedL136-R140), [[7]](https://github.com/1brucben/Terratomic/pull/97/files#diff-aa77a10b69c26dd62bc28408bb3143ee9fb5f14ba19c8632f161a8b64de7ffedL160-R167))

These changes collectively add a robust player statistics system and improve clarity around economic metrics in the game.

@1brucben 1brucben merged commit 371aefc into v0.2.0 Nov 18, 2025
5 of 7 checks passed
@El-Magico777 El-Magico777 added this to the v0.1.11 milestone Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants