Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[telemetry] game play metric #3016

Merged
merged 8 commits into from Jul 30, 2017
Merged

Conversation

GabrielXia
Copy link
Contributor

Contains

Game play metric including:

  • Block destroyed
  • Block placed
  • Monster killed
  • Game configuration: word generator, network mode, language, player height, player eye height
  • Game play stats: distance traveled, play time

How to test

gameplay
gameconfiguration
blockdestroyed

@rzats @oniatus @skaldarnar @msteiger @Cervator @qwc thanks for review :-)

@GooeyHub
Copy link
Member

Hooray Jenkins reported success with all tests good!

@GooeyHub
Copy link
Member

Hooray Jenkins reported success with all tests good!

@GooeyHub
Copy link
Member

Hooray Jenkins reported success with all tests good!

@GooeyHub
Copy link
Member

Hooray Jenkins reported success with all tests good!

@GabrielXia
Copy link
Contributor Author

Update

  • Add a user id based on localhost MAC address to identifier different users. The MAC address is hashed and the id will not change if the user uses the same PC.
  • Fix the bug when enable telemetry, if we restart the game, the telemetry does not actually start.

@GooeyHub
Copy link
Member

Hooray Jenkins reported success with all tests good!

@Cervator
Copy link
Member

Tested it out :-)

Saw the gameplay metrics update live in-game, cool! And then at the end of the session that payload was prepared and sent to the server. Neato. Although the logging is a little cryptic and seemed to repeat itself, is that an issue?

2:00:53.837 [main] INFO  c.s.s.tracker.payload.TrackerPayload - Adding new kv pair: tna->class org.terasology.telemetry.TelemetrySystem
22:00:53.837 [main] INFO  c.s.s.tracker.payload.TrackerPayload - Adding new kv pair: tv->java-0.8.0
22:00:53.837 [main] INFO  c.s.s.tracker.payload.TrackerPayload - Adding new map: {uid=IxMgbxFpP2kxqftEG8uCCd/xE/lJw0A8SAqQKrjOilo, tz=America/New_York}
22:00:53.837 [main] INFO  c.s.s.tracker.payload.TrackerPayload - Adding new kv pair: uid->IxMgbxFpP2kxqftEG8uCCd/xE/lJw0A8SAqQKrjOilo
22:00:53.837 [main] INFO  c.s.s.tracker.payload.TrackerPayload - Adding new kv pair: tz->America/New_York
22:00:53.837 [main] INFO  c.s.s.tracker.payload.TrackerPayload - Adding new kv pair: e->ue
22:00:53.837 [main] INFO  c.s.s.tracker.payload.TrackerPayload - Adding new map: {schema=iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0, data={schema=iglu:org.terasology/blockPlaced/jsonschema/1-0-0, data={Sand=3}}}
22:00:53.837 [main] INFO  c.s.s.tracker.payload.TrackerPayload - Adding new kv pair: ue_px->eyJzY2hlbWEiOiJpZ2x1OmNvbS5zbm93cGxvd2FuYWx5dGljcy5zbm93cGxvdy91bnN0cnVjdF9ldmVudC9qc29uc2NoZW1hLzEtMC0wIiwiZGF0YSI6eyJzY2hlbWEiOiJpZ2x1Om9yZy50ZXJhc29sb2d5L2Jsb2NrUGxhY2VkL2pzb25zY2hlbWEvMS0wLTAiLCJkYXRhIjp7IlNhbmQiOjN9fX0=
22:00:53.837 [main] INFO  c.s.s.tracker.payload.TrackerPayload - Adding new kv pair: eid->b1967a3a-4c25-4ddf-857c-4aa9ca74f95c
22:00:53.837 [main] INFO  c.s.s.tracker.payload.TrackerPayload - Adding new kv pair: dtm->1501380053837
22:00:53.837 [main] INFO  c.s.s.tracker.payload.TrackerPayload - Adding new kv pair: p->pc
22:00:53.837 [main] INFO  c.s.s.tracker.payload.TrackerPayload - Adding new kv pair: aid->terasology
22:00:53.837 [main] INFO  c.s.s.tracker.payload.TrackerPayload - Adding new kv pair: tna->class org.terasology.telemetry.TelemetrySystem
22:00:53.837 [main] INFO  c.s.s.tracker.payload.TrackerPayload - Adding new kv pair: tv->java-0.8.0
22:00:53.837 [main] INFO  c.s.s.tracker.payload.TrackerPayload - Adding new map: {uid=IxMgbxFpP2kxqftEG8uCCd/xE/lJw0A8SAqQKrjOilo, tz=America/New_York}

On the utility server there is a bunch of odd looking fields without data, and also one surprise: the user's IP address gets sent - maybe we should avoid that one? I'm thinking user_id is the one that's the hashed MAC. I can't spot the actual gameplay metrics like blocks broken etc.

It'll be fun getting started on actual smart searches and graphs to get sensible stuff out of it all. For now everything seems to be fine so merging! :-)

Copy link
Member

@Cervator Cervator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran over the changes real quick, few minor comments but nothing that needs to be changed right away :-)

instigator.addOrSaveComponent(gamePlayStatsComponent);
}
} else if (entityRef.hasComponent(CharacterComponent.class)) {
String monsterName = entityRef.getParentPrefab().getName();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion for later: maybe this shouldn't be "monster" specific since it would cover all kinds of things. A deer isn't really a monster. Would killing another player count?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Cervator , sorry about the delay :) not tested but I think that killing another player count. Do you think "creature" would be better as a name ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very belated reply from me: yes IMHO "creature" is better :-)

@TelemetryField
private Map monsterKilledMap;

public MonsterKilledMetric() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is an explicit empty public constructor really needed? Thought that was present by default. Unless marking the class final does something.

@@ -260,7 +260,13 @@
"telemetry-launch-popup-text": "Telemetry system will send metrics and errors to the server. We do our best to avoid sending anything identifiable from your PC, e.g. telemetry includes your OS name, Java version but it doesn't include the MAC address, the home path, etc. You can review in Metric Menu and let us know if we missed something. Telemetry is super useful to an all volunteer project like ours and we'd really appreciate it!",
"telemetry-launch-popup-title": "Telemetry In Terasology",
"telemetry-menu": "Metrics Menu",
"telemetry-system-context": "System context",
"telemetry-description": "This screen shows the metrics and their values that will be sent to the server. You can enable/disable it here. Telemetry is super useful to an all volunteer project like ours and we'd really appreciate it!",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to adding new translated English entries in menu_en.lang please also add placeholder entries menu.lang so Weblate and such can figure out there are new keys :-)

@Cervator Cervator merged commit 30772b1 into MovingBlocks:develop Jul 30, 2017
Cervator added a commit that referenced this pull request Jul 30, 2017
@Cervator Cervator added this to the Alpha 8 milestone Jul 30, 2017
@Cervator Cervator added the Category: Build/CI Requests, Issues and Changes targeting gradle, groovy, Jenkins, etc. label Jul 30, 2017
@GabrielXia GabrielXia mentioned this pull request Aug 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Build/CI Requests, Issues and Changes targeting gradle, groovy, Jenkins, etc.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants