question

Anh Le avatar image
Anh Le asked

Custom event limit & how to track a complicated event?

I would like to track the equipment and skills the player use in the pvp battle. However, we have many equipment and abilities per player. So I guess the event will look like this:

Event name: match_end Parameters: game_mode, ability1, ability2, ability3, ability4, equipment1, equipment2, equipment3, equipment4, equipment5, equipment6, match_result, match_duration, gold_earn, character_use, score_earn

Is this a correct approach? Does Playfab support array or JSON data type in parameters?

If the player has many types of equipment (up to 10) and ability (up to 8 ), may reach the limit of parameters per event?

Or should I use the follow approach:

Event name: match_end
Parameters: game_mode, match result, match_duration, score_earn, gold_earn

Event name: ability_use_in_pvp_match
Parameters: game_mode, ability1, ability2, ability 3, etc.

Event name: equipment_use_in_pvp_match
Parameters: game_mode, equipment1, equipment2, etc.

One more question: Is it possible to use those custom events as rules or segment for game operation purpose? Ex: If a player has the win rate < 30%, auto send them a special offer. Or I want to send the special offers to all users who use character X > 50% of their matches.

Thanks,
Anh

10 |1200

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

1 Answer

·
Andy avatar image
Andy answered

I assume you're referring to an event emitted by WritePlayerEvent? If so, my preference is for large denormalized events. This reduces the number of joins required for analysis, which is better for most big data repositories. So, I'd go with your first approach.

As to arrays, yes, you can send data in array form, but be aware that it's more difficult to deal with. If the number of potential elements in the arrays are finite and small (<10), you should consider doing what you describe and creating dedicated fields. There's not a field-count limitation on these events, but there is a data size limit. The free tier allows events with up to 1KB of custom data per event. A paid tier increases that by about 10x.

If you do end up having to split the data across multiple events, that also works, but be sure to include a correlation id across the various match-end events, such as a matchId or something similar. You don't want to try to correlate in time. That makes for awkward queries.

Lastly, yes, you can use Custom Event to trigger Rules and thereby drive segmentation. The percentage-based stuff can be more tricky, but is solvable through a rule that invokes some cloud script (or by just sending the percentage in the event).

10 |1200

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

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.