Vordt of the Boreal Valley#
The SoulsGym environment for Vordt of the Boreal Valley.
The player and Vordt always start from their respective start poses at full HP/SP. The player starts with the stats and weapons as configured in <TODO: add config>. We do not allow shield blocking or two handing at this point, although this can easily be supported. Parrying is enabled.
Note
Phase 2 of the boss fight is available by setting the environment keyword argument phase.
See envs for details.
- class soulsgym.envs.darksouls3.vordt.VordtEnv(game_speed: float = 1.0, phase: int = 1, skip_steps: bool = False)#
Bases:
SoulsEnvThe SoulsGym environment for Vordt of the Boreal Valley.
- __init__(game_speed: float = 1.0, phase: int = 1, skip_steps: bool = False)#
Initialize the observation and action spaces.
- Parameters:
game_speed – The speed of the game during
SoulsEnv.step(). Defaults to 1.0.phase – The phase of the boss fight. Either 1 or 2 for Vordt. Defaults to 1.
skip_steps – Flag to skip steps while the player is disabled.
- property game_id: str#
Return the ID of the souls game that is required to run for this environment.
- Returns:
The game ID.
- property obs: dict#
Observation property of the environment.
- Returns:
The current observation of the environment.
- property info: dict#
Info property of the environment.
- Returns:
The current info dict of the environment.
- game_state() VordtState#
Read the current game state.
- Returns:
The current game state.
- reset(seed: int | None = None, options: Any | None = None) tuple[dict, dict]#
Reset the environment to its initial state.
- Parameters:
seed – Random seed. Required by gymnasium, but does not apply to SoulsGyms.
options – Options argument required by gymnasium. Not used in SoulsGym.
- Returns:
A tuple of the first game state and the info dict after the reset.
- close()#
Unpause the game, reset altered game properties and reload.
Note
Does not wait for reload to complete.
- static compute_reward(game_state: VordtState, next_game_state: VordtState) float#
Compute the reward from the current game state and the next game state.
- Parameters:
game_state – The game state before the step.
next_game_state – The game state after the step.
- Returns:
The reward for the provided game states.
- current_valid_actions() list[int]#
Get the set of currently valid actions.
- Returns:
An array of integers containing the currently allowed actions.
- property np_random: Generator#
Returns the environment’s internal
_np_randomthat if not set will initialise with a random seed.- Returns:
Instances of np.random.Generator
- render()#
Render the environment.
This is a no-op since we can’t render the environment and the game has to be open anyways.
- seed() list[int]#
Set the random seed for the environment.
Since we cannot control the randomness of the game and can’t precisely control the game, loop, this function does not have any effect.
Note
Setting the seed will not lead to reproducible results!
- Parameters:
seed – Random seed.
- Returns:
A list with 0 to comply with OpenAI’s function signature.
- step(action: int) tuple[dict, float, bool, bool, dict[str, Any]]#
Perform a step forward in the environment with a given action.
Each step advances the ingame time by step_size seconds. The game is paused before and after the step.
- Parameters:
action – The action that is applied during this step.
- Returns:
A tuple of the next game state, the reward, the terminated flag, the truncated flag, and an additional info dictionary.
- Raises:
ResetNeeded – step() was called after the episode was already finished.
- property unwrapped: Env[ObsType, ActType]#
Returns the base non-wrapped environment.
- Returns:
The base non-wrapped
gymnasium.Envinstance- Return type:
Env