Skip to content
Snippets Groups Projects
Commit e8402865 authored by Florian Schröder's avatar Florian Schröder
Browse files

Rename "gui_2d_vis" directory to "pygame_2d_vis" and update paths

The "gui_2d_vis" directory has been renamed to "pygame_2d_vis". All references to "gui_2d_vis" in imports and file paths throughout the code have been updated to the new name. The renaming is clearer about the visualization library used and aligns with project conventions for directory naming.
parent aaf75c47
No related branches found
No related tags found
1 merge request!67Resolve "File, dir renaming"
Pipeline #47412 passed
Showing
with 18 additions and 18 deletions
......@@ -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).
......
"""
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`.
......
......@@ -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,
......
......@@ -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:
......
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment