Merged
Conversation
Closed
38 tasks
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements comprehensive game statistics tracking for replay analysis. The system captures 16 different game metrics including damage dealt, objects spawned/destroyed, gems transferred, and action counts.
Key changes:
- Added a singleton Stats class to track game metrics across all game actions
- Integrated statistics collection into action execution (attack, build, move, etc.) and object destruction
- Statistics are included in the replay's misc section for external consumption via RabbitMQ
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
server/src/game/Stats.cpp |
New singleton class implementation for tracking game statistics |
server/inc/game/Stats.h |
Header defining 16 stat keys and Stats class interface |
server/src/game/ReplayEncoder.cpp |
Integration of stats into replay misc section |
server/src/game/Game.cpp |
Object destruction statistics tracking and code formatting |
server/src/action/*.cpp |
Statistics collection in all action types (attack, build, move, create, transfer) |
server/inc/object/Bomb.h |
Added Stats.h include for bomb explosion tracking |
server/inc/game/ReplayEncoder.h |
Added Stats.h include and formatting cleanup |
server/inc/action/AttackAction.h |
Added Stats.h include for attack statistics |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stored in misc section so it's sent via rabbitMQ so @Peu77 can easily read it out later. In the replay they look like this:
Decided to go for unified namings over object-specific verbs, e.g. bombs destroyed = count of bombs that exploded.
I think we should highlight mainly stuff like "damage-self" and "cores-destroyed" and "units-spawned" on the website but make all of them accessible.
Cores destroyed is a stat because theoretically eventually three teams might play a game against each other.