Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🧾 Summary
This PR adds user interface support for visualizing and interacting with custom race tracks defined via a CSV file. The UI now renders the pre-defined obstacle layout row-by-row if such a file exists and is valid. This aligns with the engine's new feature that loads track layouts from custom_map.csv.
✨ Features Added
UI integration with new track system driven by CSV map.
Rendering of static obstacle patterns as defined by the engine.
Visual synchronization with repeated obstacle rows.
Proper fallback behavior when no CSV is available or when disabled.
⚙️ Implementation Details
The UI fetches the current track state from the engine as usual.
No changes to the communication protocol were needed – the backend exposes the map via the standard state() interface.
The UI interprets each {"name", "x", "y"} obstacle item and renders it accordingly.
No new dependencies were introduced.
📚 Motivation
This PR aligns the front-end with the engine's new custom track feature, ensuring users can see and interact with designed obstacle layouts, such as puzzle maps, symmetric challenges, or timed hazards.
🧪 Test Plan
Verified custom map loads and renders properly in UI when CSV exists.
Verified fallback to random map when file is missing or marked as disabled.
Validated correct positioning of obstacles across all lanes.
Ensured visual consistency on repeated loops (when map restarts).
🧩 Future Improvements
UI editor to allow drag-and-drop design of new CSV tracks.
In-game indicator for whether a custom map is active.
Highlighting differences between symmetric and asymmetric tracks.