{"slug": "the-racing-line-in-toca-race-driver", "title": "The racing line in TOCA Race Driver", "summary": "Codemasters' TOCA Race Driver stores AI racing lines in 512 KiB files containing 32,768 16-byte records, with about 21% of each file holding racing-line points and 0.5% control tags that select speed and braking targets, according to a developer's reverse-engineering of the game's binary format. The analysis of 1,371 archives found the data section base varies from 0x60 to 0x5000, not always at 0x800, which caused misreads in about 290 files. The findings are implemented in the open-source Ruby reader lib/bigf/toca/profile.rb.", "body_md": "People who played TOCA Race Driver remember the other cars. They take a line. They brake late and run wide. The compliment is always that they feel driven.\n\nI already had the container. Codemasters packed the AI into a BIGF\narchive: four bytes of magic, a directory, then the files. That is\n[Reading a Binary Game Format in Ruby](/2026/06/30/reading-binary-in-ruby.html).\nThis is what those files hold.\n\nTOCA Race Driver 1 names 39 AI profiles inside `aib.big`\n\n. A full one is\nexactly 512 KiB. 32,768 records of 16 bytes, each four little-endian\nfloats. I classified every record by its bit pattern.\n\n| record kind | share of file | what it is |\n|---|---|---|\npadding (`0x3f3f3f3f` , the float `0.747` ) |\n~65% |\nunused fill in a fixed-size slot |\nracing-line point `(x0, y0, x1, y1)` |\n~21% | the line the AI follows |\nbound scalar `(v, 0, v, 0)` |\n~3% | the authored value for a channel |\ncontrol tag (`0c..08` plus a float `K` ) |\n~0.5% | selects the channel |\n\nThe points chain. Consecutive `(x, y)`\n\npairs sit about fifteen\nworld-units apart (on one DTM block the mean gap is 14.4, range 2 to\n57). Plot them and a circuit appears: a start-finish straight, a\ntechnical infield. A full profile carries somewhere between 5,000 and\n17,000 usable points, depending on the series.\n\nThe control layer is smaller. A tag\n`0c 00 00 00 08 00 00 00`\n\nplus a float `K`\n\n, then a scalar\n`(v, 0, v, 0)`\n\nimmediately after. In one DTM profile there are nine\ndistinct `K`\n\nvalues. Each shows up about thirty-five times, once per\nsector.\n\n| K | paired v | what it is doing |\n|---|---|---|\n| 137 | ≈ 8.0 | speed target |\n| 552 | ≈ 152 | high target, DTM only |\n| -135 | ≈ -79.5 | lateral / braking |\n\nThe authored number sits in the scalar that follows the tag. Follow this line. At this sector, aim for this value.\n\nDriver files sitting next to the archive name the other scalars: Aggression, Mistakes, Control, SpeedIn, SpeedOut. They are more tables, loaded once before the grid.\n\nI assumed the data section always started at `0x800`\n\n. It does in a lot\nof files. Measuring 1,371 archives showed the base lives in a header\nfield and runs from `0x60`\n\nto `0x5000`\n\n. The assumption silently misread\nabout 290 files.\n\n32 of the 39 names in RD1’s `aib.big`\n\nare empty stubs. The 512 KiB\nblobs live in the series archives (`ela.big`\n\n, `dtm.big`\n\n) using the same\nlayout.\n\n`.aid`\n\n), then tiny\nper-class overlays (`.aib`\n\n, 76 to 84 bytes) and per-class arrays\n(`.red`\n\n). The 16-byte record vocabulary is the same. An RD2 overlay\ndecodes with the RD1 classifier. 56 modular archives.`AILD`\n\n.Harder profiles are different tables. A different line. Different target values. A wider or narrower error band.\n\nOwn discs. No game bytes reproduced here, only sizes, magics, and record shapes.\n\nThe shares in the first table are from a full RD1 profile. Other series spend more or less of the 512 KiB on path against pad.\n\nI have not located the per-frame steering function in the executable. Several strings that look like an AI servo belong to force-feedback and the TV camera. I am leaving those out until a later pass.\n\nThe classifier is in the same public reader as the container:\n\n`lib/bigf/toca/profile.rb`", "url": "https://wpnews.pro/news/the-racing-line-in-toca-race-driver", "canonical_source": "https://davidslv.uk/2026/08/25/the-racing-line-in-toca-race-driver.html", "published_at": "2026-08-25 00:00:00+00:00", "updated_at": "2026-08-25 07:14:11.823392+00:00", "lang": "en", "topics": ["artificial-intelligence"], "entities": ["Codemasters", "TOCA Race Driver", "BIGF", "Ruby"], "alternates": {"html": "https://wpnews.pro/news/the-racing-line-in-toca-race-driver", "markdown": "https://wpnews.pro/news/the-racing-line-in-toca-race-driver.md", "text": "https://wpnews.pro/news/the-racing-line-in-toca-race-driver.txt", "jsonld": "https://wpnews.pro/news/the-racing-line-in-toca-race-driver.jsonld"}}