• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Login
FAForever Forums
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Login

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 Nooby 12 May 2022, 11:08 5 Dec 2022, 11:01

    Currently you can get replays from FAF with a URL as such:

    https://replay.faforever.com/18645999

    It would be good if a URL that downloaded the highest number avalable replay like

    https://replay.faforever.com/latest

    was implemented

    This should not be a hard feature to add

    Something with some more utility and harder to add would be the ability to download all replays based on a date played example

    https://replay.faforever.com/2022/12/05

    1 Reply Last reply Reply Quote 0
    • B Offline
      Brutus5000 FAF Server Admin
      last edited by Brutus5000 12 May 2022, 12:09 5 Dec 2022, 12:08

      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.

      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"

      N 1 Reply Last reply 27 May 2024, 10:43 Reply Quote 4
      • N Offline
        Nooby
        last edited by 5 Dec 2022, 20:58

        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
        • B Offline
          Brutus5000 FAF Server Admin
          last edited by 5 Dec 2022, 21:55

          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
          • C Offline
            Ctrl-K
            last edited by 7 Dec 2022, 07:04

            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 27 May 2024, 10:43

              @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 27 May 2024, 11:05

                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 27 May 2024, 13:01

                  is there a guide on this anywhere?

                  1 Reply Last reply Reply Quote 0
                  • B Offline
                    Brutus5000 FAF Server Admin
                    last edited by 27 May 2024, 15:32

                    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 27 May 2024, 17:20

                      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
                      • B Offline
                        Brutus5000 FAF Server Admin
                        last edited by Brutus5000 27 May 2024, 18:17

                        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
                        • A Offline
                          Askaholic
                          last edited by 27 May 2024, 19:33

                          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
                          • M Offline
                            maudlin27
                            last edited by 28 May 2024, 18:51

                            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 1 Jun 2024, 11:44

                              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 2 Jun 2024, 13:29 Reply Quote 0
                              • S Offline
                                Sainse @Nooby
                                last edited by 2 Jun 2024, 13:29

                                @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 2 Jun 2024, 14:30 Reply Quote 0
                                • N Offline
                                  Nooby @Sainse
                                  last edited by 2 Jun 2024, 14:30

                                  @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 6 Feb 2024, 20:38 2 Jun 2024, 19:54

                                    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 2 Jun 2024, 20:12

                                      @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 2 Jun 2024, 20:38
                                      • N Offline
                                        Nooby
                                        last edited by Nooby 6 Mar 2024, 22:26 3 Jun 2024, 22:22

                                        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 3 Jun 2024, 22:32 Reply Quote 0
                                        • MostLostNoobM Offline
                                          MostLostNoob @Nooby
                                          last edited by 3 Jun 2024, 22:32

                                          @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
                                          • First post
                                            Last post