<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Masum Billal on Medium]]></title>
        <description><![CDATA[Stories by Masum Billal on Medium]]></description>
        <link>https://medium.com/@billal.masum?source=rss-201c5858217e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Wb5000DRzwY7keiD1tnAgQ.jpeg</url>
            <title>Stories by Masum Billal on Medium</title>
            <link>https://medium.com/@billal.masum?source=rss-201c5858217e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 19:19:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@billal.masum/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Track Team Death Match Stats in PUBG (Arcade TDM in PUBG)]]></title>
            <link>https://medium.com/@billal.masum/track-team-death-match-stats-in-pubg-a857ed216395?source=rss-201c5858217e------2</link>
            <guid isPermaLink="false">https://medium.com/p/a857ed216395</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[ocr]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[pubg]]></category>
            <category><![CDATA[django-ninja]]></category>
            <dc:creator><![CDATA[Masum Billal]]></dc:creator>
            <pubDate>Mon, 02 Sep 2024 06:34:42 GMT</pubDate>
            <atom:updated>2024-09-10T01:11:28.715Z</atom:updated>
            <content:encoded><![CDATA[<p>PUBG does not keep track of Arcade mode matches, more specifically, team death matches (TDM). I have been playing this game for a short time now. The people I play with like this arcade mode and we play it quite a lot. The problem is, it does not have any stats tracking dashboards in PUBG or even in websites like <a href="https://tracker.gg/pubg">tracker.gg</a>. Somehow the topic of creating a tool to keep track of these stats came up and I worked on it for a few days.</p><p>I ended up creating a backend API with a Swagger API doc for a user interface to communicate with it. In this article, I will describe the installation and usage procedure.</p><p><strong>Required: Nvidia GPU driver, Git, Python, Poetry</strong></p><p>Preferred operating system: linux. The equivalent process should also work on windows.</p><p><strong>Screenshots for Scoring</strong></p><p>After all the rounds are over, when the final results are shown, take a screenshot. The system works best for higher quality screenshots. Optimal resolution for most accurate results is 4k. The images must have one of the following extensions: .png, .jpg, .jpeg</p><p>Note: this is for PC only. I have never tried PUBG mobile or other versions so not sure if it will work for those.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q44ZVza952_h1qwtTh7tmw.jpeg" /><figcaption>Sample of an ideal final scoreboard</figcaption></figure><p>Names have been blurred for obvious reasons.</p><p><strong>Install and Usage</strong></p><p>First, make sure you have nvidia driver installed and properly running. The output should look like this</p><pre>nvidia-smi <br>Sun Sep  1 10:26:41 2024       <br>+-----------------------------------------------------------------------------------------+<br>| NVIDIA-SMI 550.90.07              Driver Version: 550.90.07      CUDA Version: 12.4     |<br>|-----------------------------------------+------------------------+----------------------+<br>| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |<br>| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |<br>|                                         |                        |               MIG M. |<br>|=========================================+========================+======================|<br>|   0  NVIDIA GeForce RTX 4080        Off |   00000000:08:00.0  On |                  N/A |<br>|  0%   48C    P8             12W /  340W |    1037MiB /  16376MiB |      0%      Default |<br>|                                         |                        |                  N/A |<br>+-----------------------------------------+------------------------+----------------------+<br>                                                                                       </pre><p>Install git and clone the <a href="https://github.com/proafxin/tdm-tracker">repository</a> containing the code and change directory into the root project directory where you cloned the code. Then install <a href="https://python-poetry.org/docs/#installing-with-the-official-installer">poetry</a>.</p><p>Create an environment variable <em>DJANGO_NINJA_SECRET_KEY</em> and assign it some random value. For example,</p><pre>git clone https://github.com/proafxin/tdm-tracker<br>cd tdm-tracker/<br>export DJANGO_NINJA_SECRET_KEY=&quot;somesercretkey&quot;</pre><p>You may have to export the environment variable in bashrc file. Now, run the following commands sequentially (wait for one to finish first, then start the next one):</p><pre>poetry install<br>poetry run python manage.py makemigrations<br>poetry run python manage.py migrate<br>poetry run gunicorn statracking.asgi:application -k uvicorn.workers.UvicornWorker --reload</pre><p>This may take a long time to finish. After it’s done, go to <a href="http://127.0.0.1:8000/docs">http://127.0.0.1:8000/docs</a></p><p>You should see the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N9WcOGQyfYv0aWfeoGwAKA.png" /><figcaption>API doc</figcaption></figure><p><strong>Create the Game</strong></p><p>First, create a game by using the name PUBG in the /game/new endpoint. After execution, you should see the following response:</p><pre>{<br>  &quot;name&quot;: &quot;PUBG&quot;,<br>  &quot;created_at&quot;: &quot;2024-09-01T05:45:10.123Z&quot;,<br>  &quot;updated_at&quot;: &quot;2024-09-01T05:45:10.124Z&quot;,<br>  &quot;id&quot;: 1<br>}</pre><p><strong>Parse A Single Screenshot</strong></p><p>Go to /stats/pubg endpoint. In the date field, enter the date when the game was played. Format: YYYY-MM-DD, example: 2024–09–01. In the file section, choose the file you want to upload for parsing and press execute.</p><p>The response should be like the following</p><pre>[<br>  {<br>    &quot;game_id&quot;: 1,<br>    &quot;victory&quot;: false,<br>    &quot;name&quot;: &quot;some_name&quot;,<br>    &quot;kill&quot;: 14,<br>    &quot;assist&quot;: 5,<br>    &quot;death&quot;: 11,<br>    &quot;point&quot;: 2230,<br>    &quot;date&quot;: &quot;2024-09-01T00:00:00&quot;,<br>    &quot;created_at&quot;: &quot;2024-09-01T18:14:38.491Z&quot;,<br>    &quot;updated_at&quot;: &quot;2024-09-01T18:14:38.491Z&quot;,<br>    &quot;id&quot;: 1<br>  }<br>]</pre><p><strong>Batch Processing Multiple Images</strong></p><p>Alternatively, you can also batch process images if you have them all in one directory. Again, fill up the date field and enter the absolute path of the directory in which the screenshots exist. For example: /home/username/Pictures/pubg then execute the API. You will see a response like the following</p><pre>[<br>  &quot;/home/username/Pictures/pubg/1.jpg&quot;,<br>  &quot;/home/username/Pictures/pubg/2.jpg&quot;<br>]</pre><p>This is the list of images that were processed. The data is kept in the db.sqlite file automatically. It can contain enough data for a single user for a long time. Use <a href="https://sqlitebrowser.org/">Sqlite browser</a> to check the data that was parsed and stored in the database. The data should be self-explanatory for a PUBG player.</p><p><strong>Latest Individual Stat</strong></p><p>Go to the endpoint /latest/individual and enter a username for whom you want to find the stats during their latest gameplay. The date considered for this is the last active day in which they have played at least one game. You should a response like the following:</p><pre>{<br>  &quot;name&quot;: &quot;some_name&quot;,<br>  &quot;game_id&quot;: 1,<br>  &quot;total_played&quot;: 1,<br>  &quot;total_won&quot;: 1,<br>  &quot;total_lost&quot;: 0,<br>  &quot;total_assist&quot;: 4,<br>  &quot;total_death&quot;: 20,<br>  &quot;total_kill&quot;: 9,<br>  &quot;total_point&quot;: 2040,<br>  &quot;valid_assist_match&quot;: 1,<br>  &quot;valid_death_match&quot;: 1,<br>  &quot;valid_kill_match&quot;: 1,<br>  &quot;valid_point_match&quot;: 1,<br>  &quot;created_at&quot;: &quot;2024-09-01T20:49:23.072Z&quot;,<br>  &quot;updated_at&quot;: &quot;2024-09-01T20:49:23.072Z&quot;,<br>  &quot;kda&quot;: 0.45,<br>  &quot;average&quot;: 9<br>}</pre><p><strong>Performance In A Date Range</strong></p><p>Go to the endpoint /stats/pubg/range Enter the name of the player, starting date and end date for the range. The response will be like this:</p><pre>{<br>  &quot;name&quot;: &quot;some_name&quot;,<br>  &quot;game_id&quot;: 1,<br>  &quot;total_played&quot;: 5,<br>  &quot;total_won&quot;: 2,<br>  &quot;total_lost&quot;: 3,<br>  &quot;total_assist&quot;: 9,<br>  &quot;total_death&quot;: 58,<br>  &quot;total_kill&quot;: 53,<br>  &quot;total_point&quot;: 9660,<br>  &quot;valid_assist_match&quot;: 5,<br>  &quot;valid_death_match&quot;: 5,<br>  &quot;valid_kill_match&quot;: 5,<br>  &quot;valid_point_match&quot;: 5,<br>  &quot;created_at&quot;: &quot;2024-09-01T20:49:25.274Z&quot;,<br>  &quot;updated_at&quot;: &quot;2024-09-01T20:49:25.274Z&quot;,<br>  &quot;kda&quot;: 0.9137931034482759,<br>  &quot;average&quot;: 10.6<br>}</pre><p>This is not a polished API so there may be some corner cases not taken care of. If there is any issue using this, feel free to create one <a href="https://github.com/proafxin/tdm-tracker/issues">here</a>. However, please make sure you have done everything on your end correctly first. For example, you need python available in your system. If you don’t have it and encounter errors that’s not something I can help you with. You should be able to figure these small things out on your own.</p><p>Here is the repo with the source: <a href="https://github.com/proafxin/tdm-tracker">https://github.com/proafxin/tdm-tracker</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a857ed216395" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>