Skip to content

Add create_car_id_map to map v1 car IDs to v2 agent IDs for replay conversion - #60

Open
chrisrca wants to merge 1 commit into
RLGym:mainfrom
chrisrca:main
Open

chrisrca wants to merge 1 commit into
RLGym:mainfrom
chrisrca:main

Conversation

@chrisrca

Copy link
Copy Markdown

Add create_car_id_map to map v1 car IDs (1-8) to v2 agent UUIDs, enabling retrieval of v2 actions for v1 players during replay conversion with convert_game_state.

# Create the mapping from v1 car IDs to v2 agent IDs
id_map = create_car_id_map(frame.state.cars)
# Use the map to get v2 agent ID for a v1 player and retrieve actions
v2_id = id_map[v1_player.car_id]
action = frame.actions.get(v2_id, np.zeros(8, dtype=np.float32))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant