Skip to content
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

Wolf, Goat, Cabbage scenario #944

Merged
merged 2 commits into from
Jan 25, 2023
Merged

Wolf, Goat, Cabbage scenario #944

merged 2 commits into from
Jan 25, 2023

Conversation

kostmo
Copy link
Member

@kostmo kostmo commented Jan 2, 2023

A challenge scenario that makes use of the NOT prerequisites to simplify evaluation of the win condition. These prerequisites ensure that at no point did the player ever perform some illegal action.

Demo

./scripts/play.sh --scenario data/scenarios/Challenges/wolf-goat-cabbage.yaml --autoplay

Playing

image

Losing

image

@kostmo kostmo force-pushed the wolf-goat-cabbage branch from 4f7dfde to a1a012d Compare January 25, 2023 08:32
@kostmo kostmo marked this pull request as ready for review January 25, 2023 08:33
@kostmo kostmo requested review from byorgey and xsebek January 25, 2023 08:33
This was referenced Jan 25, 2023
@kostmo kostmo added the merge me Trigger the merge process of the Pull request. label Jan 25, 2023
@mergify mergify bot merged commit 109d341 into main Jan 25, 2023
@mergify mergify bot deleted the wolf-goat-cabbage branch January 25, 2023 11:06
@byorgey
Copy link
Member

byorgey commented Jan 26, 2023

I was thinking about this scenario and I like that it can tell you when it's no longer winnable (could Towers of Hanoi be redesigned to make use of that feature?). But I thought it might be nice if you get a custom losing message, e.g. "too bad! the wolf ate the sheep!". I wonder what would be needed to make that happen. Maybe each objective can have a lose_message which is shown whenever that objective is the "cause" of the failed scenario? I'm not really sure how to determine which objective is the "cause" though.

@xsebek
Copy link
Member

xsebek commented Jan 26, 2023

@byorgey we could let a system robot show a popup notification.

It would mean two of them get shown after each other, which is not ideal.


Since the conditions that caused the failure must have been met, how about showing “failure” reason from all of them? In this case the only one met will mention wolf and sheep. Generally we would try to produce something like parser errors - “I was expecting X or Y”.


EDIT: Hanoi could definitely use failure condition - just check if there is more than one disc missing or they are not sorted.

I kind of like it as a test of our ability to enforce invariant though.

Still, maybe we could add a failure condition in case the player manages to fool the system robots. 😄

@kostmo
Copy link
Member Author

kostmo commented Jan 26, 2023

An objective can only "fail" if it has a "prerequisites" expression that contains a negated goal reference. The BoolExpr library allows us to query for and list all of the negated references in an expression. So we could just match that list against the "completed" objectives, and display as a summary in the "Condolences" popup.

@kostmo kostmo mentioned this pull request Oct 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Trigger the merge process of the Pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants