Jump to content
Korean Random

jopatanki

User
  • Content Count

    8
  • Joined

  • Last visited

Community Reputation

0 Noob

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Привет. Подскажите как посчитать вот это: Я делаю так: Беру список танков игрока отсюда /wot/tanks/stats/ (секция all) Потом узнаю по каждому танку его уровень. Отсюда беру инфу по танкам /wot/encyclopedia/vehicles/ Затем суммирую уровни танков игрока и делю на количество танков игрока В результате цифра не сходится например с сайтом wot-news. Что я делаю не так. Спасибо)
  2. О! Вот это другой разговор. Да я шарю. Спасибо! Извините если грубо сказал
  3. @sirmax товарищи разработчик почему ваш расчёт wn8 не сходится с моим. Вы так и не ответили. Если не шарите в с++. Ткните где у вас в исходниках идёт подсчёт wn8
  4. @sirmax ну короче нашёл косяк float rWinc = std::max(0.0, (rWin - 0.71) / (1.0 - 0.071)) заменил на float rWinc = std::max(0.0, (rWin - 0.71) / (1.0 - 0.71)); Теперь результат 1632. Все равно не сходится @sirmax если убрать деление на 100 то получается 1474.
  5. @seriych нет. Лишний раз не делю. Все делал как написал incognitoCap: post
  6. Привет! Быстренько накидал программу для расчета WN8. Результат моих расчетов 1594, а в игре 1704. Почему? Через WG API получил статку по своим танкам. скачал свежую таблицу WN8 https://static.modxvm.com/wn8-data-exp/json/wn8exp.json Все мои танки есть в таблице WN8 Мой ник: TT_u_k_a_4_u #include <vector> #include <string> #include <exception> #include "elements.h" #include "reader.h" float GetExpDmg(const json::Object& obj, unsigned tankID) { const json::Array& data = obj["data"]; for (json::Array::const_iterator it = data.Begin(); it != data.End(); it++) { const json::Object& item = *it; const json::Number& idn = item["IDNum"]; unsigned IDNum = idn.Value(); if (IDNum == tankID) { const json::Number& ex = item["expDamage"]; return ex.Value(); } } return 0.0; } float GetExpFrag(const json::Object& obj, unsigned tankID) { const json::Array& data = obj["data"]; for (json::Array::const_iterator it = data.Begin(); it != data.End(); it++) { const json::Object& item = *it; const json::Number& idn = item["IDNum"]; unsigned IDNum = idn.Value(); if (IDNum == tankID) { const json::Number& ex = item["expFrag"]; return ex.Value(); } } return 0.0; } float GetExpSpot(const json::Object& obj, unsigned tankID) { const json::Array& data = obj["data"]; for (json::Array::const_iterator it = data.Begin(); it != data.End(); it++) { const json::Object& item = *it; const json::Number& idn = item["IDNum"]; unsigned IDNum = idn.Value(); if (IDNum == tankID) { const json::Number& ex = item["expSpot"]; return ex.Value(); } } return 0.0; } float GetExpDef(const json::Object& obj, unsigned tankID) { const json::Array& data = obj["data"]; for (json::Array::const_iterator it = data.Begin(); it != data.End(); it++) { const json::Object& item = *it; const json::Number& idn = item["IDNum"]; unsigned IDNum = idn.Value(); if (IDNum == tankID) { const json::Number& ex = item["expDef"]; return ex.Value(); } } return 0.0; } float GetExpWin(const json::Object& obj, unsigned tankID) { const json::Array& data = obj["data"]; for (json::Array::const_iterator it = data.Begin(); it != data.End(); it++) { const json::Object& item = *it; const json::Number& idn = item["IDNum"]; unsigned IDNum = idn.Value(); if (IDNum == tankID) { const json::Number& ex = item["expWinRate"]; return ex.Value(); } } return 0.0; } int main(int argc, char* argv[]) { std::string wn8tablestr; FILE* f = fopen("wn8table.json", "rb"); if (f) { char b[1025]; size_t sz; while ((sz=fread(&b, 1, 1024, f)) != 0) { b[sz] = 0; wn8tablestr += b; } fclose(f); f = nullptr; } json::Object wb8table; std::istringstream stream(wn8tablestr); json::Reader::Read(wb8table, stream); std::string usertanksStr; f = fopen("user_tanks.json", "rb"); if (f) { char b[1025]; size_t sz; while ((sz = fread(&b, 1, 1024, f)) != 0) { b[sz] = 0; usertanksStr += b; } fclose(f); } json::Object userTanks; std::istringstream stream2(usertanksStr); json::Reader::Read(userTanks, stream2); const char* userID = "24889739"; json::Object& data = userTanks["data"]; json::Array& tanks = data[userID]; //1594 float sumDmg = 0; float sumExpDmg = 0; float sumFrags = 0; float sumExpFrags = 0; float sumSpot = 0; float sumExpSpot = 0; float sumDef = 0; float sumExpDef = 0; float sumWin = 0; float sumExpWin = 0; for (json::Array::const_iterator it = tanks.Begin(); it != tanks.End(); it++) { const json::Object& item = *it; const json::Number& tid = item["tank_id"]; unsigned tankID = tid.Value(); const json::Object& all = item["all"]; const json::Number& b = all["battles"]; float battles = b.Value(); const json::Number& dd = all["damage_dealt"]; float dmg = dd.Value(); float expDmg = GetExpDmg(wb8table, tankID); if (expDmg == 0) { printf("skip %u\n", tankID); continue; } const json::Number& f = all["frags"]; float frags = f.Value(); float expFrags = GetExpFrag(wb8table, tankID); const json::Number& s = all["spotted"]; float spotted = s.Value(); float expSpot = GetExpSpot(wb8table, tankID); const json::Number& dcp = all["dropped_capture_points"]; float def = dcp.Value(); float expDef = GetExpDef(wb8table, tankID); const json::Number& w = all["wins"]; float win = w.Value(); float expWin = GetExpWin(wb8table, tankID) / 100.0; sumDmg += dmg; sumExpDmg += battles * expDmg; sumFrags += frags; sumExpFrags += battles * expFrags; sumSpot += spotted; sumExpSpot += battles * expSpot; sumDef += def; sumExpDef += battles * expDef; sumWin += win; sumExpWin += battles * expWin; } float rDamage = sumDmg / sumExpDmg; float rFrag = sumFrags / sumExpFrags; float rSpot = sumSpot / sumExpSpot; float rDef = sumDef / sumExpDef; float rWin = sumWin / sumExpWin; float rWinc = std::max(0.0, (rWin - 0.71) / (1.0 - 0.071)); float rDamagec = std::max(0.0, (rDamage - 0.22) / (1.0 - 0.22)); float rFragc = std::max(0.0, std::min(rDamagec + 0.2, (rFrag - 0.12) / (1.0 - 0.12))); float rSpotc = std::max(0.0, std::min(rDamagec + 0.1, (rSpot - 0.38) / (1.0 - 0.38))); float rDefc = std::max(0.0, std::min(rDamagec + 0.1, (rDef - 0.10) / (1.0 - 0.10))); float wn8 = 980.0 * rDamagec + 210.0 * rDamagec * rFragc + 155.0 * rFragc * rSpotc + 75.0 * rDefc * rFragc + 145.0 * std::min(1.8f, rWinc); printf("wn8: %.2f", wn8); getchar(); return 0; } user_tanks.json wn8table.json
×
×
  • Create New...