Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Cooperative Cuisine Environment
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Looking for advice? Join the
Matrix channel for GitLab users in Bielefeld
!
Show more breadcrumbs
Social Cognitive Systems
CoCoSy
Cooperative Cuisine Environment
Commits
f98d32a7
Commit
f98d32a7
authored
1 year ago
by
Fabian Heinrich
Browse files
Options
Downloads
Patches
Plain Diff
Fixed main merged, adjusted polygon
parent
9b106212
No related branches found
No related tags found
1 merge request
!42
Resolve "FOV of the players, fog-of-war like vision"
Pipeline
#45616
passed
1 year ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
overcooked_simulator/gui_2d_vis/drawing.py
+3
-1
3 additions, 1 deletion
overcooked_simulator/gui_2d_vis/drawing.py
overcooked_simulator/overcooked_environment.py
+7
-4
7 additions, 4 deletions
overcooked_simulator/overcooked_environment.py
with
10 additions
and
5 deletions
overcooked_simulator/gui_2d_vis/drawing.py
+
3
−
1
View file @
f98d32a7
...
...
@@ -165,14 +165,16 @@ class Visualizer:
screen
,
colors
[
"
black
"
],
(
pos
-
(
direction
*
grid_size
*
0.
8
),
pos
-
(
direction
*
grid_size
*
0.
6
),
left_beam
,
left_beam
+
(
direction
.
rotate
(
90
)
*
rect_scale
),
pos
-
(
direction
*
rect_scale
*
2
)
+
(
direction
.
rotate
(
90
)
*
rect_scale
),
pos
-
(
direction
*
rect_scale
*
2
)
+
(
direction
.
rotate
(
-
90
)
*
rect_scale
),
right_beam
+
(
direction
.
rotate
(
-
90
)
*
rect_scale
),
right_beam
,
),
)
...
...
This diff is collapsed.
Click to expand it.
overcooked_simulator/overcooked_environment.py
+
7
−
4
View file @
f98d32a7
...
...
@@ -754,7 +754,8 @@ class Environment:
def
get_json_state
(
self
,
player_id
:
str
=
None
)
->
str
:
if
player_id
in
self
.
players
:
self
.
hook
(
PRE_STATE
,
player_id
=
player_id
)
state
=
{
self
.
hook
(
PRE_STATE
,
player_id
=
player_id
)
state
=
{
"
players
"
:
[
p
.
to_dict
()
for
p
in
self
.
players
.
values
()],
"
counters
"
:
[
c
.
to_dict
()
for
c
in
self
.
counters
],
"
kitchen
"
:
{
"
width
"
:
self
.
kitchen_width
,
"
height
"
:
self
.
kitchen_height
},
...
...
@@ -768,12 +769,14 @@ class Environment:
"
view_restriction
"
:
[
self
.
players
[
player_id
].
facing_direction
.
tolist
(),
self
.
players
[
player_id
].
pos
.
tolist
(),
40
.0
,
35
.0
,
]
if
FOG_OF_WAR
else
None
,
}
self
.
hook
(
STATE_DICT
,
state
=
state
,
player_id
=
player_id
)
json_data
=
json
.
dumps
(
state
)
self
.
hook
(
JSON_STATE
,
json_data
=
json_data
,
player_id
=
player_id
)
}
self
.
hook
(
STATE_DICT
,
state
=
state
,
player_id
=
player_id
)
json_data
=
json
.
dumps
(
state
)
self
.
hook
(
JSON_STATE
,
json_data
=
json_data
,
player_id
=
player_id
)
assert
StateRepresentation
.
model_validate_json
(
json_data
=
json_data
)
return
json_data
raise
ValueError
(
f
"
No valid
{
player_id
=
}
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment