Match Mode Rules [AARD-1893] - #1199
Conversation
Features teleop and autonomous time
…3/match-mode-rules
|
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. |
rutmanz
left a comment
There was a problem hiding this comment.
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 |
Dhruv-0-Arora
left a comment
There was a problem hiding this comment.
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.
The scoreboard is reset when you start match mode again, but I can have it reset after match mode also
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). |
Dhruv-0-Arora
left a comment
There was a problem hiding this comment.
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. |
@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 ...
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.

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: