Skip to content

chaining: Re-generate actions when branching - #35

Merged
Marc-Alexandre Côté (MarcCote) merged 1 commit into
masterfrom
parallel-quests-navigation
Sep 18, 2018
Merged

chaining: Re-generate actions when branching#35
Marc-Alexandre Côté (MarcCote) merged 1 commit into
masterfrom
parallel-quests-navigation

Conversation

@tavianator

Copy link
Copy Markdown
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
Copy Markdown
Contributor

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.


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

Copy link
Copy Markdown
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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tavian Barnes (@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.

Comment thread textworld/generator/chaining.py Outdated
backtracks = node.backtracks[:i]
parent = node.dep_parent
parents = []
while parent.action:

Copy link
Copy Markdown
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.

Copy link
Copy Markdown
Contributor

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
Marc-Alexandre Côté (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