FAForever Forums
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Login
    The current pre-release of the client ("pioneer" in the version) is only compatible to itself. So you can only play with other testers. Please be aware!

    Add a latest replay URL

    Scheduled Pinned Locked Moved Modding & Tools
    23 Posts 9 Posters 4.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N Offline
      Nooby
      last edited by

      I am getting service unavalable for the API. Is the API down or have I been too much "API learning" to be IP banned?

      1 Reply Last reply Reply Quote 0
      • Brutus5000B Offline
        Brutus5000 FAF Server Admin
        last edited by

        API was down

        He said, "I've been to the year 3000
        Not much has changed, but they live underwater
        And your great-great-great-granddaughter
        Is playin' FAF, playin' FAF"

        1 Reply Last reply Reply Quote 1
        • Ctrl-KC Offline
          Ctrl-K
          last edited by

          Lmao

          “Be a yardstick of quality. Some people aren’t used to an environment where excellence is expected.”
          — Steve Jobs.
          My UI Mods
          Support me

          1 Reply Last reply Reply Quote 0
          • N Offline
            Nooby @Brutus5000
            last edited by Nooby

            @brutus5000 said in Add a latest replay URL:

            No it would not be good to add logic to this endpoint. Nobody is supposed to filter on the replay.faforever.com domain.
            Just (learn to) use our api instead.

            https://api.faforever.com/data/game?filter=replayAvailable==true&sort=-id&page[limit]=1 gives you the latest present replay in the replayUrl field.

            Has the API been locked down? I am getting a permissions error on this link.

            1 Reply Last reply Reply Quote 0
            • S Offline
              Sheikah
              last edited by

              Yes you have to supply an access token now for the API

              1 Reply Last reply Reply Quote 0
              • N Offline
                Nooby
                last edited by

                is there a guide on this anywhere?

                1 Reply Last reply Reply Quote 0
                • Brutus5000B Offline
                  Brutus5000 FAF Server Admin
                  last edited by

                  This is nothing you can do without additional tools.

                  He said, "I've been to the year 3000
                  Not much has changed, but they live underwater
                  And your great-great-great-granddaughter
                  Is playin' FAF, playin' FAF"

                  1 Reply Last reply Reply Quote 0
                  • N Offline
                    Nooby
                    last edited by Nooby

                    I would like to automatically review some replays (units built, when they were built) in certian rating brackets on certian maps using askaholics python replay parser and get a win / loss from each one using the API. Is there no way to do this now?

                    1 Reply Last reply Reply Quote 0
                    • Brutus5000B Offline
                      Brutus5000 FAF Server Admin
                      last edited by Brutus5000

                      You need to implement OAuth login in your script. There are helper libraries for every programming language.

                      The auto discovery url is here: https://hydra.faforever.com/.well-known/openid-configuration

                      He said, "I've been to the year 3000
                      Not much has changed, but they live underwater
                      And your great-great-great-granddaughter
                      Is playin' FAF, playin' FAF"

                      1 Reply Last reply Reply Quote 0
                      • AskaholicA Offline
                        Askaholic
                        last edited by

                        Just be aware that the replay data doesn’t contain exactly the info you’re looking for. It contains the sequences of commands executed by all the players so you can see when units were queued up to be built but you would need to actually run those commands through the simulation to find out when/how many of those queued units were actually built. That’s only possible by viewing the replay with the FAForever.exe. It’s still possible to automate that, I would point you towards the FAForever AI discord since I think some of the AI guys like @maudlin27 have come up with some scripts to automate running a bunch of AI games and analyzing their results. Something similar could probably be done for replays too.

                        1 Reply Last reply Reply Quote 0
                        • maudlin27M Offline
                          maudlin27
                          last edited by

                          The AI development guide linked from the wiki (https://docs.google.com/document/d/1puzW5hKcOBNE7wu7bXj6qXfTJ60r2f93/edit?usp=share_link&ouid=100973959280546778272&rtpof=true&sd=true) gives more details on the AI game automation script created by Softles - essentially it just runs say 8 instances of FAF using different cpu cores to make the process of running lots of AI vs AI games at the same time a bit faster

                          M27AI and M28AI developer; Devlogs and more general AI development guide:
                          https://forum.faforever.com/topic/2373/ai-development-guide-and-m27ai-v71-devlog
                          https://forum.faforever.com/topic/5331/m28ai-devlog-v150

                          1 Reply Last reply Reply Quote 0
                          • N Offline
                            Nooby
                            last edited by

                            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?

                            S maudlin27M 2 Replies Last reply Reply Quote 0
                            • S Offline
                              Sainse Balance Team @Nooby
                              last edited by

                              @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.

                              N 1 Reply Last reply Reply Quote 0
                              • N Offline
                                Nooby @Sainse
                                last edited by

                                @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.

                                1 Reply Last reply Reply Quote 0
                                • JipJ Offline
                                  Jip
                                  last edited by Jip

                                  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

                                  A work of art is never finished, merely abandoned

                                  1 Reply Last reply Reply Quote 0
                                  • maudlin27M Offline
                                    maudlin27 @Nooby
                                    last edited by

                                    @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).

                                    M27AI and M28AI developer; Devlogs and more general AI development guide:
                                    https://forum.faforever.com/topic/2373/ai-development-guide-and-m27ai-v71-devlog
                                    https://forum.faforever.com/topic/5331/m28ai-devlog-v150

                                    1 Reply Last reply Reply Quote 0
                                    • JipJ Jip referenced this topic on
                                    • N Offline
                                      Nooby
                                      last edited by Nooby

                                      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?

                                      MostLostNoobM 1 Reply Last reply Reply Quote 0
                                      • MostLostNoobM Offline
                                        MostLostNoob @Nooby
                                        last edited by

                                        @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

                                        1 Reply Last reply Reply Quote 0
                                        • N Offline
                                          Nooby
                                          last edited by Nooby

                                          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.lua

                                          does 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
                                          UserUnit

                                          repeat 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 / scripting

                                          Is this much script to write? is anyone here able to do so? @maudlin27

                                          maudlin27M 1 Reply Last reply Reply Quote 0
                                          • maudlin27M Offline
                                            maudlin27 @Nooby
                                            last edited by 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 channel

                                            However 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)

                                            M27AI and M28AI developer; Devlogs and more general AI development guide:
                                            https://forum.faforever.com/topic/2373/ai-development-guide-and-m27ai-v71-devlog
                                            https://forum.faforever.com/topic/5331/m28ai-devlog-v150

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post