Skip to content
Snippets Groups Projects
Commit f4ca8f3b authored by Fabian Heinrich's avatar Fabian Heinrich
Browse files

Merge branch 'main' into 55-environment-has-internal-time-not-datetime-now

parents 44093722 70317322
No related branches found
No related tags found
1 merge request!24Resolve "Environment has internal time not datetime now"
Pipeline #43054 failed
Showing
with 393 additions and 78 deletions
#QU#TNLB# #QU#T###NLB#
#_______M #__________M
#_______# #__________#
W________ W___________
#__A__A__ #__A_____A__
C________ C___________
C_______# C__________#
#_______X #__________X
#P#S+#S+# #P#S+####S+#
\ No newline at end of file \ No newline at end of file
_____ ____
_____ APA_
____P ____
\ No newline at end of file \ No newline at end of file
radius: 0.4 radius: 0.4
move_dist: 0.2 move_dist: 0.12
interaction_range: 1.6 interaction_range: 1.6
\ No newline at end of file
{
"defaults": {
"colours": {
"normal_bg": "#45494e",
"hovered_bg": "#35393e",
"disabled_bg": "#25292e",
"selected_bg": "#193754",
"dark_bg": "#15191e",
"normal_text": "#c5cbd8",
"hovered_text": "#FFFFFF",
"selected_text": "#FFFFFF",
"disabled_text": "#6d736f",
"link_text": "#0000EE",
"link_hover": "#2020FF",
"link_selected": "#551A8B",
"text_shadow": "#777777",
"normal_border": "#DDDDDD",
"hovered_border": "#B0B0B0",
"disabled_border": "#808080",
"selected_border": "#8080B0",
"active_border": "#8080B0",
"filled_bar": "#f4251b",
"unfilled_bar": "#CCCCCC"
}
},
"button": {
"colours": {
"normal_bg": "#45494e",
"hovered_bg": "#35393e",
"disabled_bg": "#25292e",
"selected_bg": "#193754",
"active_bg": "#193754",
"dark_bg": "#15191e",
"normal_text": "#c5cbd8",
"hovered_text": "#FFFFFF",
"selected_text": "#FFFFFF",
"disabled_text": "#6d736f",
"active_text": "#FFFFFF",
"normal_border": "#DDDDDD",
"hovered_border": "#B0B0B0",
"disabled_border": "#808080",
"selected_border": "#8080B0",
"active_border": "#8080B0"
},
"misc": {
"tool_tip_delay": "1.5"
}
}
}
\ No newline at end of file
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
GameWindow: GameWindow:
WhatIsFixed: window_width # entweder grid oder window_width WhatIsFixed: window_width # entweder grid oder window_width
size: 600 size: 600
screen_margin: 100
start_width: 600
start_height: 600
Kitchen: Kitchen:
ground_tiles_color: sgigray76 ground_tiles_color: sgigray76
......
...@@ -7,7 +7,7 @@ from datetime import datetime ...@@ -7,7 +7,7 @@ from datetime import datetime
import pygame import pygame
from overcooked_simulator import ROOT_DIR from overcooked_simulator import ROOT_DIR
from overcooked_simulator.pygame_gui.pygame_gui import PyGameGUI from overcooked_simulator.gui_2d_vis.overcooked_gui import PyGameGUI
from overcooked_simulator.simulation_runner import Simulator from overcooked_simulator.simulation_runner import Simulator
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
...@@ -50,12 +50,9 @@ def main(): ...@@ -50,12 +50,9 @@ def main():
pygame.K_i, pygame.K_i,
] ]
keys2 = [pygame.K_a, pygame.K_d, pygame.K_w, pygame.K_s, pygame.K_f, pygame.K_e] keys2 = [pygame.K_a, pygame.K_d, pygame.K_w, pygame.K_s, pygame.K_f, pygame.K_e]
gui = PyGameGUI(simulator, [f"p{i}" for i in range(number_player)], [keys1, keys2])
simulator.start() gui = PyGameGUI(simulator, [f"p{i}" for i in range(number_player)], [keys1, keys2])
gui.start_pygame() gui.start_pygame()
simulator.stop()
sys.exit() sys.exit()
......
...@@ -160,7 +160,7 @@ class Environment: ...@@ -160,7 +160,7 @@ class Environment:
Args: Args:
layout_file: Path to the layout file. layout_file: Path to the layout file.
""" """
current_y: float = 1.5 current_y: float = 0.5
counters: list[Counter] = [] counters: list[Counter] = []
designated_player_positions: list[npt.NDArray] = [] designated_player_positions: list[npt.NDArray] = []
free_positions: list[npt.NDArray] = [] free_positions: list[npt.NDArray] = []
...@@ -173,7 +173,7 @@ class Environment: ...@@ -173,7 +173,7 @@ class Environment:
for line in lines: for line in lines:
line = line.replace("\n", "").replace(" ", "") # remove newline char line = line.replace("\n", "").replace(" ", "") # remove newline char
current_x = 1.5 current_x = 0.5
for character in line: for character in line:
character = character.capitalize() character = character.capitalize()
pos = np.array([current_x, current_y]) pos = np.array([current_x, current_y])
...@@ -193,8 +193,7 @@ class Environment: ...@@ -193,8 +193,7 @@ class Environment:
self.kitchen_width = current_x self.kitchen_width = current_x
current_y += 1 current_y += 1
self.kitchen_height = int(self.kitchen_height + 2.5) self.kitchen_width -= 0.5
self.kitchen_width = int(self.kitchen_width + 0.5)
return counters, designated_player_positions, free_positions return counters, designated_player_positions, free_positions
......
...@@ -27,7 +27,7 @@ class Simulator(Thread): ...@@ -27,7 +27,7 @@ class Simulator(Thread):
def __init__( def __init__(
self, self,
env_layout_path, env_config_path,
layout_path, layout_path,
frequency: int, frequency: int,
item_info_path=ROOT_DIR / "game_content" / "item_info.yaml", item_info_path=ROOT_DIR / "game_content" / "item_info.yaml",
...@@ -40,7 +40,7 @@ class Simulator(Thread): ...@@ -40,7 +40,7 @@ class Simulator(Thread):
self.step_frequency: int = frequency self.step_frequency: int = frequency
self.preferred_sleep_time_ns: float = 1e9 / self.step_frequency self.preferred_sleep_time_ns: float = 1e9 / self.step_frequency
self.env: Environment = Environment( self.env: Environment = Environment(
env_layout_path, layout_path, item_info_path env_config_path, layout_path, item_info_path
) )
super().__init__() super().__init__()
......
...@@ -10,7 +10,7 @@ with open("README.md") as readme_file: ...@@ -10,7 +10,7 @@ with open("README.md") as readme_file:
with open("CHANGELOG.md") as history_file: with open("CHANGELOG.md") as history_file:
history = history_file.read() history = history_file.read()
requirements = ["numpy", "pygame", "scipy", "pytest>=3", "pyyaml"] requirements = ["numpy", "pygame", "scipy", "pytest>=3", "pyyaml", "pygame-gui"]
test_requirements = [ test_requirements = [
"pytest>=3", "pytest>=3",
......
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