Skip to content

chaining: Re-generate actions when branching #35

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 1 commit into from
Sep 18, 2018

Conversation

tavianator
Copy link
Contributor

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.

Copy link
Contributor

@MarcCote MarcCote left a comment

Choose a reason for hiding this comment

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

I'll test it out now.

@@ -406,6 +422,9 @@ def apply(self, node: _Node, action: Action) -> Optional[State]:
new_state.apply(action)

# Some debug checks
# XXX
if not self.check_state(new_state):
Copy link
Contributor

Choose a reason for hiding this comment

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

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).

Copy link
Contributor

Choose a reason for hiding this comment

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

@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.

backtracks = node.backtracks[:i]
parent = node.dep_parent
parents = []
while parent.action:
Copy link
Contributor

Choose a reason for hiding this comment

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

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.
@tavianator tavianator force-pushed the parallel-quests-navigation branch from 587414f to dd90df1 Compare September 17, 2018 14:33
Copy link
Contributor

@MarcCote MarcCote left a comment

Choose a reason for hiding this comment

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

This new code generates better quests. +1

@MarcCote MarcCote merged commit e82c540 into master Sep 18, 2018
@MarcCote MarcCote deleted the parallel-quests-navigation branch September 18, 2018 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants