You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently trying to create an environment where a team of agents (jellies) compete with enemy units (gnomes) to win a shootout game. The gnomes are part of the environment and make use of A* and proximity triggers to fire on the jellies.
So far, I have been rendering the environment only using gd.ObserverType.ISOMETRIC. I tried to switch to gd.ObserverType.BLOCK_2D by specifying the following sections in the GDY file.
# Specifying this block for each object under the Observers key.
Block2D:
-Shape: e.g. circle
Color: [ x, y, z ]
Scale: 1.0
# Specifying in the Environment section also under Observers
Block2D:
TileSize: 30
When I run the program though, what I get is a couple of time steps rendering and then the following error:
Traceback (most recent call last):
File "/Users/tekier/uni/diss/smac_lite/aliens/aliens.py", line 31, in <module>
obs, reward, done, info = env.step(env.action_space.sample())
File "/opt/anaconda3/envs/smac_lite/lib/python3.8/site-packages/gym/wrappers/order_enforcing.py", line 37, in step
return self.env.step(action)
File "/opt/anaconda3/envs/smac_lite/lib/python3.8/site-packages/gym/wrappers/step_api_compatibility.py", line 52, in step
step_returns = self.env.step(action)
File "/opt/anaconda3/envs/smac_lite/lib/python3.8/site-packages/griddly/GymWrapper.py", line 363, in step
self._player_last_observation[p] = self._get_observation(self._players[p].observe(),
IndexError: map::at: key not found
Hopefully, this is case of me just missing something from the GDY file, but I've had a look at some examples and it seems like I've got everything I need.
And you are using setTile commands... if there is only one tile for the block observer, it's basically crashing because its looking for the nth tile (which is set in the isometric observer but not the block observer)
A quick workaround would be to add 4 block shapes (that are the same).
In Griddly this should almost certainly throw a warning or an error (and just use the single tile that exists)
I am currently trying to create an environment where a team of agents (jellies) compete with enemy units (gnomes) to win a shootout game. The gnomes are part of the environment and make use of A* and proximity triggers to fire on the jellies.
So far, I have been rendering the environment only using
gd.ObserverType.ISOMETRIC
. I tried to switch togd.ObserverType.BLOCK_2D
by specifying the following sections in the GDY file.When I run the program though, what I get is a couple of time steps rendering and then the following error:
Hopefully, this is case of me just missing something from the GDY file, but I've had a look at some examples and it seems like I've got everything I need.
To Recreate
aliens.zip
aliens.py
My environment:
MacOS Monterey 12.2
Python 3.8.13
Griddly version 1.4.3
The text was updated successfully, but these errors were encountered: