Skip to content

Conversation

Garanas
Copy link
Member

@Garanas Garanas commented Jul 17, 2025

Description of the proposed changes

Fixes various things:

  • Documents and annotate the majority of the launching a skirmish via the command line interface.
  • Assign the default value of all lobby options by default.
  • Add support for /gameoptions argument to define lobby options.
  • Add support for (a new) /gamebots argument to define AI army configurations.
  • Add support for (a new) /gamemods argument to define what (sim) mods to load.
  • Add support for (a new) /runWithTheWind argument to run the simulation as fast as possible.
  • Fix an issue with the scoreboard for missing the FullShare option.

And introduces a new powershell script as inspired by the script made by @lL1l1. It serves as an example on how to launch a bot session.

Testing done on the proposed changes

It enables a setup such as this:

launch-bot-session-01.mp4

The AI is running, but the AI itself is not functional yet. The procedure is described at:

Where you can launch the game from Visual Studio Code using command line arguments.

Additional context

I am not aware of this functionality being used anywhere except for the AI tournament functionality of Softles. That setup overrides this file however. The existing launch script uses the autolobby functionality. Therefore I'm not that afraid of backwards compatibility issues.

Checklist

Some of these changes are inspired by the work of @HardlySoftly , see also attached his scripts for the automated AI tournaments.

FAF-AI-Autorun-main.zip

@Garanas Garanas marked this pull request as ready for review July 17, 2025 14:47
@Garanas
Copy link
Member Author

Garanas commented Jul 17, 2025

I'm quite certain that this file is barely, if ever used. For example, for campaign maps it still checked for the scenario type campaign instead of campaign_coop.

Therefore the question is - do we even need to support that? And if we do want to, is that part of the scope of this pull request?

@Garanas Garanas changed the title Extend single player launch capabilities Extend command line launch capabilities Jul 17, 2025
@Garanas Garanas changed the title Extend command line launch capabilities Extend command line single player launch capabilities Jul 19, 2025
@Garanas
Copy link
Member Author

Garanas commented Jul 20, 2025

@lL1l1 it may be interesting to rename LaunchFAInstances to something like LaunchAutolobby. What are your thoughts about that?

@lL1l1
Copy link
Contributor

lL1l1 commented Jul 20, 2025

I actually made it launch the custom lobby in #6856, so that new name wouldn't fit.

@Garanas
Copy link
Member Author

Garanas commented Jul 20, 2025

I actually made it launch the custom lobby in #6856, so that new name wouldn't fit.

I see now. What are your thoughts - perhaps we can split it into two PowerShell scripts? There's a giant if-statement at the bottom of the current PowerShell script.

@lL1l1
Copy link
Contributor

lL1l1 commented Jul 21, 2025

I think it would be nice to reuse the other logic that exists in the script, but it could use a little refactor split the 1/0-player scenarios with AI the multiplayer/lobby scenarios more clearly. I would put the 1/0 player scenario closer to the top of the file with an exit statement to terminate the script. The big chunk of multiplayer logic with networking params, window size, teams, divisions/clans, etc. can be placed after that.

I also like the format for your argument list in LaunchBotSession, the base arguments could be moved to the top of the file so that it is easier to understand for someone editing the script for the first time.

@Garanas
Copy link
Member Author

Garanas commented Aug 4, 2025

These changes will cause a merge conflict with #6873. I was not aware of #6873 when I made this pull request, even though I was appointed to review 😞

@BlackYps BlackYps removed this from the Development Iteration III of 2025 milestone Aug 15, 2025
@Garanas
Copy link
Member Author

Garanas commented Aug 16, 2025

@BlackYps What is the plan with this pull request? Because #6873 is merged there's now merge conflicts that I can't fix because they are also semantically incompatible.

@BlackYps
Copy link
Contributor

BlackYps commented Sep 4, 2025

I can't really tell you what your plan should be. I understand that there is a conflict, but can't you build upon the changes of #6873?

@Garanas
Copy link
Member Author

Garanas commented Sep 10, 2025

@lL1l1 Would you be fine if I undo some of your changes made to SetupBotSession in #6873 in favor of the version in this pull request? The version in this pull request provides more control through the command line.

@lL1l1
Copy link
Contributor

lL1l1 commented Sep 11, 2025

@lL1l1 Would you be fine if I undo some of your changes made to SetupBotSession in #6873 in favor of the version in this pull request? The version in this pull request provides more control through the command line.

Yeah that's fine.


--- Generates a table of all set game mods.
---
--- Lobby options can be set using the `/gamemods` argument. The format is `/gamemods uid:name uid:name ...`. The name is not used but it is useful to document what mod the UID is supposed to represent. As an example: `/gamemods f27c55b4-v075-55b4-92b6-64398e75e23f:m27ai faf0863e-94a0-b0b0-9ba583e9feb4:rngai`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the mod name can be used to pick a different version of the same mod if the exact uid is unavailable?

---@class UISinglePlayerSessionConfiguration
---@field scenarioInfo UILobbyScenarioInfo
---@field scenarioMods ModInfo[]
---@field teamInfo table
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This type is like PlayerData[] except a stripped down version without the multiplayer-related data. Maybe something like EnginePlayerData should be created.

@@ -0,0 +1,3 @@
- (#6888) Make it more convenient to launch a (bot) session through the command line

With these changes we shorten the workflow to test (sim) mods and in particular AI mods. There is an example PowerShell script file in the `scripts` folder to help you get started.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
With these changes we shorten the workflow to test (sim) mods and in particular AI mods. There is an example PowerShell script file in the `scripts` folder to help you get started.
With these changes we shorten the workflow to test (sim) mods and in particular AI mods. There is an example PowerShell script file in the `scripts` folder to help you get started.

# "/seed", "1",

# Enable cheats
"/cheats",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work? I don't see this string in lua or the decompilation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants