Add a latest replay URL
-
thanks for all this info - It was very easy to get the AI automation script running.
To use this script to anaylse replays could some LUA script get all the existing units and there locations every 10? seconds and dump it to a text file?
And then just modify the script to run replays instead of make new games?
-
@nooby The first part is probably possible, Kazbek faf analysis was doing something similar. You could scroll the entire game directly on the website in 15-30 seconds and units were displayed at yellow dots. The more units in the same area, the bigger the dots. You could basically see map control. But it didn’t distinguish t1 scout and gc in these dots.
However I’m not sure how rebuilding new replay from the old one concept is possible. Let’s say you can dump them into a text file. But can you create replay out of such a text file? That would be much, much harder.
-
@sainserow said in Add a latest replay URL:
@nooby The first part is probably possible, Kazbek faf analysis was doing something similar. You could scroll the entire game directly on the website in 15-30 seconds and units were displayed at yellow dots. The more units in the same area, the bigger the dots. You could basically see map control. But it didn’t distinguish t1 scout and gc in these dots.
I think it was analysing commands, as Askaholic stated, rather than where the units actually were.
I dont understand what you mean by creating a new replay from the old one?
The purpose is to generate unit position, identifcation and time data that can be used to get some insight into the way the game is played with other tools.
-
You can also end all series of commands with an attack move. As an example: if you send out an engineer to build a few extractors you add an attack move command at the end. That way it will reclaim instead of idle as you describe. It won't build extractors though. The engineer also won't show as idle.
I think in general if you feel like your units are idling too much then you're not batch-queueing enough commands. The more commands you queue at a given moment (which usually takes very little to no time) the less often you need to check on the unit :). If you're not aware of it: distributing orders (the hotkey) can also be very useful to quickly batch commands to units with little effort. Especially when you're dealing with many-to-many relationships (many engineers that want to build many extractors)
edit: I think I responded to the wrong topic
edit2: yep: https://forum.faforever.com/topic/7690/question-feedback-before-i-dig-in/13 -
@nooby Yes it's possible to export information to a text file (although it makes things run very slowly depending on how much information you're exporting at once). E.g. I would expect you could modify the FAF files on your local machine (using a copy of the FAF develop repo) to do this when running a replay.
i've not looked into whether it's possible to run replays in the same way that the AI automation script hosts games, but I'd have thought there's a decent chance of coming up with something that will run a replay.
However, it would be a time consuming process to do this for FAF replays in an offline setup in large numbers - e.g. when I want to view a FAF replay offline it means loading the replay through the FAF client, which then creates a temporary (offline compatible) replay file, and then I copy that offline replay file into my offline replays folder, load up FAF in offline mode, and I can then load the replay. It will also either fail to load if I'm using a different FAF exe (major updates often change the exe), or desync if there are differences in the SIM mods (e.g. I've got a more recent version of a SIM mod).
-
-
Thanks for all the info @maudlin27
While I am sure I could figure out some python scripting around launching the faf.exe and replays automatically
The exporting information to a text file is beyond my skillset
Is it possible to run the FAF EXE in a windowless or headless graphics free mode?
Is there a documented list of command line options avalable to the executable? -
@nooby said in Add a latest replay URL:
Is there a documented list of command line options avalable to the executable?
This should get you started: https://wiki.faforever.com/en/Development/Game-Development/Command-Line-Switches
-
I am trying to understand how to make a mod that captures information about units through the replay
Looking at the LUA documentation:
https://supcom.fandom.com/wiki/LUADOC_1.5.3599#User
https://github.com/FAForever/fa/blob/develop/engine/User/UserUnit.luadoes using User.UserUnit make it a UI only mod?
For the dump to file script
if unit is alive (using IsDead)
if it is dump a line to log that contains
GetGameTick
GetArmy
GetUnitId
GetPosition
GetOrientation
GetVelocity
GetMaxHealth
GetHealth
GetShieldRatio
IsIdle
UserUnitrepeat every X seconds.
Could dump some unit types info at a faster rate than others, depending on unit speed, or importance for instance.
Do sim mods have access to any files that are not the game log?
Could just add an identifier start charicter to each line of the game log however.
Data could then be put into a better datasctructure and compressed using other external tools / scriptingIs this much script to write? is anyone here able to do so? @maudlin27
-
@nooby I’ve no experience with UI mods (only SIM mods), you could try in the FAF modding discord in terms of finding out what is possible: https://discord.com/channels/197033481883222026/832710161847287819
You might need to set your roles to indicate an interest in modding to access the channelHowever if it was possible then most likely you’d need to write the code yourself (unless one of the modders was interested in doing the same thing)
-
I have created the "Unit Logger" mod. It is in the mod vault. It is a UI mod.
EDIT - V2 Released with reduced decimal places and unit masskilled added
Logs information on every unit of of focus army every 10 game ticks, configureable in main.lua
Information logged:
"UL02","GameTick","EntityId","Army","UnitId","FractionComplete","Position.x","Position.y","Position.z","MaxHealth","Health","ShieldRatio","IsIdle","MassKilled"
WARNING: If you have 1500 units and an hour game expect gigabyte size logs.
It works in replays if you select the army of the player you require logging.
It requires UMT / UI Mod Tools / ui-mod-tools-4z0t-v12
Thanks for 4z0t for some of the code that makes this workThis data is not in an eficcient format at all - that can be done after the game has ended.
I need to look at logging all units from all armies at once when observer. i dont know if this is possible with a UI mod.
Example data:
info: UL02 GameTick EntityId Army UnitId FractionComplete Position.x Position.y Position.z MaxHealth Health ShieldRatio IsIdle MassKilled info: UL02 1350 321 1 uea0303 1 171.915 35.555 717.439 2300 1550 0 0 180 info: UL02 1350 421 1 uea0303 1 231.838 34.695 652.384 2300 300 0 0 482 info: UL02 1350 344 1 uea0303 1 109.883 35.376 720.888 2300 2050 0 0 45 info: UL02 1350 369 1 uea0303 1 142.596 38.140 688.592 2300 1300 0 0 45 info: UL02 1360 736 1 uea0303 1 111.701 36.286 717.892 2300 1550 0 0 270 info: UL02 1360 0 1 ual0001 1 108.207 25.830 920.259 11000 11000 0 1 0 info: UL02 1360 262 1 uea0303 1 98.083 37.232 730.919 2300 1550 0 0 450 info: UL02 1360 280 1 uea0303 1 97.939 36.571 708.237 2300 1050 0 0 90 info: UL02 1360 364 1 uea0303 1 145.077 37.485 686.651 2300 1800 0 0 225 info: UL02 1360 318 1 uea0303 1 142.312 37.525 684.928 2300 1550 0 0 360 info: UL02 1360 438 1 uea0303 1 196.809 37.850 668.522 2300 1550 0 0 433