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

New event style #218

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
33c795f
The text grammar of Spaceship game
HakiRose Aug 23, 2019
e375e2f
Spaceship making file, some modifications on grammar_maker
HakiRose Aug 27, 2019
6f1fae7
The spaceship game maker file
HakiRose Aug 27, 2019
5ed900b
The customized text grammar and logics of spaceship game
HakiRose Aug 28, 2019
47757f1
This is the design of the infrastructure of medium level of the game …
HakiRose Aug 29, 2019
dbcd1b1
parent 47757f1354b413b6ff9fabf1b45d3917ef6e3d93
HakiRose Sep 6, 2019
5bcaed7
push button updated logic and files
HakiRose Sep 16, 2019
2ddb67e
A new update to midium level game: Add conditions to change th erewar…
HakiRose Oct 11, 2019
7029059
The original Spaceship game file is the spaceship_game.py
HakiRose Oct 24, 2019
db7fda3
Registered game samples, Simple RL agent (already designed in tutoria…
HakiRose Nov 8, 2019
6168512
the spaceship game: the latest version of the game, Framework updates…
HakiRose Dec 20, 2019
99656ba
The spaceship game - medium level v1.0 full package
HakiRose Jan 6, 2020
cf62bab
changes on spaceship_game after rebasing
HakiRose Feb 26, 2020
1c49af3
New project to implement the EventAction class
HakiRose Feb 8, 2020
878b9fe
new changes on content_check branch after rebasing
HakiRose Feb 26, 2020
a319361
temporary uploads
HakiRose Feb 17, 2020
9c003c0
The new style of TRACEABLE PROPOSITIONS and comprehenssive updates to…
HakiRose Feb 24, 2020
0c9040f
Some updates on Traceable controling process, removed redundant eleme…
HakiRose Feb 26, 2020
4de1ba6
updates on New_event_style after rebasing
HakiRose Feb 26, 2020
3810348
The new updates over the NEW STYLE of the FRAMEWORK after the rebase,…
HakiRose Feb 28, 2020
14071ae
New TextWorld framework structure includes: new quest description, ne…
HakiRose Apr 18, 2020
5a77916
Updates on new TextWorld framework structure include: updates & devel…
HakiRose May 12, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ tmp/*
*.ipynb_checkpoints
/dist
/wheelhouse
*.orig
Copy link
Contributor

Choose a reason for hiding this comment

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

Good idea. The branch associated with this PR already contains a bunch of .orig files, though.

4 changes: 2 additions & 2 deletions textworld/challenges/coin_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from textworld.generator.graph_networks import reverse_direction

from textworld.utils import encode_seeds
from textworld.generator.game import GameOptions, Quest, Event
from textworld.generator.game import GameOptions, Quest, EventCondition
from textworld.challenges import register


Expand Down Expand Up @@ -167,7 +167,7 @@ def make_game(mode: str, options: GameOptions) -> textworld.Game:

# Generate the quest thats by collecting the coin.
quest = Quest(win_events=[
Event(conditions={M.new_fact("in", coin, M.inventory)})
EventCondition(conditions={M.new_fact("in", coin, M.inventory)})
])

M.quests = [quest]
Expand Down
22 changes: 11 additions & 11 deletions textworld/challenges/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from textworld.challenges import register

from textworld import GameOptions
from textworld.generator.game import Quest, Event
from textworld.generator.game import Quest, EventCondition

from textworld.utils import encode_seeds

Expand Down Expand Up @@ -257,36 +257,36 @@ def make_game(settings: Mapping[str, str], options: Optional[GameOptions] = None
# 1. Opening the container.
quests.append(
Quest(win_events=[
Event(conditions={M.new_fact("open", bedroom_key_holder)})
EventCondition(conditions={M.new_fact("open", bedroom_key_holder)})
])
)

# 2. Getting the key.
quests.append(
Quest(win_events=[
Event(conditions={M.new_fact("in", bedroom_key, M.inventory)})
EventCondition(conditions={M.new_fact("in", bedroom_key, M.inventory)})
])
)

# 3. Unlocking the bedroom door.
quests.append(
Quest(win_events=[
Event(conditions={M.new_fact("closed", bedroom_kitchen.door)})
EventCondition(conditions={M.new_fact("closed", bedroom_kitchen.door)})
])
)

# 4. Opening the bedroom door.
quests.append(
Quest(win_events=[
Event(conditions={M.new_fact("open", bedroom_kitchen.door)})
EventCondition(conditions={M.new_fact("open", bedroom_kitchen.door)})
])
)

if settings["rewards"] in ["dense", "balanced"]:
# Escaping out of the bedroom.
quests.append(
Quest(win_events=[
Event(conditions={M.new_fact("at", M.player, kitchen)})
EventCondition(conditions={M.new_fact("at", M.player, kitchen)})
])
)

Expand All @@ -295,7 +295,7 @@ def make_game(settings: Mapping[str, str], options: Optional[GameOptions] = None
for door in doors_to_open:
quests.append(
Quest(win_events=[
Event(conditions={M.new_fact("open", door)})
EventCondition(conditions={M.new_fact("open", door)})
])
)

Expand All @@ -304,30 +304,30 @@ def make_game(settings: Mapping[str, str], options: Optional[GameOptions] = None
for room in rooms_to_visit:
quests.append(
Quest(win_events=[
Event(conditions={M.new_fact("at", M.player, room)})
EventCondition(conditions={M.new_fact("at", M.player, room)})
])
)

if settings["rewards"] in ["dense", "balanced"]:
# Retrieving the food item.
quests.append(
Quest(win_events=[
Event(conditions={M.new_fact("in", food, M.inventory)})
EventCondition(conditions={M.new_fact("in", food, M.inventory)})
])
)

if settings["rewards"] in ["dense", "balanced", "sparse"]:
# Putting the food on the stove.
quests.append(
Quest(win_events=[
Event(conditions={M.new_fact("on", food, stove)})
EventCondition(conditions={M.new_fact("on", food, stove)})
])
)

# 3. Determine the losing condition(s) of the game.
quests.append(
Quest(fail_events=[
Event(conditions={M.new_fact("eaten", food)})
EventCondition(conditions={M.new_fact("eaten", food)})
])
)

Expand Down
Loading