phylib / FortniteTraces

MIT License
6 stars 1 forks source link

About Network Data #1

Closed wazowski78 closed 5 years ago

wazowski78 commented 6 years ago

Hi, firstly, I want to thank you for your great job. My main doubt here is how to get my own Network Data, can you put some light in this issue?

phylib commented 6 years ago

Hi wazowski, our main focus in this work was to simulate games and generate simulated network and movement patterns from those simulations. Therefore, we first recorded data of our own games with the tool winpcap (see https://www.winpcap.org/) and analyzed the generated pcap files later on with Python Scripts. The python scripts for analyzing can be found in this repository. Capturing has to be done manually.

In order to start traffic capturing with winpcap, you can use the following command: .\WinDump.exe -i 2 -s 0 -w ./Test-dummp.pcap

If you have further questions, don't hesitate to ask.

wazowski78 commented 6 years ago

Thank you very much for your reply! I know pcap files sinffing tools well, I suppose when you play your game, you can set up the pcap sniffer to log only some ports to refine the search, can you tell me if there is any set up for that or do I have to use all the data log? And other thing, could you please tell me the correct order to do it? I mean, when I have my pcap file, what is the order I have to execute you scripts to generate my game movement? Thanks a lot :)

phylib commented 6 years ago

Thank you for clarifying your question. Basically, we performed two different analysis.

First, we analyzed the network traffic using Wireshark and the Python library tshark. Details on that can now be found in the Tools/NetworkAnalysis-Folder. The added scripts can already be used to create graphs, visualizing the network behaviour.

For tracing your position on the game map, you need to capture the screen-content while playing the game as well. Therefore, you can use for instance ffmpeg. The following command can be used to start screen capturing, with the current system time as overlay over the resulting video:

ffmpeg.exe -f dshow -rtbufsize 1024M  -i video="UScreenCapture" -vf drawtext=fontfile='C\:\\Windows\\Fonts\\Arial.ttf':text='%{localtime\:%X}':fontcolor=red:fontsize=64 -c:v libx264 -preset ultrafast -pix_fmt yuv420p ../../output.mp4

If you want to extract information, such as the number of active players or the current game phase, from this video, you could have a look to the FortniteVideoAnalysis script. Unfortunately, I have had no time to enhance code documentation for this script. If you are interested in this information, try to have a look at this file and contact me if it's not behaving as expected.

The players position in the game world can be extracted by the Python-Scripts in the repository of Mathias Lux (linked as submodule). Be aware that you have to adapt these scripts for your needs (e.g. adapt resolution, approximate position of the minimap in the video,...). Furthermore, the sample map used for matching the position is the map of the February version of Fortnite, if you use it for the current version of Fortnite, the map has to be replaced with a more current one. We currently develop a more simplified possibility to trace the players position, but it's still buggy and in active development. As soon as it works, we publish it in this repository as well.

If you have further questions, feel free to ask.