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 Controller
AI_CONTROL = 1
PLAYER_CONTROL = 0
property name str property
property value int property
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 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_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() 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