Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/oxwhirl/smac
/ functions
Functions
110 in github.com/oxwhirl/smac
⨍
Functions
110
◇
Types & classes
9
↓ 8 callers
Method
get_unit_by_id
Get unit by ID.
smac/env/starcraft2/starcraft2.py:1688
↓ 7 callers
Method
distance
Distance between two points.
smac/env/starcraft2/starcraft2.py:836
↓ 7 callers
Method
get_avail_agent_actions
Returns the available actions for agent_id.
smac/env/starcraft2/starcraft2.py:1424
↓ 5 callers
Method
full_restart
Full restart. Closes the SC2 process and launches a new one.
smac/env/starcraft2/starcraft2.py:446
↓ 5 callers
Method
get_unit_type_id
Returns the ID of unit type in the given scenario.
smac/env/starcraft2/starcraft2.py:1385
↓ 5 callers
Method
unit_max_shield
Returns maximal shield for a given unit.
smac/env/starcraft2/starcraft2.py:874
↓ 4 callers
Method
can_move
Whether a unit can move in a given direction.
smac/env/starcraft2/starcraft2.py:883
↓ 3 callers
Method
check_bounds
Whether a point is within the map bounds.
smac/env/starcraft2/starcraft2.py:924
↓ 3 callers
Method
close
Close StarCraft II.
smac/env/starcraft2/starcraft2.py:1478
↓ 3 callers
Method
get_agent_smac_id
(self, agent)
smac/env/pettingzoo/StarCraft2PZEnv.py:141
↓ 3 callers
Method
get_obs
Returns all agent observations in a list. NOTE: Agents should have access only to their local observations during decentralised execut
smac/env/starcraft2/starcraft2.py:1127
↓ 3 callers
Method
get_state
Returns the global state. NOTE: This functon should not be used during decentralised execution.
smac/env/starcraft2/starcraft2.py:1135
↓ 3 callers
Method
get_total_actions
Returns the total number of actions an agent could ever take.
smac/env/multiagentenv.py:39
↓ 3 callers
Method
step
A single environment step. Returns reward, terminated, info.
smac/env/starcraft2/starcraft2.py:452
↓ 2 callers
Method
_launch
Launch the StarCraft II game.
smac/env/starcraft2/starcraft2.py:316
↓ 2 callers
Method
_observe_all
(self)
smac/env/pettingzoo/StarCraft2PZEnv.py:150
↓ 2 callers
Method
get_avail_agent_actions
Returns the available actions for agent_id.
smac/env/multiagentenv.py:35
↓ 2 callers
Function
get_map_params
(map_name)
smac/env/starcraft2/maps/__init__.py:8
↓ 2 callers
Method
get_obs_agent
Returns observation for agent_id. The observation is composed of: - agent movement features (where it can move to, height information
smac/env/starcraft2/starcraft2.py:946
↓ 2 callers
Method
get_obs_ally_feats_size
Returns the dimensions of the matrix containing ally features. Size is n_allies x n_features.
smac/env/starcraft2/starcraft2.py:1271
↓ 2 callers
Method
get_obs_enemy_feats_size
Returns the dimensions of the matrix containing enemy features. Size is n_enemies x n_features.
smac/env/starcraft2/starcraft2.py:1260
↓ 2 callers
Method
get_obs_move_feats_size
Returns the size of the vector containing the agents's movement- related features.
smac/env/starcraft2/starcraft2.py:1297
↓ 2 callers
Method
get_obs_own_feats_size
Returns the size of the vector containing the agents' own features.
smac/env/starcraft2/starcraft2.py:1285
↓ 2 callers
Method
get_obs_size
Returns the size of the observation.
smac/env/multiagentenv.py:19
↓ 2 callers
Method
get_obs_size
Returns the size of the observation.
smac/env/starcraft2/starcraft2.py:1309
↓ 2 callers
Method
get_surrounding_points
Returns the surrounding points of the unit in 8 directions.
smac/env/starcraft2/starcraft2.py:901
↓ 2 callers
Method
only_medivac_left
Check if only Medivac units are left.
smac/env/starcraft2/starcraft2.py:1664
↓ 2 callers
Method
reset
Reset the environment. Required after each full episode. Returns initial observations and states.
smac/env/starcraft2/starcraft2.py:396
↓ 2 callers
Method
unit_sight_range
Returns the sight range for an agent.
smac/env/starcraft2/starcraft2.py:844
↓ 1 callers
Method
_all_rewards
(self, reward)
smac/env/pettingzoo/StarCraft2PZEnv.py:144
↓ 1 callers
Method
_all_terms_truncs
(self, terminated=False, truncated=False)
smac/env/pettingzoo/StarCraft2PZEnv.py:162
↓ 1 callers
Method
_get_units
(self)
smac/env/starcraft2/render.py:114
↓ 1 callers
Method
_init_agents
(self)
smac/env/pettingzoo/StarCraft2PZEnv.py:75
↓ 1 callers
Method
_init_ally_unit_types
Initialise ally unit types. Should be called once from the init_units function.
smac/env/starcraft2/starcraft2.py:1634
↓ 1 callers
Method
_kill_all_units
Kill all units on the map.
smac/env/starcraft2/starcraft2.py:1500
↓ 1 callers
Method
_restart
Restart the environment by killing all units on the map. There is a trigger in the SC2Map file, which restarts the episode when there
smac/env/starcraft2/starcraft2.py:435
↓ 1 callers
Function
clamp
(n, smallest, largest)
smac/env/starcraft2/render.py:20
↓ 1 callers
Method
close
(self)
smac/env/pettingzoo/StarCraft2PZEnv.py:128
↓ 1 callers
Method
close
Close the environment
smac/examples/rllib/env.py:109
↓ 1 callers
Method
draw_base_map
Draw the base map.
smac/env/starcraft2/render.py:170
↓ 1 callers
Method
draw_overlay
Draw the overlay describing resources.
smac/env/starcraft2/render.py:310
↓ 1 callers
Method
draw_units
Draw the units.
smac/env/starcraft2/render.py:190
↓ 1 callers
Method
get_agent_action
Construct the action for agent a_id.
smac/env/starcraft2/starcraft2.py:548
↓ 1 callers
Method
get_agent_action_heuristic
(self, a_id, action)
smac/env/starcraft2/starcraft2.py:657
↓ 1 callers
Method
get_ally_num_attributes
(self)
smac/env/starcraft2/starcraft2.py:1166
↓ 1 callers
Method
get_enemy_num_attributes
(self)
smac/env/starcraft2/starcraft2.py:1169
↓ 1 callers
Method
get_env_info
(self)
smac/env/starcraft2/starcraft2.py:1703
↓ 1 callers
Method
get_obs
Returns all agent observations in a list.
smac/env/multiagentenv.py:11
↓ 1 callers
Method
get_state_dict
Returns the global state as a dictionary. - allies: numpy array containing agents and their attributes - enemies: numpy array contain
smac/env/starcraft2/starcraft2.py:1172
↓ 1 callers
Method
get_state_size
Returns the size of the global state.
smac/env/multiagentenv.py:27
↓ 1 callers
Method
get_state_size
Returns the size of the global state.
smac/env/starcraft2/starcraft2.py:1322
↓ 1 callers
Method
get_surrounding_height
Returns height values of the grid surrounding the given unit.
smac/env/starcraft2/starcraft2.py:937
↓ 1 callers
Method
get_surrounding_pathing
Returns pathing values of the grid surrounding the given unit.
smac/env/starcraft2/starcraft2.py:928
↓ 1 callers
Method
get_total_actions
Returns the total number of actions an agent could ever take.
smac/env/starcraft2/starcraft2.py:831
↓ 1 callers
Method
get_unit_name
Get a length limited unit name for drawing units.
smac/env/starcraft2/render.py:121
↓ 1 callers
Method
init_units
Initialise the units.
smac/env/starcraft2/starcraft2.py:1510
↓ 1 callers
Function
main
()
smac/examples/random_agents.py:9
↓ 1 callers
Function
main
Runs an env object with random actions.
smac/examples/pettingzoo/pettingzoo_demo.py:10
↓ 1 callers
Function
main
()
smac/bin/map_list.py:10
↓ 1 callers
Function
make_env
(raw_env)
smac/env/pettingzoo/StarCraft2PZEnv.py:25
↓ 1 callers
Function
parallel_env
(max_cycles=None, **smac_args)
smac/env/pettingzoo/StarCraft2PZEnv.py:14
↓ 1 callers
Function
raw_env
(max_cycles=None, **smac_args)
smac/env/pettingzoo/StarCraft2PZEnv.py:21
↓ 1 callers
Method
render
(self)
smac/env/multiagentenv.py:47
↓ 1 callers
Method
reset
(self, seed=None, options=None)
smac/env/pettingzoo/StarCraft2PZEnv.py:131
↓ 1 callers
Method
reset
Resets the env and returns observations from ready agents. Returns: obs (dict): New observations for each ready agent.
smac/examples/rllib/env.py:44
↓ 1 callers
Method
reward_battle
Reward function when self.reward_spare==False. Returns accumulative hit/shield point damage dealt to the enemy + reward_death_value pe
smac/env/starcraft2/starcraft2.py:774
↓ 1 callers
Method
step
Returns observations from ready agents. The returns are dicts mapping from agent_id strings to values. The number of agents in the en
smac/examples/rllib/env.py:62
↓ 1 callers
Method
unit_max_cooldown
Returns the maximal cooldown for a unit.
smac/env/starcraft2/starcraft2.py:848
↓ 1 callers
Method
unit_shoot_range
Returns the shooting range for an agent.
smac/env/starcraft2/starcraft2.py:840
↓ 1 callers
Method
update_units
Update units after an environment step. This function assumes that self._obs is up-to-date.
smac/env/starcraft2/starcraft2.py:1582
Method
__del__
(self)
smac/env/pettingzoo/StarCraft2PZEnv.py:207
Method
__init__
(self, env, max_cycles)
smac/env/pettingzoo/StarCraft2PZEnv.py:37
Method
__init__
(self, max_cycles, **smac_args)
smac/env/pettingzoo/StarCraft2PZEnv.py:217
Method
__init__
Create a StarCraftC2Env environment. Parameters ---------- map_name : str, optional The name of the SC2
smac/env/starcraft2/starcraft2.py:66
Method
__init__
(self, env, mode)
smac/env/starcraft2/render.py:43
Method
__init__
Create a new multi-agent StarCraft env compatible with RLlib. Arguments: smac_args (dict): Arguments to pass to the underlying
smac/examples/rllib/env.py:19
Method
_build_layers_v2
(self, input_dict, num_outputs, options)
smac/examples/rllib/model.py:17
Function
_get_desktop_size
Get the desktop size.
smac/env/starcraft2/render.py:24
Method
action_space
(self, agent)
smac/env/pettingzoo/StarCraft2PZEnv.py:72
Method
close
(self)
smac/env/multiagentenv.py:50
Method
close
(self)
smac/env/starcraft2/render.py:110
Method
draw_arc_ratio
( color, world_loc, radius, start, end, thickness=1 )
smac/env/starcraft2/render.py:220
Method
draw_screen
Draw the screen area.
smac/env/starcraft2/render.py:343
Function
env_creator
(smac_args)
smac/examples/rllib/run_qmix.py:28
Function
env_fn
(**kwargs)
smac/env/pettingzoo/StarCraft2PZEnv.py:26
Method
get_avail_actions
Returns the available actions of all agents in a list.
smac/env/multiagentenv.py:31
Method
get_avail_actions
Returns the available actions of all agents in a list.
smac/env/starcraft2/starcraft2.py:1470
Method
get_env_info
(self)
smac/env/multiagentenv.py:60
Method
get_obs_agent
Returns observation for agent_id.
smac/env/multiagentenv.py:15
Function
get_smac_map_registry
()
smac/env/starcraft2/maps/smac_maps.py:227
Method
get_state
Returns the global state.
smac/env/multiagentenv.py:23
Method
get_stats
(self)
smac/env/starcraft2/starcraft2.py:1692
Method
get_unit_types
(self)
smac/env/starcraft2/starcraft2.py:1573
Method
get_visibility_matrix
Returns a boolean numpy array of dimensions (n_agents, n_agents + n_enemies) indicating which units are visible to each agent.
smac/env/starcraft2/starcraft2.py:1342
Method
observation_space
(self, agent)
smac/env/pettingzoo/StarCraft2PZEnv.py:69
Method
render
(self, mode="human")
smac/env/pettingzoo/StarCraft2PZEnv.py:125
Method
render
(self, mode="human")
smac/env/starcraft2/starcraft2.py:1490
Method
render
(self, mode)
smac/env/starcraft2/render.py:134
Method
reset
Returns initial observations and states.
smac/env/multiagentenv.py:43
Method
save_replay
Save a replay.
smac/env/multiagentenv.py:56
next →
1–100 of 110, ranked by callers