core.game_state#

The GameState is a dataclass that contains all information about the game state.

It is also the observation type returned by soulsgym steps and resets and used as the internal state representation of the gym.

class soulsgym.core.game_state.GameState(phase: int = 1, player_hp: int = 0, player_max_hp: int = 1, player_sp: int = 0, player_max_sp: int = 1, boss_hp: int = 0, boss_max_hp: int = 1, player_pose: numpy.ndarray = <factory>, boss_pose: numpy.ndarray = <factory>, camera_pose: numpy.ndarray = <factory>, player_animation: str = 'NoAnimation', player_animation_duration: float = 0.0, boss_animation: str = 'NoAnimation', boss_animation_duration: float = 0.0, lock_on: bool = False)#

Collect all game state information in a single data class.

copy() soulsgym.core.game_state.GameState#

Create a copy of the GameState.

Returns

A copy of itself.

as_dict(deepcopy: bool = True) dict#

Create a dictionary from the data members.

Parameters

deepcopy – Creates a deep copy of the data. Arrays will be copied instead of referenced.

Returns

The class members and their values as a dictionary.

as_json() dict#

JSON encode the GameState class.

Returns

The current GameState as dictionary for JSON serialization.

static from_dict(data_dict: dict) soulsgym.core.game_state.GameState#

Create a GameState object from a dictionary.

Parameters

data_dict – Dictionary containing the GameState information.

Returns

A GameState object with matching values.