Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fair match analysis #548

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 143 additions & 0 deletions screens/about/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,143 @@ const BugReports = () => {
);
};

const Statistics = () => {
return (
<>
<Title order={4}>Data Scraping</Title>
<li>Tracking only "automatch" matches.</li>
<li>Tracking only matches where at least one player is ranked in the leaderboards.</li>
See Data source article bellow for more details.
<Space h={"xs"} />
<Title order={4}>ELO Filtering</Title>
<li>
You can filter by single ELO group like{" "}
<Anchor
target={"_blank"}
href={"/stats/games?from=2024-05-02&to=2024-07-15&filters=stats-average-1400-1599"}
>
this
</Anchor>
</li>
<li>
You can filter by combining multiple ELO groups like{" "}
<Anchor
target={"_blank"}
href={
"/stats/games?from=2024-05-02&to=2024-07-15&filters=stats-limit-1600-9999%2Cstats-limit-1400-1599%2Cstats-limit-1250-1399"
}
>
this
</Anchor>
</li>
It's recommended to combine multiple ELO groups to get more data for you analysis. Keep in
mind that you need thousands of games to get meaningful results.
<Space h={"xs"} />
<Title order={5}>Average Group Filter</Title>
<>
<Text>Average ELO of all players fit in the specified group.</Text>
<li>
<Text c={"green"} span>
Good
</Text>{" "}
- a lot of games can fit into the group.
</li>
<li>
<Text c={"red"} span>
{" "}
Bad
</Text>{" "}
- the game might not be balanced, it can be team A 1100 ELO vs Team B 1600 ELO.
</li>
Formula:
<Text style={{ fontStyle: "italic" }}>
Sum ELO of all players in match divided by number of players.
</Text>
</>
<Space h={"xs"} />
<Title order={5}>Average Fair Matchup Filter</Title>
<>
<Text>
Average ELO of all players fit in the specified group while the difference between the
teams ELO is bellow 20%
</Text>
<li>
<Text c={"green"} span>
Good
</Text>{" "}
- provides balanced games with more games to analyze. Useful for 3v3 and 4v4
</li>
<li>
<Text c={"red"} span>
{" "}
Bad
</Text>{" "}
- the team itself might not be balanced. Team A can have player with 1600 and 800 ELO
resulting in the average ELO of 1200 of team A.
</li>
Formula:
<Text style={{ fontStyle: "italic" }}>
Calculate average ELO of team A and team B. The difference between the ELO of the team A
and B is less than 20%.
</Text>
</>
<Space h={"xs"} />
<Title order={5}>Average Excluded Group</Title>
<>
<Text>
Average ELO of all players fit in the specified group while the difference between the
lowest ELO and highest ELO player is less then 400.
</Text>
<li>
<Text c={"green"} span>
Good
</Text>{" "}
- provides balanced games
</li>
<li>
<Text c={"red"} span>
{" "}
Bad
</Text>{" "}
- less games can fit into this group. Very low matches in mode 3v3 and 4v4 can fit into
this group.
</li>
Formula:
<Text style={{ fontStyle: "italic" }}>
Sum ELO of all players in match divided by number of players to get match ELO. The
difference between the lowest ELO and highest ELO player is less then 400.
</Text>
</>
<Space h={"xs"} />
<Title order={5}>Limit Group</Title>
<>
<Text>
Average ELO of all players fit in the specified group while the difference between the
lowest ELO and highest ELO player is less then 400.
</Text>
<li>
<Text c={"green"} span>
Good
</Text>{" "}
- should provide the most balanced games
</li>
<li>
<Text c={"red"} span>
{" "}
Bad
</Text>{" "}
- very low matches fit. Unusable for 3v3 and 4v4.
</li>
Formula:
<Text style={{ fontStyle: "italic" }}>
All players in the match has to fit into the specified group. The difference between the
lowest ELO and highest ELO player is less then 400.
</Text>
</>
</>
);
};

const keywords = generateKeywordsString(["coh3 stats", "coh3 discord", "bug report", "github"]);

