Skip to content

Match Mode Rules [AARD-1893] - #1199

Merged
BrandonPacewic merged 26 commits into
devfrom
alexey/1893/match-mode-rules
Jul 14, 2025
Merged

Match Mode Rules [AARD-1893]#1199
BrandonPacewic merged 26 commits into
devfrom
alexey/1893/match-mode-rules

Conversation

@AlexD717

@AlexD717 AlexD717 commented Jul 8, 2025

Copy link
Copy Markdown
Member

Task

Match Mode Rules and Configuration

AARD-1893

Create a way to allow the user to select a ruleset when starting match mode. This ruleset then affects the game parameters in specified ways to account for different rules in different years.

Symptom

Currently when you start match mode certain parameters, such as how long the match lasts, are hardcoded variables that can't be modified by the user. This means that if you want to test the game for a specific year where the autonomous time was longer than 15 seconds there is no way to do so.

Solution

When you press match mode a configuration panel opens up allowing you to select which years ruleset to use, or upload your own custom json.
Screenshot 2025-07-08 at 11 40 08 AM
Currently the only data the json stores is the length of teleop, autonomous, and endgame, but this can be easily expanded to support more parameters. Once the user selects what ruleset to use the data is parsed and the corresponding variables that control match duration in MatchMode.ts are updated to the new values.

There are preset rulesets for the years 2025, 2024, and 2018 (power up). However, because we can't predict the game for next year, the user can upload their own json following our format to set the match length to whatever they want. Currently there is no tutorial explaining what format the data has to follow. Ideally their should be a help button that links to a page on our website explaining the format.

Verification

To test these changes I selected in pre-set match ruleset and made sure that the time the match lasted, corresponded to the data in the json. I also tried uploading multiple valid and invalid custom json files, making sure that the data was accepted if it followed the format and rejected if it had invalid data. If only some data was invalid (such as missing an optional field like autonomous time) a warning is printed but the rest of the data is accepted.

Unit tests were also written to render this panel making sure that nothing crashes, and to test uploading valid and invalid custom json rulesets.


Before merging, ensure the following criteria are met:

  • All acceptance criteria outlined in the ticket are met.
  • Necessary test cases have been added and updated.
  • A feature toggle or safe disable path has been added (if applicable).
  • User-facing polish:
    • Ask: "Is this ready-looking?"
  • Cross-linking between Jira and GitHub:
    • PR links to the relevant Jira issue.
    • Jira ticket has a comment referencing this PR.

@AlexD717 AlexD717 self-assigned this Jul 8, 2025
@AlexD717
AlexD717 requested a review from a team as a code owner July 8, 2025 18:43
@AlexD717 AlexD717 added ui/ux Relating to user interface, or in general, user experience gameplay Relating to the playability of Synthesis labels Jul 8, 2025
@AlexD717
AlexD717 requested a review from a team as a code owner July 8, 2025 18:43
@AlexD717 AlexD717 changed the title Alexey/1893/match mode rules Match Mode Rules [AARD-1893] Jul 8, 2025
@azaleacolburn

Copy link
Copy Markdown
Contributor

We should probably just the format in the UI, or have a UI element to create custom rulesets, but that could be another PR.

@AlexD717

AlexD717 commented Jul 8, 2025

Copy link
Copy Markdown
Member Author

We should probably just the format in the UI, or have a UI element to create custom rulesets, but that could be another PR.

I agree that a UI menu would be a better way to allow custom match rulesets, but I do think that it should be its own PR as this was mostly about the underlying framework.

Comment thread fission/src/ui/panels/configuring/MatchModeConfigPanel.tsx Outdated
Comment thread fission/src/ui/panels/configuring/MatchModeConfigPanel.tsx Outdated
Comment thread fission/src/ui/panels/configuring/MatchModeConfigPanel.tsx Outdated
@AlexD717
AlexD717 requested a review from azaleacolburn July 9, 2025 16:13

@azaleacolburn azaleacolburn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

Comment thread fission/src/ui/panels/configuring/MatchModeConfigPanel.tsx Outdated
Comment thread fission/src/systems/MatchMode.ts
Comment thread fission/src/ui/panels/configuring/MatchModeConfigPanel.tsx Outdated
Comment thread fission/src/ui/panels/configuring/MatchModeConfigPanel.tsx Outdated

