I’ve reviewed the similar posts and the existing analytics and feel that this post still holds merit, so please review/reply with your thoughts.
Problem Statement: As a clan leader I want to use actual war day attack participation to gauge clan member activity for demotions/removals/promotions. However, the analytics page only shows total war attacks fought in a week, but this also includes practice day attacks (see numbers >16 in the statistics) thanks to Supercell’s wonky API.
Proposal: My clan has found a way to take the existing stats provided on royale api to calculate the real unused war day attacks, so the site should be able to create an algorithm to generate and display the same information (i.e. a 3rd section in analytics showing the unused war attacks per member per week)
Detailed Algorithm we are using:
Step 1: Collect data on first actual war day (Thursday - USA time): Calculate the total practice day attacks
practice_decks_used = player_decks_used - player_decks_used_today
Step 2 (for 3-day war wins): Collect data on fourth actual war day (Sunday - USA time): Calculate the missed war day attacks
3daywin_missed_attacks = 12 - player_decks_used - player_decks_used_today - practice_decks_used
Step 3 (for 4-day war wins): Collect data from the war log the 1st day of the next war week for the previous war week’s season_key
: Calculate the missed war day attacks
4day_missed_attacks = 16 - player_decks_used - practice_decks_used
The same algorithms could be employed to list out total attacks used on war days by just removing the 12
and 16
portions of the calculations, and requires no new API from supercell to calculate; just a few additional timed steps (crontab, windows scheduler, or other timed triggers to gather the info and perform the calculations). Could use something similar to this on the 2nd, 3rd, and 4th war days to accurately figure out daily missed attacks in addition to total missed attacks if one wants to be ambitious =)
Thoughts?
Spudmaster Bob