Building a Shareable Rally Stage Planner with Vanilla JavaScript
A rally stage can fit inside a URL: the seed, distance, terrain, and season are enough to describe a run that someone else can open. That is the core of Dirtbound — The Rally Field Guide , an independent companion site I built for the DirtBound browser rally game. You can configure a stage, launch it in the original game, and copy a link to share the configuration. DirtBound is made by Luke…
A rally stage can be identified using just a URL, with details like seed, distance, terrain, and season. This concept forms the basis of Dirtbound - The Rally Field Guide, an independent companion site for the DirtBound browser rally game. Players can set up a stage, launch it in the original game, and share the configuration via a link.
The project was built by Luke Baffait and Victor Boutros. The interactive tools on the site allow users to experiment with various settings. The stage planner is the core interaction, offering choices for distances ranging from 1 km to 10 km, including an Endless option, three terrain types, four seasons, and a stage seed. Once these choices are made, the site generates a unique link containing the selected parameters, such as https://dirtbound.fr/play.html?rally=471231&length=5000&landscape=high&season=winter&lang=en.
This link selects seed 471231, a 5 km distance, high mountains, and winter. In the original game's public menu and startup code, it was observed that Endless mode omits the length parameter. The planner internally represents this as 0 and excludes it from the URL. The game also allows the default terrain and season to be omitted.
The URL construction function in the project takes a value, normalizes the stage inputs to ensure they meet the supported options, and sets default values if necessary. It then generates the URL based on the stage configuration. The normalization process validates the inputs and applies its own checks to handle any invalid or unusable settings.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.