Add a reusable headless simulation and terminal module - #11627
Draft
rrnewton wants to merge 1 commit into
Draft
Conversation
Extract the desktop simulator into a reusable headless Maven module, retain the desktop compatibility facade, and provide terminal, random, and zero controllers. Preserve current upstream seed and AI-profile options while fixing direct file-path deck loading. Test Results Summary: - mvn -pl forge-headless -am test: 11 tests passed (3 forge-game, 8 forge-headless), 0 failed - packaged headless assembly successfully - seeded two-game simulation repeated with identical normalized SHA-256 output - random-controller launcher smoke completed with a winner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This extracts match simulation from the desktop application into a new
forge-headlessMaven module. The desktop entry point remains as a deprecated compatibility facade. The module can run normal Forge AI simulations, a terminal-controlled game, or a lightweight random controller intended for throughput benchmarks.This pull request contains no DeepScry bridge or foreign-agent protocol code. That integration remains on a separate downstream branch.
Behavior preserved and added
headless.shlauncherforge.view.SimulateMatchThe random controller intentionally chooses only from its supported legal-action subset and skips spells that require targets. It is a benchmark/load controller, not an alternative strategic AI. Tournament mode continues to use normal Forge AI; combining tournament mode or AI profiles with random-controller mode fails with a clear message.
Tests
mvn -pl forge-headless -am test: 3 Forge game tests and 8 headless tests passed; 0 failuresmvn -pl forge-headless -am package -DskipTests: passedReviewer notes
The largest file is the terminal controller. It mirrors the breadth of Forge controller callbacks so terminal games can answer choices without a graphical interface. The simulation extraction and terminal mode are in the same module because they share the headless GUI implementation and game bootstrap, but neither changes core game rules.