@rutmanz rutmanz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not sure why I didn't think about this before, but what's the intent behind making the default configs stored in json files rather than as an array in some TS file like the input schemes?

@AlexD717

Copy link
Copy Markdown
Member Author

Not sure why I didn't think about this before, but what's the intent behind making the default configs stored in json files rather than as an array in some TS file like the input schemes?

I guess I never thought of that. The Jira issues said that I could choose the way to store the data and listed json as an example so that what I did. I guess I will go through and change it to being a typescript file

@AlexD717
AlexD717 requested a review from rutmanz July 10, 2025 22:37

@rutmanz rutmanz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Other than that, lgtm

Comment thread fission/src/ui/panels/configuring/MatchModeConfigPanel.tsx Outdated
@AlexD717
AlexD717 requested a review from rutmanz July 10, 2025 22:45

@Dhruv-0-Arora Dhruv-0-Arora left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you make the scoreboard reset after the Match is done?

Also, not sure if everyone would find this helpful, but maybe make a flag or notify the user in some way when the autonomous time or teleop time is enabled (this is moreso for the "Match Test" config. This change might not be useful so its really up to you.

Comment thread fission/src/systems/DefaultMatchModeConfigs.ts
@AlexD717

Copy link
Copy Markdown
Member Author

Can you make the scoreboard reset after the Match is done?

The scoreboard is reset when you start match mode again, but I can have it reset after match mode also

Also, not sure if everyone would find this helpful, but maybe make a flag or notify the user in some way when the autonomous time or teleop time is enabled (this is moreso for the "Match Test" config. This change might not be useful so its really up to you.

I think that the game sounds do a good enough job of this, and that this should be implemented in a different PR (if we decide that we need it).

@AlexD717
AlexD717 requested a review from Dhruv-0-Arora July 11, 2025 17:43

@Dhruv-0-Arora Dhruv-0-Arora left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think for another task it might be nice to hide the scoreboard unless you are currently in a match (since there isn't much utility outside of that). However, this lgtm

@AlexD717

Copy link
Copy Markdown
Member Author

I think for another task it might be nice to hide the scoreboard unless you are currently in a match (since there isn't much utility outside of that). However, this lgtm

It would be better if this were a toggle option, so that they could choose to keep the scoreboard. If you are practicing a match in single-player mode, you might want to have a score tracker but not be limited by the match mode time.

@BrandonPacewic

Copy link
Copy Markdown
Member

I think for another task it might be nice to hide the scoreboard unless you are currently in a match (since there isn't much utility outside of that). However, this lgtm

@Dhruv-0-Arora There’s actually already a way to hide the scoreboard — it’s available as a toggle in the General Settings panel.

In the future, if you have suggestions like this, I’d support you taking a quick look through the codebase or UI to see if the feature already exists. And if it doesn’t, to either create or suggest a ticket for it — that’d be really helpful.

* dev: (38 commits)
  code cleanup and formatting
  feat: adding export of tags into assembly data
  isort formatting
  Disable Default Key Functions
  formatting
  feat: added blank icon to allow users to select rows
  fix(snyk): update version requirements
  reorder dependencies
  chore(installer): update python packages to avoid vulerabilities
  fix: cleaning dead code and fixing spelling error
  Unused Imports Removed
  Merge Fix
  fix: clean up workflow spacing, use latest checkout and setup-node steps
  fix: use correct package.json path
  feat: add npm caching to all npm-involving workflows
  Update fission/src/test/MirabufParser.test.ts
  fix: cleanup of unused code
  feat: adding component column and changing UI remove row message
  Type & Removed Unnecessary Link
  Build Fix
  ...
@BrandonPacewic BrandonPacewic mentioned this pull request Jul 14, 2025
@BrandonPacewic
BrandonPacewic merged commit e90bf85 into dev Jul 14, 2025
16 checks passed
@BrandonPacewic
BrandonPacewic deleted the alexey/1893/match-mode-rules branch July 14, 2025 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gameplay Relating to the playability of Synthesis ui/ux Relating to user interface, or in general, user experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants