question

Damian Rajamanie avatar image
Damian Rajamanie asked

Analytics questions

I feel like I'm missing something so hopefully someone can point me in the right direction. What we wanted to do is have some record to show for example the amount of time a player wandered around in an area. So in our game logic we can record when he enters and exits, let's say 3 minutes. We'd then want to be able to query this to find out how many players are spending > 3 minutes, who's taking 10 minutes etc. I had though I could use the WritePlayerEvent and add this to the Body portion, then filter it in a query, but it seems you can't directly access the body fields, you can just look for a string - which doesn't make any sense to me. So then I was thinking maybe it's a PlayerStatistic that I can update and query.

It seems like I'm thinking of this entirely wrong, using the wrong thing or this sort of stuff isn't available. How should I go about doing these types of things? the PlayStream/EventHistory seems to only show, number of events/Date... but we'd like to see a graph more like, NumberOfPlayers/TimeSpentInLocation... don't know how to get that event data from a json.. is there somethign I need to do to collate that all and then min eit something? I'd like to know what's out of the box with playfab for this type of querying

Cheers

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Damian Rajamanie avatar image Damian Rajamanie commented ·

so this link: https://api.playfab.com/docs/tutorials/landing-analytics/pf-events

Has an example much like what I'm trying to achieve in my tests, but it stops dead at showing HOW to actually query the ChestType or LevelID... how do I get all the players that have opened only the bronze_chest for example? All I can see in examples is a search via text like:

eventData.eventName:player_chest_opened AND "bronze_chest"... what if I want o pick out certain LevelIDs?

Surely I want AND eventData.ChestType:bronze_chest AND eventData.LevelID:60 - to see who's opening bronze_chests on level 60 I don't understand the querying

0 Likes 0 ·
Damian Rajamanie avatar image Damian Rajamanie commented ·

this: https://api.playfab.com/docs/tutorials/landing-analytics/event-history/event-query

Appears to indicate that I can query the amount of time_in_location and other things with a paid tier only? this is the only record I can find of this... is this why it'snot working, what are the options here?

0 Likes 0 ·

1 Answer

·
Andy avatar image
Andy answered

The short answer is that to do anything terribly interesting with custom event data, you need to drop it into a warehouse of some sort. We offer the Snowflake add-on today as well as exporting to cloud storage. In the near future, we'll offer additional warehousing options.

As to the specific syntax of what you're trying to do, we do have some rudimentary support for querying custom field values in the game manager. A query like this is possible:

eventData.eventName:player_chest_opened AND eventData.ChestType=bronze_chest

Note that it uses an "=" instead of a colon for custom field data. Additionally, only equality is supported.

I'll see if we can get some updated documentation that explains the exact syntax and limitations of the event history queries.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Damian Rajamanie avatar image Damian Rajamanie commented ·

Ahh thanks that works, what is this query language? I'm also wondering if I can filter by checking is something is GREATER than something else, I don't know how to do this:

Example:

eventData.Level>20

That appear to just return ALL levels not just those more than 20, which I guess is because it doesn't know that it's an int, not sure what I need to reference or learn to do complex queries here

0 Likes 0 ·
Andy avatar image Andy ♦♦ Damian Rajamanie commented ·

It's a custom query syntax that we're hoping to deprecate in the near future. It doesn't support inequality or value ranges, which severely limits your ability to do complex queries. For now, if that's what you're after, the Snowflake addon is the way to go.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.