const sections = [
Expand All @@ -70,6 +207,12 @@ const sections = [
pageDisplayName: "Bug Reports, Feature Request and Contributions",
component: <BugReports />,
},
{
name: "stats",
menuDisplayName: "Statistics",
pageDisplayName: "Game Statistics",
component: <Statistics />,
},
{
name: "data",
menuDisplayName: "Data",
Expand Down
65 changes: 56 additions & 9 deletions screens/stats/stats-container-selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ import {
AnalyticsMapStatsPageView,
} from "../../src/firebase/analytics";
import {
Anchor,
Button,
Container,
Flex,
HoverCard,
MultiSelect,
SegmentedControl,
Select,
Expand All @@ -29,7 +31,8 @@ import config from "../../config";
import InnerGameStatsPage from "./game/inner-game-stats-page";
import InnerMapsStatsPage from "./maps/inner-maps-stats-page";
import { analysisFilterType, analysisMapFilterType } from "../../src/analysis-types";
import HelperIcon from "../../components/icon/helper";
import { IconInfoCircle } from "@tabler/icons-react";
import { getAboutRoute } from "../../src/routes";

const patchSelectorData = getPatchVersionAsMantineV7Groups();

Expand Down Expand Up @@ -250,6 +253,41 @@ const StatsContainerSelector = ({ statsType }: { statsType: "gameStats" | "mapSt
},
],
},
{
group: "Average Fair Matchup",
items: [
{
value: `${statsType === "gameStats" ? "stats" : "mapStats"}-fair-1600-9999`,
label: "Average Fair 1600+",
disabled: disabledMultiFilter.averageDisabled,
},
{
value: `${statsType === "gameStats" ? "stats" : "mapStats"}-fair-1400-1599`,
label: "Average Fair 1400-1599",
disabled: disabledMultiFilter.averageDisabled,
},
{
value: `${statsType === "gameStats" ? "stats" : "mapStats"}-fair-1250-1399`,
label: "Average Fair 1250-1399",
disabled: disabledMultiFilter.averageDisabled,
},
{
value: `${statsType === "gameStats" ? "stats" : "mapStats"}-fair-1100-1249`,
label: "Average Fair 1100-1249",
disabled: disabledMultiFilter.averageDisabled,
},
{
value: `${statsType === "gameStats" ? "stats" : "mapStats"}-fair-800-1099`,
label: "Average Fair 800-1099",
disabled: disabledMultiFilter.averageDisabled,
},
{
value: `${statsType === "gameStats" ? "stats" : "mapStats"}-fair-0-799`,
label: "Average Fair 0-799",
disabled: disabledMultiFilter.averageDisabled,
},
],
},
{
group: "Average Ex 400 diff",
items: [
Expand Down Expand Up @@ -355,23 +393,32 @@ const StatsContainerSelector = ({ statsType }: { statsType: "gameStats" | "mapSt
withCheckIcon={false}
label={
<>
ELO Filter{" "}
<HelperIcon
text={
<Text fw={400}>
<HoverCard width={350} shadow="md">
<HoverCard.Target>
<div>
ELO Filter <IconInfoCircle size={20} />
</div>
</HoverCard.Target>
<HoverCard.Dropdown>
<Text fw={450}>
<Anchor href={getAboutRoute("stats")}>
Learn more about Stats and ELO Filters
</Anchor>
<br />
<b>Average Group</b> - Average ELO of all players fit in the specified group
<br />
<b>Average Fair Matchup</b> - Average ELO of all players fit in the
specified group while the difference between the teams ELO is bellow 20%
<br />
<b>Average Excluded Group</b> - Average ELO of all players fit into
specified group while the difference between the lowest ELO player and
highest ELO player in the match is bellow 400
<br />
<b>Limit Group</b> - ELO of all players in the match must fit into specified
group
</Text>
}
iconSize={18}
position={"bottom"}
/>
</HoverCard.Dropdown>
</HoverCard>
</>
}
defaultValue="all"
Expand Down
12 changes: 12 additions & 0 deletions src/analysis-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ export const analysisFilterTypeArray = [
"stats-average-ex-1250-1399",
"stats-average-ex-1400-1599",
"stats-average-ex-1600-9999",
"stats-fair-0-799",
"stats-fair-800-1099",
"stats-fair-1100-1249",
"stats-fair-1250-1399",
"stats-fair-1400-1599",
"stats-fair-1600-9999",
] as const;

export type analysisFilterType = (typeof analysisFilterTypeArray)[number];
Expand All @@ -57,6 +63,12 @@ export const analysisMapFilterTypeArray = [
"mapStats-average-ex-1250-1399",
"mapStats-average-ex-1400-1599",
"mapStats-average-ex-1600-9999",
"mapStats-fair-0-799",
"mapStats-fair-800-1099",
"mapStats-fair-1100-1249",
"mapStats-fair-1250-1399",
"mapStats-fair-1400-1599",
"mapStats-fair-1600-9999",
] as const;

export type analysisMapFilterType = (typeof analysisMapFilterTypeArray)[number];
Expand Down
6 changes: 5 additions & 1 deletion src/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ export const getDesktopAppRoute = () => {
return encodeURI(`/desktop-app`);
};

export const getAboutRoute = () => {
export const getAboutRoute = (section?: string) => {
if (section) {
return encodeURI(`/about#${section}`);
}

return encodeURI(`/about`);
};

Expand Down