Configuration
The player configuration is used to add agents to the race.
Each agent can be an AI or player controlled, and produces a separate render_data output.
- class pystk2.PlayerConfig
SuperTuxKart player configuration
- class CameraMode
- AUTO = 0
- OFF = 2
- ON = 1
- property name str property
- property value int property
- class Controller
- AI_CONTROL = 1
- PLAYER_CONTROL = 0
- property name str property
- property value int property
- property camera_mode pystk2.PlayerConfig.CameraMode property
Sets the camera on or off. If auto, use a camera for PLAYER_CONTROL only.
- property controller pystk2.PlayerConfig.Controller property
Let the player (PLAYER_CONTROL) or AI (AI_CONTROL) drive. The AI ignores actions in step(action).
- property kart str property
Kart type, see list_karts for a list of kart types
- property name str property
Name of the player
- property team int property
Team of the player 0 or 1
The main race configuration specified everything from the track to use, the race type, number of agents and additional AI agents.
- class pystk2.RaceConfig
SuperTuxKart race configuration.
- class RaceMode
- CAPTURE_THE_FLAG = 5
- FOLLOW_LEADER = 2
- FREE_FOR_ALL = 4
- NORMAL_RACE = 0
- SOCCER = 6
- THREE_STRIKES = 3
- TIME_TRIAL = 1
- property name str property
- property value int property
- property difficulty int property
Skill of AI players 0..2
- property laps int property
Number of laps the race runs for
- property mode pystk2.RaceConfig.RaceMode property
Specify the type of race
- property num_cameras int property
Number of cameras to follow the first karts (0 for none)
- property num_kart int property
Total number of karts, fill the race with num_kart - len(players) AI karts
- property players pystk2.VectorPlayerConfig property
List of all agent players
- property reverse bool property
Reverse the track
- property seed int property
Random seed
- property step_size float property
Game time between different step calls
- property track str property
Track name
- pystk2.list_tracks(*args, **kwargs)
Overloaded function.
list_tracks() -> list[str]
Return a list of track names (possible values for RaceConfig.track)
list_tracks(arg0: pystk2.RaceConfig.RaceMode) -> list[str]
Return a list of track names (possible values for RaceConfig.track)
- pystk2.list_karts() list[str]
Return a list of karts to play as (possible values for PlayerConfig.kart