chaining: Re-generate actions when branching#35
Merged
Conversation
MarcCote
reviewed
Sep 13, 2018
|
|
||
| # Some debug checks | ||
| # XXX | ||
| if not self.check_state(new_state): |
Contributor
There was a problem hiding this comment.
Yep, I agree with moving this after the apply and we can remove the check_state at line 419 I think. I had to do it in #36 since now some (expanded) rules might generate invalid state (e.g. in(box, box'), we are not allowing nested boxes).
Contributor
There was a problem hiding this comment.
@tavianator forget what I said about removing the first check_state (line 419). Removing it would cause duplicate in the chains we generate. Let's just remove the assert then.
MarcCote
reviewed
Sep 14, 2018
textworld/generator/chaining.py
Outdated
| backtracks = node.backtracks[:i] | ||
| parent = node.dep_parent | ||
| parents = [] | ||
| while parent.action: |
Contributor
There was a problem hiding this comment.
Should be while parent and parent.action
This improves the quality of quests that include navigation actions, by re-generating actions after the player has moved into a new room, for example.
587414f to
dd90df1
Compare
MarcCote
approved these changes
Sep 18, 2018
Contributor
MarcCote
left a comment
There was a problem hiding this comment.
This new code generates better quests. +1
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.
This improves the quality of quests that include navigation actions, by
re-generating actions after the player has moved into a new room, for
example.