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

Customers #35

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Customers #35

wants to merge 10 commits into from

Conversation

lsuyean
Copy link
Contributor

@lsuyean lsuyean commented Jul 17, 2024

Overview

In this PR, I implement Gamemodes and Customers into Robotouille.

Previously, stepping in the environment was controlled using the step() function within the State class. However, this was problematic because it was controlling more than just updates to the state, especially with new modules like Movement. Now, there is a new module called GameMode that controls all modules within Robotouille.

The GameMode class also lets Robotouille have win conditions. In this PR, I implement a basic gamemode called `Classic' where the player must serve a number of customers within a certain amount of time.

Changes Made

Customers

  • Added new assets for customers, the customer table, and customer spawn
    • Customer spawn asset is temporary, is currently a screenshot of the floor tiling. Should be replaced by a transparent asset in the future so that it does not render in game.
  • Implemented Customer class which keeps track about information about the customers and steps them in the environment
  • Edited domain.py and domain_builder.py to now keep track of npc_actions, all actions that the npc can do as defined in the domain
  • Edited movement.py to also move customers
  • Edited state.py to keep track of customers and customer_actions
  • Added recipes.json where recipes can be specified
  • Edited robotouille.json to include Customer type, predicates, and actions
  • Edited builder.py and object_enmus.py to include Customer type
  • Added new environments customer.json and multi_customer.json to test customers
  • Edited renderer.py, canvas.py, robotouille_env.py and robotouille_config.json to render customers

GameMode

  • Implemented GameMode class that serves as the overall control of the game, keeps track of win conditions, and steps all the modules in the game
  • Implemented Classic subclass where a player must satisfy all recipes before a given time
  • Moved stepping logic of the Movement class from state.py to classic.py
  • Edited all environments to now also specify the gamemode
  • Added a new file env_utils.py to prevent circular imports when creating the GameMode and Customers
  • Edited robotouille_simulator.py to pass pygame.time into the gamemode class

Changes to Containers

  • Added new actions for stacking in robotouille.json so that containers can now be picked up and placed with items on it
  • Added new inputs for new stacking actions in input.json
  • Edited canvas.py to properly render containers and items stacked on containers

Test Coverage

Tested with all environments

Next Steps

  • Fix issue where food does not disappear when customer 'eats' it

Screenshots

ezgif com-video-to-gif-converter

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.

1 participant