-
Notifications
You must be signed in to change notification settings - Fork 243
Extend command line single player launch capabilities #6888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
The game expects a list of (parsed) mod_info files.
I'm quite certain that this file is barely, if ever used. For example, for campaign maps it still checked for the scenario type 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? |
@lL1l1 it may be interesting to rename |
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. |
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 |
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? |
|
||
--- 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` |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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", |
There was a problem hiding this comment.
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.
Description of the proposed changes
Fixes various things:
/gameoptions
argument to define lobby options./gamebots
argument to define AI army configurations./gamemods
argument to define what (sim) mods to load./runWithTheWind
argument to run the simulation as fast as possible.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