Skip to content

Hot Dog Task#43

Open
tragicoverture wants to merge 6 commits intomainfrom
hot-dog
Open

Hot Dog Task#43
tragicoverture wants to merge 6 commits intomainfrom
hot-dog

Conversation

@tragicoverture
Copy link

Overview

In this PR, I integrated a hot dog task into Robotouille by implementing new items, new object types, new actions and assets into the game.

Changes Made

Changes for implementing new features into Robotouille

  • Added new assets
  • Edited asset config json to include new assets
  • Edited input json to include new actions
  • Edited robotouille config json to include new predicates and actions
  • Updated builder.py, object_enums.py with new objects

Changes for new object type

  • Edited effects to allow multiple condiments to be added
  • Updated builder.py, object_enums.py with new object type
  • Updated canvas.py to be able to render new object type
  • Updated env.py to be able to create new object types on station

Test Coverage

Manual testing using new test files

Screenshots

Image 11-1-24 at 19 45

ketchup and mustard hot dog!

… and actions into robotouille json, added corresponding gameplay instructions, added new objects into appropriate enums class, cannot draw condiment and condiment logic work in progress
…dded condiment problem jsons, need to add proper assets that correspond to hot dog with added condiments
Copy link
Contributor

@chalo2000 chalo2000 left a comment

Choose a reason for hiding this comment

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

Nice job with this PR! I've left some comments mainly to remove the hasketchupmustard predicate (see comments for a cleaner alternative) and how to remove the dependency on isgrilled from the condiments so we can reuse this for other ingredients.

"param_types": ["item"]
},
{
"name": "has_ketchup_mustard",
Copy link
Contributor

Choose a reason for hiding this comment

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

if an item has both ketchup and mustard it should have the has_ketchup and has_mustard predicates.

Copy link
Author

Choose a reason for hiding this comment

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

updated

"is_true": true
},
{
"predicate": "isgrilled",
Copy link
Contributor

Choose a reason for hiding this comment

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

i see what you did here for the hotdog task but this would limit ketchup to being added to items that can only be grilled (what about adding ketchup or mustard to a cooked patty). however, you also don't want ketchup or mustard to be applied on a raw hotdog sausage. @lsuyean has dealt with this in the past for any fried goods by creating a predicate, fryableifcut. discuss with him about the possibility of creating a condimentifgrilled predicate

Copy link
Author

Choose a reason for hiding this comment

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

added new predicates!

],
"fx": [
{
"predicate": "has_ketchup_mustard",
Copy link
Contributor

Choose a reason for hiding this comment

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

no need for this complex sfx for this predicate

Copy link
Author

Choose a reason for hiding this comment

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

removed!

],
"fx": [
{
"predicate": "has_ketchup_mustard",
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

"goal description": "Cook a hot dog and add ketchup and mustard on it.",
"goal": [
{
"predicate": "has_ketchup_mustard",
Copy link
Contributor

Choose a reason for hiding this comment

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

no need to check for this predicate, simply check if it has_ketchup and also has_mustard

Copy link
Author

Choose a reason for hiding this comment

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

replaced with those two predicates

"direction": [-1, 0]
}
],
"goal description": "Make a hot dog and add ketchup and mustard on it.",
Copy link
Contributor

Choose a reason for hiding this comment

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

toasted hot dog

Copy link
Contributor

Choose a reason for hiding this comment

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

change file name too

Copy link
Author

Choose a reason for hiding this comment

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

updated!

"direction": [-1, 0]
}
],
"goal": [
Copy link
Contributor

Choose a reason for hiding this comment

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

missing goal description. toast 2 buns

Copy link
Author

Choose a reason for hiding this comment

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

updated!

class Condiment(Enum):
KETCHUP = "ketchupbottle"
MUSTARD = "mustardbottle"
TYPES = {"item": Item, "player": Player, "station": Station, "container": Container, "meal": Meal, "condiment": Condiment}
Copy link
Contributor

Choose a reason for hiding this comment

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

newline before

Copy link
Author

Choose a reason for hiding this comment

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

added newline!

},
"has_ketchup_mustard": {
"asset": "ketchup_mustard_hotdog.png",
"predicates": ["has_ketchup_mustard"]
Copy link
Contributor

Choose a reason for hiding this comment

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

if you put ["has_ketchup", "has_mustard"], it will have the same effect as ["has_ketchup_mustard"]. you can remove this predicate altogether

Copy link
Author

Choose a reason for hiding this comment

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

removed!

elif matches == max_matches:
chosen_asset = asset_config["default"]

if asset == "grilled":
Copy link
Contributor

Choose a reason for hiding this comment

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

what is this needed for?

Copy link
Author

@tragicoverture tragicoverture Nov 9, 2024

Choose a reason for hiding this comment

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

originally, you could only add condiments to grilled items, so the condiment assets were under the grill items. The purpose of this block was a brute force method to pick the correct item asset, and there was no need to check for multiple matches since each asset only had one predicate. with the new predicates, there's no need for this block, so I removed it now.

…p_mustard predicate, removed conditional effects for add condiment actions, added conditional effects for grill action, renamed problem jsons to correspond to specific goal descriptions, updated goal descriptions in problem jsons
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