-
Notifications
You must be signed in to change notification settings - Fork 4.3k
handle no valid moves more gracefully #4598
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
Merged
Merged
Conversation
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
vincentpierre
approved these changes
Oct 23, 2020
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 works for me
/// An optional callback for when the all moves are invalid. Ideally, the game state should | ||
/// be changed before this happens, but this is a way to get notified if not. | ||
/// </summary> | ||
public Action NoValidMoves; |
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.
Suggested change
public Action NoValidMoves; | |
public Action OnNoValidMovesAction; |
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.
Done
Hunter-Unity
added a commit
that referenced
this pull request
Nov 10, 2020
* first pass - matching and gravity work * valid moves WIP * move enumeration, simple checking * move detection * fix up/down directions * actuator and heuristic * sensor * reset if no moves * add masking, retrain * cleanup * config update * optionally force heuristic mode * compressed observations, reset board if no moves * TFModel meta files * WIP abstract * random move heuristic * rename Move fields, migrate IsValid logic * comments * reduce dependency on Match3Agent * abstractBoard as monobehavior * move actuator to extensions * move sensor to extensions * update components in scene * undo accidental checkins * drawing cleanup, custom maxMoves logic * meta file * prefab, use 8 agents * different behaviors * timers, early out * unit tests * docs * Apply suggestions from code review Co-authored-by: Vincent-Pierre BERGES <[email protected]> * doc cleanup, swap to .nn file, add heuristic agents * board iterator * convert others to iterator, rename to Move.MoveIndex * change observation type to enum * fix flip for compressed obs * save dimensions on sensor * save dimension on actuator * Match3 example - special pieces (#4575) * WIP special pieces * add special piece types to obs (need more from master first) * update sensors and models * docstrings * more interesting scoring, smarter heuristic * more steps * longer trained models * handle no valid moves more gracefully (#4598) * handle no valid moves more gracefully * rename callback * cleanup heuristic logic * more sensor and actuator tests * update heuristic configs * docstrings and add to environment docs * sensor and actuator names * compare compressed obs against saved PNGs * review feedback, cleanup TODOs, comments * docstrings, heuristic benchmarks * kind of working * added symbol gameobjects * basic shapes & colors working * cleanup and added background * bug hunt. won't train * merge master version * update prefabs * update prefabs * add image to docs * Update Match3.md * rename some properties * remove unneeded comments and some cleanup Co-authored-by: Chris Elion <[email protected]> Co-authored-by: Vincent-Pierre BERGES <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Proposed change(s)
Handle no valid moves more gracefully. Currently this will result in an exception being thrown from ActuatorDiscreteActionMask because all the actions for the branch will be masked off.
Ideally, the users should check for this state and change the board state before it happens. But we still need to more gracefully handle this since it's not a situation they're actively causing.
The changes in the PR are to:
Useful links (Github issues, JIRA tickets, ML-Agents forum threads etc.)
https://jira.unity3d.com/browse/MLA-1455
Types of change(s)
Checklist