yschua / clashofclans

CoC clan war tracking website
http://ptdh.mikelai.org/
0 stars 0 forks source link

Statistics tracking for each member #13

Closed yschua closed 8 years ago

yschua commented 8 years ago

I suppose a database will need to be created to store all clan members that have participated in a clan war. For a start, the following stats would be stored and displayed on the statistics page.

Use the player id number to uniquely identify each member.

Let me know how you intend to implement how the stats update when a new war is added.

michaeljinlai commented 8 years ago

Got the stats of each player and just put it in a table on the stats tab. Not sure how you want it presented.

yschua commented 8 years ago

Excellent. So similar to the war log, the stats are retrieved dynamically from json files. But a side question is this solution efficient for large databases?

By the way, here is the spreadsheet for stats tracking we have. It contains a "offensive value calc" and "defense value calc" which is some sort of performance rating calculated from stars earned and the difference of the attacker's and defender's position number (don't worry about implementing this yet). In addition to the other stats (stars earned, total damage, etc.), is it better to query and calculate these values every time the page is opened, or for the values to be calculated and stored every time a new war is added? Or maybe for a small website like this with low traffic, and small database (number of wars < 200, war roster size each war <= 50), any performance impact is really negligible?

Additionally I am thinking that from this table, you can click on a member that will bring you to a separate page showing a member's statistics in more detail, e.g. showing a list of all attacks done from every war, etc.

michaeljinlai commented 8 years ago

Yeah retrieving dynamically every time the page is loaded is not efficient at all, but since there isn't many war data yet it should suffice until I come back from Japan. There'll probably be max 12 new wars by the time I'm back and this method should still be alright. After that I can just make it calculate once and store it into the SQL database.

michaeljinlai commented 8 years ago

Though a good thing about this method is that you can just add new jsons and won't have to worry about clicking update and stuff.

yschua commented 8 years ago

Sounds good, I guess the last thing to do before you leave is the separate page for each member, similar to War Details.

yschua commented 8 years ago

Great reference of statistics website.

http://www.datdota.com/stats.php?p=players&average=true