diff --git a/README.md b/README.md index c40296fa86cf4a0f73778769a848299a88f8b7a1..c49f7a76099c424ed7a9bbb548cc9c5325fd960e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [Documentation](https://scs.pages.ub.uni-bielefeld.de/cocosy/overcooked-simulator) -The real-time overcooked simulation for a cognitive cooperative system. +The overcooked-like cooperative cuisine environment for real-time human cooperative interactions and artificial agents. **The name ist still work in progress and we will probably change it.** @@ -37,13 +37,13 @@ You can also start the **Game Server** and the **PyGame GUI** individually in di ```bash python3 cooperative_cuisine/game_server.py --url "localhost" --port 8000 --manager_ids SECRETKEY1 SECRETKEY2 -python3 cooperative_cuisine/gui_2d_vis/overcooked_gui.py --url "localhost" --port 8000 --manager_ids SECRETKEY1 +python3 cooperative_cuisine/pygame_2d_vis/overcooked_gui.py --url "localhost" --port 8000 --manager_ids SECRETKEY1 ``` You can start also several GUIs. ```bash -python3 cooperative_cuisine/gui_2d_vis/overcooked_gui.py --url "localhost" --port 8000 --manager_ids SECRETKEY2 +python3 cooperative_cuisine/pygame_2d_vis/overcooked_gui.py --url "localhost" --port 8000 --manager_ids SECRETKEY2 ``` You can replace the GUI with your own GUI (+ study server/matchmaking server). diff --git a/cooperative_cuisine/__init__.py b/cooperative_cuisine/__init__.py index c34cdccdddf340d0b9b49a705fd7cc7fb89d16b3..0cf347d8c1fb0d544666a20afa3bc32bab2139e1 100644 --- a/cooperative_cuisine/__init__.py +++ b/cooperative_cuisine/__init__.py @@ -1,6 +1,6 @@ """ -This is the documentation of the Overcooked Simulator. +This is the documentation of CooperativeCuisine. # About the package @@ -15,7 +15,7 @@ players in a more "real-time"-like environment. They all mostly differ in the vi like overcooked-ai, ... are most well-known in the community. But more visually appealing 3D versions for cooperation with humans are getting developed more frequently (cite,...). Besides, the general adaptations of the original overcooked game. -With this Overcooked simulator, we want to bring both worlds together: the reinforcement learning and real-time playable +CooperativeCuisine, we want to bring both worlds together: the reinforcement learning and real-time playable environment with an appealing visualisation. Enable the potential of developing artificial agents that play with humans like a "real", cooperative, human partner. @@ -51,7 +51,7 @@ You can also start the **Game Server** and the **PyGame GUI** individually in di ```bash python3 cooperative_cuisine/game_server.py --url "localhost" --port 8000 --manager_ids SECRETKEY1 SECRETKEY2 -python3 cooperative_cuisine/gui_2d_vis/overcooked_gui.py --url "localhost" --port 8000 --manager_ids SECRETKEY1 +python3 cooperative_cuisine/pygame_2d_vis/overcooked_gui.py --url "localhost" --port 8000 --manager_ids SECRETKEY1 ``` ## Connect with agent and receive game state @@ -202,7 +202,7 @@ returns. You might have stored some json states and now you want to visualize them via the pygame-2d visualization. You can do that by running the `drawing.py` script and referencing a json file. ```bash -python3 cooperative_cuisine/gui_2d_vis/drawing.py --state my_state.json +python3 cooperative_cuisine/pygame_2d_vis/drawing.py --state my_state.json ``` - You can specify a different visualization config with `-v` or `--visualization_config`. - You can specify the name of the output file with `-o` or `--output_file`. The default is `screenshot.jpg`. diff --git a/cooperative_cuisine/__main__.py b/cooperative_cuisine/__main__.py index 7e63a107bff6e8c89ad878d144f0fef65af651f8..6be683066a0120a063f3c9a93697f17cd88cb8cc 100644 --- a/cooperative_cuisine/__main__.py +++ b/cooperative_cuisine/__main__.py @@ -30,7 +30,7 @@ def start_study_server(cli_args): def start_pygame_gui(cli_args): - from cooperative_cuisine.gui_2d_vis.overcooked_gui import main + from cooperative_cuisine.pygame_2d_vis.overcooked_gui import main main( cli_args.study_url, diff --git a/cooperative_cuisine/gui_2d_vis/__init__.py b/cooperative_cuisine/pygame_2d_vis/__init__.py similarity index 72% rename from cooperative_cuisine/gui_2d_vis/__init__.py rename to cooperative_cuisine/pygame_2d_vis/__init__.py index 9c531caa6003ae868d4eeef943dfa92d5c349fda..59518a01832481251a6d34e7139f30ca8f15839e 100644 --- a/cooperative_cuisine/gui_2d_vis/__init__.py +++ b/cooperative_cuisine/pygame_2d_vis/__init__.py @@ -2,9 +2,9 @@ 2D visualization of the overcooked simulator. You can select the layout and start an environment: -- You can play the overcooked simulator. You can quit the application in the top right or end the level in the bottom right: [Screenshot](https://gitlab.ub.uni-bielefeld.de/scs/cocosy/overcooked-simulator/-/raw/main/overcooked_simulator/gui_2d_vis/images/overcooked-start-screen.png?ref_type=heads) -- The orders are pictured in the top, the current score in the bottom left and the remaining time in the bottom: [Screenshot](https://gitlab.ub.uni-bielefeld.de/scs/cocosy/overcooked-simulator/-/raw/main/overcooked_simulator/gui_2d_vis/images/overcooked-level-screen.png?ref_type=heads) -- The final screen after ending a level shows the score: [Screenshot](https://gitlab.ub.uni-bielefeld.de/scs/cocosy/overcooked-simulator/-/raw/main/overcooked_simulator/gui_2d_vis/images/overcooked-end-screen.png?ref_type=heads) +- You can play the overcooked simulator. You can quit the application in the top right or end the level in the bottom right: [Screenshot](https://gitlab.ub.uni-bielefeld.de/scs/cocosy/overcooked-simulator/-/raw/main/overcooked_simulator/pygame_2d_vis/images/overcooked-start-screen.png?ref_type=heads) +- The orders are pictured in the top, the current score in the bottom left and the remaining time in the bottom: [Screenshot](https://gitlab.ub.uni-bielefeld.de/scs/cocosy/overcooked-simulator/-/raw/main/overcooked_simulator/pygame_2d_vis/images/overcooked-level-screen.png?ref_type=heads) +- The final screen after ending a level shows the score: [Screenshot](https://gitlab.ub.uni-bielefeld.de/scs/cocosy/overcooked-simulator/-/raw/main/overcooked_simulator/pygame_2d_vis/images/overcooked-end-screen.png?ref_type=heads) The keys for the control of the players are: diff --git a/cooperative_cuisine/gui_2d_vis/continue.drawio.png b/cooperative_cuisine/pygame_2d_vis/continue.drawio.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/continue.drawio.png rename to cooperative_cuisine/pygame_2d_vis/continue.drawio.png diff --git a/cooperative_cuisine/gui_2d_vis/drawing.py b/cooperative_cuisine/pygame_2d_vis/drawing.py similarity index 98% rename from cooperative_cuisine/gui_2d_vis/drawing.py rename to cooperative_cuisine/pygame_2d_vis/drawing.py index dbad81df5446ad1491bda641cf7125ae1582cf84..2b92abeed31f61177af474a1854c2be0ddbe73c1 100644 --- a/cooperative_cuisine/gui_2d_vis/drawing.py +++ b/cooperative_cuisine/pygame_2d_vis/drawing.py @@ -13,7 +13,7 @@ from scipy.spatial import KDTree from cooperative_cuisine import ROOT_DIR from cooperative_cuisine.environment import Environment -from cooperative_cuisine.gui_2d_vis.game_colors import colors +from cooperative_cuisine.pygame_2d_vis.game_colors import colors from cooperative_cuisine.state_representation import ( PlayerState, CookingEquipmentState, @@ -274,7 +274,7 @@ class Visualizer: Args: screen: The pygame surface to draw the image on. - img_path: The path to the image file, given relative to the gui_2d_vis directory. + img_path: The path to the image file, given relative to the pygame_2d_vis directory. size: The size of the image, given in pixels. pos: The position of the center of the image, given in pixels. rot_angle: Optional angle to rotate the image around. @@ -288,14 +288,14 @@ class Visualizer: normal_image = self.image_cache_dict[cache_entry] else: normal_image = pygame.image.load( - ROOT_DIR / "gui_2d_vis" / img_path + ROOT_DIR / "pygame_2d_vis" / img_path ).convert_alpha() self.image_cache_dict[cache_entry] = normal_image image = grayscale(normal_image) self.image_cache_dict[cache_entry + "-burnt"] = image else: image = pygame.image.load( - ROOT_DIR / "gui_2d_vis" / img_path + ROOT_DIR / "pygame_2d_vis" / img_path ).convert_alpha() self.image_cache_dict[cache_entry] = image image = pygame.transform.scale(image, (size, size)) @@ -1007,19 +1007,19 @@ if __name__ == "__main__": "-s", "--state", type=argparse.FileType("r", encoding="UTF-8"), - default=ROOT_DIR / "gui_2d_vis" / "sample_state.json", + default=ROOT_DIR / "pygame_2d_vis" / "sample_state.json", ) parser.add_argument( "-v", "--visualization_config", type=argparse.FileType("r", encoding="UTF-8"), - default=ROOT_DIR / "gui_2d_vis" / "visualization.yaml", + default=ROOT_DIR / "pygame_2d_vis" / "visualization.yaml", ) parser.add_argument( "-o", "--output_file", type=str, - default=ROOT_DIR / "gui_2d_vis" / "generated" / "screenshot.jpg", + default=ROOT_DIR / "pygame_2d_vis" / "generated" / "screenshot.jpg", ) args = parser.parse_args() with open(args.visualization_config, "r") as f: diff --git a/cooperative_cuisine/gui_2d_vis/game_colors.py b/cooperative_cuisine/pygame_2d_vis/game_colors.py similarity index 100% rename from cooperative_cuisine/gui_2d_vis/game_colors.py rename to cooperative_cuisine/pygame_2d_vis/game_colors.py diff --git a/cooperative_cuisine/gui_2d_vis/gui_theme.json b/cooperative_cuisine/pygame_2d_vis/gui_theme.json similarity index 100% rename from cooperative_cuisine/gui_2d_vis/gui_theme.json rename to cooperative_cuisine/pygame_2d_vis/gui_theme.json diff --git a/cooperative_cuisine/gui_2d_vis/images/arrow_right.png b/cooperative_cuisine/pygame_2d_vis/images/arrow_right.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/arrow_right.png rename to cooperative_cuisine/pygame_2d_vis/images/arrow_right.png diff --git a/cooperative_cuisine/gui_2d_vis/images/basket.png b/cooperative_cuisine/pygame_2d_vis/images/basket.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/basket.png rename to cooperative_cuisine/pygame_2d_vis/images/basket.png diff --git a/cooperative_cuisine/gui_2d_vis/images/bell_gold.png b/cooperative_cuisine/pygame_2d_vis/images/bell_gold.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/bell_gold.png rename to cooperative_cuisine/pygame_2d_vis/images/bell_gold.png diff --git a/cooperative_cuisine/gui_2d_vis/images/bell_silver.png b/cooperative_cuisine/pygame_2d_vis/images/bell_silver.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/bell_silver.png rename to cooperative_cuisine/pygame_2d_vis/images/bell_silver.png diff --git a/cooperative_cuisine/gui_2d_vis/images/bun.png b/cooperative_cuisine/pygame_2d_vis/images/bun.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/bun.png rename to cooperative_cuisine/pygame_2d_vis/images/bun.png diff --git a/cooperative_cuisine/gui_2d_vis/images/burger.png b/cooperative_cuisine/pygame_2d_vis/images/burger.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/burger.png rename to cooperative_cuisine/pygame_2d_vis/images/burger.png diff --git a/cooperative_cuisine/gui_2d_vis/images/cheese3.png b/cooperative_cuisine/pygame_2d_vis/images/cheese3.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/cheese3.png rename to cooperative_cuisine/pygame_2d_vis/images/cheese3.png diff --git a/cooperative_cuisine/gui_2d_vis/images/chopped_fish.png b/cooperative_cuisine/pygame_2d_vis/images/chopped_fish.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/chopped_fish.png rename to cooperative_cuisine/pygame_2d_vis/images/chopped_fish.png diff --git a/cooperative_cuisine/gui_2d_vis/images/cooked_patty.png b/cooperative_cuisine/pygame_2d_vis/images/cooked_patty.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/cooked_patty.png rename to cooperative_cuisine/pygame_2d_vis/images/cooked_patty.png diff --git a/cooperative_cuisine/gui_2d_vis/images/counter2.png b/cooperative_cuisine/pygame_2d_vis/images/counter2.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/counter2.png rename to cooperative_cuisine/pygame_2d_vis/images/counter2.png diff --git a/cooperative_cuisine/gui_2d_vis/images/counter4.png b/cooperative_cuisine/pygame_2d_vis/images/counter4.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/counter4.png rename to cooperative_cuisine/pygame_2d_vis/images/counter4.png diff --git a/cooperative_cuisine/gui_2d_vis/images/counter5.png b/cooperative_cuisine/pygame_2d_vis/images/counter5.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/counter5.png rename to cooperative_cuisine/pygame_2d_vis/images/counter5.png diff --git a/cooperative_cuisine/gui_2d_vis/images/cut_fish.png b/cooperative_cuisine/pygame_2d_vis/images/cut_fish.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/cut_fish.png rename to cooperative_cuisine/pygame_2d_vis/images/cut_fish.png diff --git a/cooperative_cuisine/gui_2d_vis/images/cutting_board_large.png b/cooperative_cuisine/pygame_2d_vis/images/cutting_board_large.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/cutting_board_large.png rename to cooperative_cuisine/pygame_2d_vis/images/cutting_board_large.png diff --git a/cooperative_cuisine/gui_2d_vis/images/drip2.png b/cooperative_cuisine/pygame_2d_vis/images/drip2.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/drip2.png rename to cooperative_cuisine/pygame_2d_vis/images/drip2.png diff --git a/cooperative_cuisine/gui_2d_vis/images/fire.png b/cooperative_cuisine/pygame_2d_vis/images/fire.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/fire.png rename to cooperative_cuisine/pygame_2d_vis/images/fire.png diff --git a/cooperative_cuisine/gui_2d_vis/images/fire2.png b/cooperative_cuisine/pygame_2d_vis/images/fire2.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/fire2.png rename to cooperative_cuisine/pygame_2d_vis/images/fire2.png diff --git a/cooperative_cuisine/gui_2d_vis/images/fire3.png b/cooperative_cuisine/pygame_2d_vis/images/fire3.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/fire3.png rename to cooperative_cuisine/pygame_2d_vis/images/fire3.png diff --git a/cooperative_cuisine/gui_2d_vis/images/fire_extinguisher.png b/cooperative_cuisine/pygame_2d_vis/images/fire_extinguisher.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/fire_extinguisher.png rename to cooperative_cuisine/pygame_2d_vis/images/fire_extinguisher.png diff --git a/cooperative_cuisine/gui_2d_vis/images/fish3.png b/cooperative_cuisine/pygame_2d_vis/images/fish3.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/fish3.png rename to cooperative_cuisine/pygame_2d_vis/images/fish3.png diff --git a/cooperative_cuisine/gui_2d_vis/images/fried_fish.png b/cooperative_cuisine/pygame_2d_vis/images/fried_fish.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/fried_fish.png rename to cooperative_cuisine/pygame_2d_vis/images/fried_fish.png diff --git a/cooperative_cuisine/gui_2d_vis/images/fries2.png b/cooperative_cuisine/pygame_2d_vis/images/fries2.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/fries2.png rename to cooperative_cuisine/pygame_2d_vis/images/fries2.png diff --git a/cooperative_cuisine/gui_2d_vis/images/grated_cheese.png b/cooperative_cuisine/pygame_2d_vis/images/grated_cheese.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/grated_cheese.png rename to cooperative_cuisine/pygame_2d_vis/images/grated_cheese.png diff --git a/cooperative_cuisine/gui_2d_vis/images/lettuce_cut_smaller.png b/cooperative_cuisine/pygame_2d_vis/images/lettuce_cut_smaller.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/lettuce_cut_smaller.png rename to cooperative_cuisine/pygame_2d_vis/images/lettuce_cut_smaller.png diff --git a/cooperative_cuisine/gui_2d_vis/images/lettuce_smaller.png b/cooperative_cuisine/pygame_2d_vis/images/lettuce_smaller.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/lettuce_smaller.png rename to cooperative_cuisine/pygame_2d_vis/images/lettuce_smaller.png diff --git a/cooperative_cuisine/gui_2d_vis/images/meat.png b/cooperative_cuisine/pygame_2d_vis/images/meat.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/meat.png rename to cooperative_cuisine/pygame_2d_vis/images/meat.png diff --git a/cooperative_cuisine/gui_2d_vis/images/onion_cut.png b/cooperative_cuisine/pygame_2d_vis/images/onion_cut.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/onion_cut.png rename to cooperative_cuisine/pygame_2d_vis/images/onion_cut.png diff --git a/cooperative_cuisine/gui_2d_vis/images/onion_large.png b/cooperative_cuisine/pygame_2d_vis/images/onion_large.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/onion_large.png rename to cooperative_cuisine/pygame_2d_vis/images/onion_large.png diff --git a/cooperative_cuisine/gui_2d_vis/images/onion_soup_plate.png b/cooperative_cuisine/pygame_2d_vis/images/onion_soup_plate.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/onion_soup_plate.png rename to cooperative_cuisine/pygame_2d_vis/images/onion_soup_plate.png diff --git a/cooperative_cuisine/gui_2d_vis/images/onion_soup_pot.png b/cooperative_cuisine/pygame_2d_vis/images/onion_soup_pot.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/onion_soup_pot.png rename to cooperative_cuisine/pygame_2d_vis/images/onion_soup_pot.png diff --git a/cooperative_cuisine/gui_2d_vis/images/overcooked-end-screen.png b/cooperative_cuisine/pygame_2d_vis/images/overcooked-end-screen.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/overcooked-end-screen.png rename to cooperative_cuisine/pygame_2d_vis/images/overcooked-end-screen.png diff --git a/cooperative_cuisine/gui_2d_vis/images/overcooked-level-screen.png b/cooperative_cuisine/pygame_2d_vis/images/overcooked-level-screen.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/overcooked-level-screen.png rename to cooperative_cuisine/pygame_2d_vis/images/overcooked-level-screen.png diff --git a/cooperative_cuisine/gui_2d_vis/images/overcooked-start-screen.png b/cooperative_cuisine/pygame_2d_vis/images/overcooked-start-screen.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/overcooked-start-screen.png rename to cooperative_cuisine/pygame_2d_vis/images/overcooked-start-screen.png diff --git a/cooperative_cuisine/gui_2d_vis/images/pan.png b/cooperative_cuisine/pygame_2d_vis/images/pan.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/pan.png rename to cooperative_cuisine/pygame_2d_vis/images/pan.png diff --git a/cooperative_cuisine/gui_2d_vis/images/pixel_cook.png b/cooperative_cuisine/pygame_2d_vis/images/pixel_cook.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/pixel_cook.png rename to cooperative_cuisine/pygame_2d_vis/images/pixel_cook.png diff --git a/cooperative_cuisine/gui_2d_vis/images/pixel_cook_masked.png b/cooperative_cuisine/pygame_2d_vis/images/pixel_cook_masked.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/pixel_cook_masked.png rename to cooperative_cuisine/pygame_2d_vis/images/pixel_cook_masked.png diff --git a/cooperative_cuisine/gui_2d_vis/images/pizza.png b/cooperative_cuisine/pygame_2d_vis/images/pizza.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/pizza.png rename to cooperative_cuisine/pygame_2d_vis/images/pizza.png diff --git a/cooperative_cuisine/gui_2d_vis/images/pizza_base.png b/cooperative_cuisine/pygame_2d_vis/images/pizza_base.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/pizza_base.png rename to cooperative_cuisine/pygame_2d_vis/images/pizza_base.png diff --git a/cooperative_cuisine/gui_2d_vis/images/pizza_dough.png b/cooperative_cuisine/pygame_2d_vis/images/pizza_dough.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/pizza_dough.png rename to cooperative_cuisine/pygame_2d_vis/images/pizza_dough.png diff --git a/cooperative_cuisine/gui_2d_vis/images/pizza_wood.png b/cooperative_cuisine/pygame_2d_vis/images/pizza_wood.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/pizza_wood.png rename to cooperative_cuisine/pygame_2d_vis/images/pizza_wood.png diff --git a/cooperative_cuisine/gui_2d_vis/images/plate.png b/cooperative_cuisine/pygame_2d_vis/images/plate.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/plate.png rename to cooperative_cuisine/pygame_2d_vis/images/plate.png diff --git a/cooperative_cuisine/gui_2d_vis/images/plate_clean.png b/cooperative_cuisine/pygame_2d_vis/images/plate_clean.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/plate_clean.png rename to cooperative_cuisine/pygame_2d_vis/images/plate_clean.png diff --git a/cooperative_cuisine/gui_2d_vis/images/plate_dirty.png b/cooperative_cuisine/pygame_2d_vis/images/plate_dirty.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/plate_dirty.png rename to cooperative_cuisine/pygame_2d_vis/images/plate_dirty.png diff --git a/cooperative_cuisine/gui_2d_vis/images/pot.png b/cooperative_cuisine/pygame_2d_vis/images/pot.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/pot.png rename to cooperative_cuisine/pygame_2d_vis/images/pot.png diff --git a/cooperative_cuisine/gui_2d_vis/images/pot_large.png b/cooperative_cuisine/pygame_2d_vis/images/pot_large.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/pot_large.png rename to cooperative_cuisine/pygame_2d_vis/images/pot_large.png diff --git a/cooperative_cuisine/gui_2d_vis/images/pot_smaller.png b/cooperative_cuisine/pygame_2d_vis/images/pot_smaller.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/pot_smaller.png rename to cooperative_cuisine/pygame_2d_vis/images/pot_smaller.png diff --git a/cooperative_cuisine/gui_2d_vis/images/potato2.png b/cooperative_cuisine/pygame_2d_vis/images/potato2.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/potato2.png rename to cooperative_cuisine/pygame_2d_vis/images/potato2.png diff --git a/cooperative_cuisine/gui_2d_vis/images/raw_fries.png b/cooperative_cuisine/pygame_2d_vis/images/raw_fries.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/raw_fries.png rename to cooperative_cuisine/pygame_2d_vis/images/raw_fries.png diff --git a/cooperative_cuisine/gui_2d_vis/images/raw_patty.png b/cooperative_cuisine/pygame_2d_vis/images/raw_patty.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/raw_patty.png rename to cooperative_cuisine/pygame_2d_vis/images/raw_patty.png diff --git a/cooperative_cuisine/gui_2d_vis/images/salad.png b/cooperative_cuisine/pygame_2d_vis/images/salad.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/salad.png rename to cooperative_cuisine/pygame_2d_vis/images/salad.png diff --git a/cooperative_cuisine/gui_2d_vis/images/sausage.png b/cooperative_cuisine/pygame_2d_vis/images/sausage.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/sausage.png rename to cooperative_cuisine/pygame_2d_vis/images/sausage.png diff --git a/cooperative_cuisine/gui_2d_vis/images/sausage_chopped.png b/cooperative_cuisine/pygame_2d_vis/images/sausage_chopped.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/sausage_chopped.png rename to cooperative_cuisine/pygame_2d_vis/images/sausage_chopped.png diff --git a/cooperative_cuisine/gui_2d_vis/images/sink.png b/cooperative_cuisine/pygame_2d_vis/images/sink.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/sink.png rename to cooperative_cuisine/pygame_2d_vis/images/sink.png diff --git a/cooperative_cuisine/gui_2d_vis/images/sink1.png b/cooperative_cuisine/pygame_2d_vis/images/sink1.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/sink1.png rename to cooperative_cuisine/pygame_2d_vis/images/sink1.png diff --git a/cooperative_cuisine/gui_2d_vis/images/sink_large.png b/cooperative_cuisine/pygame_2d_vis/images/sink_large.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/sink_large.png rename to cooperative_cuisine/pygame_2d_vis/images/sink_large.png diff --git a/cooperative_cuisine/gui_2d_vis/images/tomato.png b/cooperative_cuisine/pygame_2d_vis/images/tomato.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/tomato.png rename to cooperative_cuisine/pygame_2d_vis/images/tomato.png diff --git a/cooperative_cuisine/gui_2d_vis/images/tomato3_cut_smaller.png b/cooperative_cuisine/pygame_2d_vis/images/tomato3_cut_smaller.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/tomato3_cut_smaller.png rename to cooperative_cuisine/pygame_2d_vis/images/tomato3_cut_smaller.png diff --git a/cooperative_cuisine/gui_2d_vis/images/tomato3_smaller.png b/cooperative_cuisine/pygame_2d_vis/images/tomato3_smaller.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/tomato3_smaller.png rename to cooperative_cuisine/pygame_2d_vis/images/tomato3_smaller.png diff --git a/cooperative_cuisine/gui_2d_vis/images/tomato_cut.png b/cooperative_cuisine/pygame_2d_vis/images/tomato_cut.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/tomato_cut.png rename to cooperative_cuisine/pygame_2d_vis/images/tomato_cut.png diff --git a/cooperative_cuisine/gui_2d_vis/images/tomato_soup.png b/cooperative_cuisine/pygame_2d_vis/images/tomato_soup.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/tomato_soup.png rename to cooperative_cuisine/pygame_2d_vis/images/tomato_soup.png diff --git a/cooperative_cuisine/gui_2d_vis/images/tomato_soup_plate.png b/cooperative_cuisine/pygame_2d_vis/images/tomato_soup_plate.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/tomato_soup_plate.png rename to cooperative_cuisine/pygame_2d_vis/images/tomato_soup_plate.png diff --git a/cooperative_cuisine/gui_2d_vis/images/tomato_soup_pot.png b/cooperative_cuisine/pygame_2d_vis/images/tomato_soup_pot.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/tomato_soup_pot.png rename to cooperative_cuisine/pygame_2d_vis/images/tomato_soup_pot.png diff --git a/cooperative_cuisine/gui_2d_vis/images/trash3.png b/cooperative_cuisine/pygame_2d_vis/images/trash3.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/images/trash3.png rename to cooperative_cuisine/pygame_2d_vis/images/trash3.png diff --git a/cooperative_cuisine/gui_2d_vis/overcooked_gui.py b/cooperative_cuisine/pygame_2d_vis/overcooked_gui.py similarity index 99% rename from cooperative_cuisine/gui_2d_vis/overcooked_gui.py rename to cooperative_cuisine/pygame_2d_vis/overcooked_gui.py index 64e567b4f0540a55e1d25326f8f6aa95a7f65bc7..609d3837cea613b6e6cb727f9bdaff7300ad70f0 100644 --- a/cooperative_cuisine/gui_2d_vis/overcooked_gui.py +++ b/cooperative_cuisine/pygame_2d_vis/overcooked_gui.py @@ -26,8 +26,8 @@ from cooperative_cuisine.environment import ( InterActionData, ) from cooperative_cuisine.game_server import CreateEnvironmentConfig -from cooperative_cuisine.gui_2d_vis.drawing import Visualizer -from cooperative_cuisine.gui_2d_vis.game_colors import colors +from cooperative_cuisine.pygame_2d_vis.drawing import Visualizer +from cooperative_cuisine.pygame_2d_vis.game_colors import colors from cooperative_cuisine.state_representation import StateRepresentation from cooperative_cuisine.utils import ( custom_asdict_factory, @@ -122,7 +122,7 @@ class PyGameGUI: pygame.init() pygame.display.set_icon( - pygame.image.load(ROOT_DIR / "gui_2d_vis" / "images" / "fish3.png") + pygame.image.load(ROOT_DIR / "pygame_2d_vis" / "images" / "fish3.png") ) self.participant_id = uuid.uuid4().hex @@ -142,7 +142,7 @@ class PyGameGUI: self.manager_id = random.choice(manager_ids) - with open(ROOT_DIR / "gui_2d_vis" / "visualization.yaml", "r") as file: + with open(ROOT_DIR / "pygame_2d_vis" / "visualization.yaml", "r") as file: self.visualization_config = yaml.safe_load(file) self.FPS = self.visualization_config["GameWindow"]["FPS"] @@ -434,7 +434,9 @@ class PyGameGUI: def init_ui_elements(self): self.manager = pygame_gui.UIManager((self.window_width, self.window_height)) - self.manager.get_theme().load_theme(ROOT_DIR / "gui_2d_vis" / "gui_theme.json") + self.manager.get_theme().load_theme( + ROOT_DIR / "pygame_2d_vis" / "gui_theme.json" + ) ######################################################################## # Start screen @@ -450,7 +452,7 @@ class PyGameGUI: ) img = pygame.image.load( - ROOT_DIR / "gui_2d_vis" / "continue.drawio.png" + ROOT_DIR / "pygame_2d_vis" / "continue.drawio.png" ).convert_alpha() image_rect = img.get_rect() @@ -612,7 +614,7 @@ class PyGameGUI: ######################################################################## image = pygame.image.load( - ROOT_DIR / "gui_2d_vis" / "tutorial_files" / "tutorial.drawio.png" + ROOT_DIR / "pygame_2d_vis" / "tutorial_files" / "tutorial.drawio.png" ).convert_alpha() image_rect = image.get_rect() image_rect.topleft = (20, self.buttons_height) @@ -1524,7 +1526,7 @@ class PyGameGUI: websocket.close() def play_bell_sound(self): - bell_path = str(ROOT_DIR / "gui_2d_vis" / "sync_bell.wav") + bell_path = str(ROOT_DIR / "pygame_2d_vis" / "sync_bell.wav") mixer.init() mixer.music.load(bell_path) mixer.music.set_volume(0.9) diff --git a/cooperative_cuisine/gui_2d_vis/press_a.drawio.png b/cooperative_cuisine/pygame_2d_vis/press_a.drawio.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/press_a.drawio.png rename to cooperative_cuisine/pygame_2d_vis/press_a.drawio.png diff --git a/cooperative_cuisine/gui_2d_vis/sample_state.json b/cooperative_cuisine/pygame_2d_vis/sample_state.json similarity index 100% rename from cooperative_cuisine/gui_2d_vis/sample_state.json rename to cooperative_cuisine/pygame_2d_vis/sample_state.json diff --git a/cooperative_cuisine/gui_2d_vis/sync_bell.wav b/cooperative_cuisine/pygame_2d_vis/sync_bell.wav similarity index 100% rename from cooperative_cuisine/gui_2d_vis/sync_bell.wav rename to cooperative_cuisine/pygame_2d_vis/sync_bell.wav diff --git a/cooperative_cuisine/gui_2d_vis/tutorial.png b/cooperative_cuisine/pygame_2d_vis/tutorial.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/tutorial.png rename to cooperative_cuisine/pygame_2d_vis/tutorial.png diff --git a/cooperative_cuisine/gui_2d_vis/tutorial_files/recipe_mock.png b/cooperative_cuisine/pygame_2d_vis/tutorial_files/recipe_mock.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/tutorial_files/recipe_mock.png rename to cooperative_cuisine/pygame_2d_vis/tutorial_files/recipe_mock.png diff --git a/cooperative_cuisine/gui_2d_vis/tutorial_files/tutorial.drawio.png b/cooperative_cuisine/pygame_2d_vis/tutorial_files/tutorial.drawio.png similarity index 100% rename from cooperative_cuisine/gui_2d_vis/tutorial_files/tutorial.drawio.png rename to cooperative_cuisine/pygame_2d_vis/tutorial_files/tutorial.drawio.png diff --git a/cooperative_cuisine/gui_2d_vis/video_replay.py b/cooperative_cuisine/pygame_2d_vis/video_replay.py similarity index 98% rename from cooperative_cuisine/gui_2d_vis/video_replay.py rename to cooperative_cuisine/pygame_2d_vis/video_replay.py index 8db8acf1fd79778e0e1bfe99dbdd8ed19a642465..c9a6563e602803e8ba53a44536b63109f5e49513 100644 --- a/cooperative_cuisine/gui_2d_vis/video_replay.py +++ b/cooperative_cuisine/pygame_2d_vis/video_replay.py @@ -44,7 +44,7 @@ from tqdm import tqdm from cooperative_cuisine import ROOT_DIR from cooperative_cuisine.environment import Environment, Action -from cooperative_cuisine.gui_2d_vis.drawing import Visualizer +from cooperative_cuisine.pygame_2d_vis.drawing import Visualizer from cooperative_cuisine.recording import FileRecorder FPS_DEFAULT = 24 @@ -208,7 +208,7 @@ def from_json_states( """ Generate images from recorded json strings in on jsonl file. - For single image creation based on one json state see `cooperative_cuisine.gui_2d_vis.drawing`. + For single image creation based on one json state see `cooperative_cuisine.pygame_2d_vis.drawing`. You can create the jsonl file recording via hooks in the environment_config. These files grow very fast!: ```yaml @@ -307,7 +307,7 @@ if __name__ == "__main__": "-v", "--visualization_config", type=argparse.FileType("r", encoding="UTF-8"), - default=ROOT_DIR / "gui_2d_vis" / "visualization.yaml", + default=ROOT_DIR / "pygame_2d_vis" / "visualization.yaml", ) parser.add_argument( "-o", diff --git a/cooperative_cuisine/gui_2d_vis/visualization.yaml b/cooperative_cuisine/pygame_2d_vis/visualization.yaml similarity index 100% rename from cooperative_cuisine/gui_2d_vis/visualization.yaml rename to cooperative_cuisine/pygame_2d_vis/visualization.yaml diff --git a/cooperative_cuisine/reinforcement_learning/gym_env.py b/cooperative_cuisine/reinforcement_learning/gym_env.py index c40e8843751c5bb8205a09b0af8acf7c727e07d1..7bacc68c42bafd29257976a351307ea4c268cc72 100644 --- a/cooperative_cuisine/reinforcement_learning/gym_env.py +++ b/cooperative_cuisine/reinforcement_learning/gym_env.py @@ -29,7 +29,7 @@ from cooperative_cuisine.environment import ( InterActionData, ) from cooperative_cuisine.game_items import CookingEquipment -from cooperative_cuisine.gui_2d_vis.drawing import Visualizer +from cooperative_cuisine.pygame_2d_vis.drawing import Visualizer class SimpleActionSpace(Enum): @@ -99,7 +99,7 @@ with open(layout_path, "r") as file: layout = file.read() with open(environment_config_path, "r") as file: environment_config = file.read() -with open(ROOT_DIR / "gui_2d_vis" / "visualization.yaml", "r") as file: +with open(ROOT_DIR / "pygame_2d_vis" / "visualization.yaml", "r") as file: visualization_config = yaml.safe_load(file)