Repository navigation
Route Editor
Battle Routes, the route editor in the MKDD-NX Tools app, edits the routes the computer karts drive in single player battles. The game's arenas have no paths for CPUs, so MKDD-NX carries its own route for every arena (the game's six and MKDD Plus's 24), built into the .nro. You don't need this app to play battles. It's for making the CPUs drive differently.
From the latest release:
| Computer | File |
|---|---|
| Windows | MKDD-NX-Tools.exe |
| Mac, Apple Silicon (M1 and later) | MKDD-NX-Tools-arm64.dmg |
| Mac, Intel | MKDD-NX-Tools-x86_64.dmg |
Nothing else needs installing. It's one app for all of MKDD-NX's tools, each in its own tab: click the Battle Routes tab (or Open on its card on the Start tab). You can switch tabs at any time; each tool keeps what you were doing.
- Windows: if it says "Windows protected your PC", click More info, then Run anyway.
-
Mac: open the
.dmgand drag the app to Applications. The app isn't signed by Apple, so the first time, right-click it and choose Open. On newer macOS, if that isn't offered, try to open it once, then go to System Settings > Privacy & Security and click Open Anyway.
It asks for three folders and files, and remembers them for next time:
-
Routes folder: where your routes are saved. Put the SD card in your computer and pick
switch/MKDD-NX/routes(create theroutesfolder if there is none). -
Disc image (optional; Cancel skips it): your own
.iso,.gcm,.cisoor.rvz. It draws the game's arena maps. It's only read; nothing from it is saved. -
MKDD Plus folder (optional): the mod's folder that holds
files. It draws MKDD Plus's arena maps.
Pick an arena in the list at the top left. It opens with its built-in route, unless your routes folder already has one for it.
An arena's route is a network: numbered junctions (circles) joined by parts (paths of points from one junction to another). At each junction a CPU picks one of the parts leaving it, so more choices spread the CPUs out.
A route file holds several networks. Each battle, every CPU gets a different one at random. Three is the minimum (one per CPU); more make each battle different.
- Arena (top left): the arena to edit.
- Network (left): which network you see and edit. Add network makes a new one from the map, Delete network removes the one shown.
- Covers N% (left): how much of the arena the network reaches.
-
Parts list (left): every part, written
from > to. Click one to select it. - Map from (top): Game (the game's own collision, best) or Recordings (old test drives).
- Game map (top): draws the real arena under the route. Green is road, red is wall, purple is out of bounds, teal is a pipe.
- Floor (top): on arenas with levels (Luigi's Mansion, Pipe Plaza), shows one level at a time.
- Coverage (top): shades red what no part of the network comes near.
- Status bar (bottom): the position under the mouse, the distance to a wall, and where the route was loaded from.
The selected part is yellow. Point colours show how close a point is to a wall: normal is clear, orange is close, red means a CPU may hit the wall or get stuck there.
| Action | Windows | Mac |
|---|---|---|
| Move a point | Drag it | Drag it |
| Move a junction and its parts' ends | Drag the numbered circle | Drag the numbered circle |
| Add a point | Click the selected part's line | Click the selected part's line |
| Add a point at the end | Shift-click | Shift-click |
| Select a part | Click its line | Click its line |
| Delete a point | Right-click it | Right-click or Control-click it |
| Pan | Middle- or right-drag | Middle- or right-drag |
| Zoom | Mouse wheel | Scroll |
| Undo (50 steps) | Ctrl+Z | Command-Z or Ctrl+Z |
- New part: asks for the start and end junctions, then draws a straight line. Drag its points into shape.
- Copy part: duplicates the selected part. The quickest way to add another choice between two junctions: copy, then drag the copy's middle points somewhere else.
- Delete part: removes the selected part.
- Make routes: replaces the network shown with a new one made from the map. Each press gives a different one. Ctrl+Z brings the old one back.
- Reload: throws away your changes.
-
Save: writes
<key>.txtto your routes folder. The previous file is kept as<key>.bak.
Put the SD card back in the Switch and start a battle in that arena. The game uses routes/<key>.txt from the SD card instead of the built-in route. To go back to the built-in route, delete that file.
To check which route a battle used, look in the game's logs in switch/MKDD-NX/logs/ for:
-
route: routes/<key>.txt, network ...: your file. -
route: built-in <key>, network ...: the built-in route. -
route: network not used: <reason>: a network broke a rule (below), and the next one was used.
Save refuses a network that breaks one of these, and says which rule:
- Exactly one part leaves junction 0.
- At most 4 parts leave a junction, and at most 4 reach it.
- Every junction a part reaches has a part leaving it (no dead ends), and the other way round.
- At least 2 points per part, and at most 512 points in the whole arena.
- Junctions numbered 0 to 63.
- Keep parts on the road, away from walls (no red points), and avoid sharp turns: CPUs follow points loosely.
- Where three parts leave a junction, a fourth gives CPUs another choice.
- On Pipe Plaza, the pipe parts come from recordings of driving through the pipes: leave them alone.
The built-in routes are in the repository's routes folder. Better routes can be sent as a pull request, or in an issue with the <key>.txt file attached. The full reference, including the automatic route maker (tools/battle_routes.py) and the file format, is docs/BATTLE_ROUTES.md.
The tool is tools/route_editor.py in the repository (Python 3 with Pillow; zstandard for .rvz):
py -3 tools/route_editor.py [<routes folder>] [--disc IMAGE] [--mod "MKDD Plus folder"] [--game-map]