Skip to content

Handle statistics #22

@timiimit

Description

@timiimit

Description

Statistics need to be saved in the database. These include among other things, number of kills per each weapon, number of deaths per each weapon, hits with certain weapon damage type, etc.

How stats work

endpoint /ut/api/stats/accountId/{id}/bulk/window/{statsType} is used to retrieve all stats. and stats.json in cloudstorage contains score of last 5 played games.

All statistics are collected via analytics. that is on domain datarouter.ol.epicgames.com and endpoint /datarouter/api/v1/public/data + query that looks in my case like this:

?SessionID=%7BD9873B18-401E-A352-9120-D3BB8FB2E4CB%7D&AppID=UnrealTournament.Dev&AppVersion=1.0.0.0%20-%20%2B%2BUT%2BMain-CL-3525109&UserID=9c808754479eaa36e7efe896f204da11%7C0b0f09b400854b9b98932dd9e5abe7c5%7C3d42b762-3e87-4d29-90d8-7f36f619c3ae%7C%7COSS&AppEnvironment=datacollector-binary&UploadType=eteventstream

There is no way to reroute this domain through Engine.ini, so without client modification you need to use hosts file.

Helpful official source code

UT4 Source code comes in handy here because we can figure out all possible types of events that get sent out by studying file UnrealTournament/Source/UnrealTournament/Private/UTAnalytics.cpp.

reading Documents\UnrealTournament\Saved\Stats\stats.html is also useful as it contains all names and meanings of retrieved stat keys. This file is created after you look at stats inside the game.

Desired functionality

statsType in stats retrieval endpoint is either alltime, monthly, weekly, daily. There should probably be buckets for each of these. So all analitycs should at first be saved in a daily bucket, then after 24h all these should be moved to weekly bucket and so on. then at retrieval of say montly we would combine and return stats from daily, weekly and monthly.

Resources

I am also providing 2 fiddler classic session archives which contain all requests and responses to and from official epicgames servers.
1) stats and gameplay
2) just gameplay

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions