Guest User

TRD2 Modding Final Journal

a guest
Oct 8th, 2026
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 51.26 KB | None | 0 0
  1. Memory name:
  2. TOCA Race Driver 2 Modding Mayhem — Final Master Memory Journal (EXE/AIB/Championship Expansion)
  3.  
  4. Memory version and date of writing:
  5. Stable 3 final consolidation; 2026-09-29
  6.  
  7. Name of the writer:
  8. ChatGPT
  9.  
  10. Relevant sections:
  11. - A0: read first; this is the compact set of critical facts required to continue the project without restarting the investigation.
  12. - A2: formal goals.
  13. - C3: proven / unproven / disproven status.
  14. - C4: reproducible AIB-generation and native BIG insertion procedure.
  15. - C5: warnings, traps, and the best next targets.
  16. - Main project focus: TOCA Race Driver 2 (PC), championship expansion, AI resource resolution, AIB generation, and vehicle/class identity.
  17.  
  18. Information ordering rule:
  19. Information is ordered from critical importance to least important in every section. A0 contains only critical information required to preserve the project's state and reproduce its formal goals.
  20.  
  21. Section A:
  22.  
  23. A0- Important or critical information:
  24.  
  25. 1. CORE ARCHITECTURE — DO NOT RESTART THE INVESTIGATION FROM CLASS NAMES
  26. RD2.exe has a real internal identity pipeline for selecting AIB resources:
  27. championship / vehicle configuration identity
  28. -> parsed raw/internal CarID
  29. -> canonical ID
  30. -> hard-coded canonical AI namespace
  31. -> track-specific AIB filename
  32. -> native BIG archive resource
  33. -> runtime AIB corner-speed data
  34. -> AI driving behavior
  35.  
  36. The critical warning is:
  37. User-facing class/championship name != necessarily AIB namespace.
  38. Never infer the AIB filename only from a Cardata family or championship label.
  39.  
  40. 2. EXECUTABLE FUNCTIONS THAT MATTER
  41. AIB/resource loading was traced directly in RD2.exe.
  42.  
  43. - 0x43D460: parses literal class/type identity strings into raw/internal CarID values.
  44. - 0x43DA70: canonicalizes raw IDs.
  45. * input is bounded at <= 0xF4.
  46. * indexes a byte lookup table at 0x43DBFC.
  47. * uses a jump table at 0x43DB68.
  48. - 0x40FD50: maps canonical IDs 0..0x25 to AIB namespace strings via a jump table around 0x40FF84.
  49. - 0x410020: constructs resource names using:
  50. "%s_%s%s"
  51. "%s_%s_s%s"
  52. and converts the canonical ID to its namespace string before formatting.
  53. - 0x4106C0: central AIB resource setup/loading path.
  54. * vehicle/object comes from global table 0xB0BC98[index].
  55. * vehicle/object +0x78 -> driver record.
  56. * driver record +0x44 = raw CarID.
  57. * raw CarID -> 0x43DA70.
  58. * canonical ID -> 0x410020.
  59. * resource lookup -> 0x5785F0.
  60. * loader/allocation -> 0x57AF20.
  61. * reuse/dedup path -> 0x410820.
  62. - 0x410820: related AIB reuse/dedup path; it repeats the vehicle/object -> +0x78 -> +0x44 -> canonicalization flow.
  63. - 0x411280: requested vehicle index -> 0xB0BC98[index] -> +0x78 -> driver +0x44 -> canonicalization -> 0x410100; searches loaded AIBs and, when needed, reaches 0x4110E0.
  64. - 0x4110E0: secondary AIB path. It searches the descriptor table at 0x62579C for descriptor +0x2D4 == requested index, follows +0x2A4 -> runtime entry +0x60 -> driver +0x44, canonicalizes, calls 0x410100, then 0x57AF20.
  65. - 0x411380: initializes AIBs through loops and invokes 0x410820 / 0x411280.
  66. - 0x42D000: builds descriptor table.
  67. * config object count from 0x444800
  68. * 0x444220(config,index) = config +0x1A40 + index*0x80
  69. * descriptor +0x2D4 = index
  70. * 0x62568C[index*4] = descriptor pointer
  71. * descriptor +0x2A4 = runtime entry
  72. - 0x444220: exact runtime-entry address:
  73. config + 0x1A40 + index*0x80
  74. - 0x444800:
  75. movzx eax, byte ptr [eax+0x29AC]
  76. - around 0x44357E: a routine reads a configuration field named "Name", passes it to 0x43D460, and stores the resulting raw ID into descriptor +0x44. The surrounding structure also contains fields such as Gender, CarID, FreeTimeImportance, RRIncludeRace, GridPosition, and GameMode. The exact file/object type containing the Name field was not fully identified, so do not claim it is literally a Cardata filename without further proof.
  77. - 0x40DB20: builds vehicle-object table.
  78. * 0xB0BC94 = count
  79. * descriptor array at 0x62568C
  80. * descriptor +0x2A0 = vehicle object
  81. * descriptor +0x2A4 -> runtime entry +0x60 -> driver record
  82. * driver raw CarID +0x44 copied into vehicle object +0x78
  83. * vehicle pointers stored in 0xB0BC98[]
  84. - 0x40E690: allocates 0x1A0-byte vehicle object.
  85. - 0x40E6A0: compares candidate vehicle-object first DWORD against descriptor +0x2A0 first DWORD, indicating a shared physical/resource identity test is likely present.
  86. - 0x42C180: Cardata path construction:
  87. raw CarID -> 0x43C9F0 -> "cardata\%c%c\%s.big"
  88. Templates recovered include:
  89. ca_%c, sk_%c, ps_%c, ma_%c, mg_%c, sc_%c, fi_%c, wg_%c,
  90. he_%c, uo_%c, v8_%c, v8b_%c, xk_%c, ex_%c, ko_%c, bs_%c,
  91. uk_%c, dt_%c, dtb_%c, gt_%c, us_%c, lr_%c, ac_%c, cc_%c,
  92. vc_%c, ft_%c, pi_%c, sl_%c, pg_%c, ff_%c, fm_%c, g9_%c, g4_%c
  93.  
  94. 3. AUTHORITATIVE CANONICAL -> AIB NAMESPACE TABLE
  95. Use this table when determining filenames:
  96. canonical 0,1,2 -> vc
  97. canonical 3 -> g9
  98. canonical 4 -> pg
  99. canonical 5 -> bs
  100. canonical 6 -> ex
  101. canonical 7 -> g4
  102. canonical 8,9 -> wg
  103. canonical 10 -> ko
  104. canonical 11 -> am
  105. canonical 12,13 -> cc
  106. canonical 14 -> cr
  107. canonical 15,16,17 -> uk
  108. canonical 18 -> pg
  109. canonical 19,20,21 -> dt
  110. canonical 22,23,24,25 -> v8
  111. canonical 26 -> pi
  112. canonical 27 -> gt
  113. canonical 28 -> ma
  114. canonical 29 -> sl
  115. canonical 30 -> uo
  116. canonical 31 -> xk
  117. canonical 32 -> mg
  118. canonical 33 -> us
  119. canonical 34 -> f9
  120. canonical 35 -> fi
  121. canonical 36 -> lr
  122. canonical 37 -> ff
  123.  
  124. Important correction:
  125. ca_0 raw 0xD1 -> canonical 10 -> namespace ko
  126. NOT ex, am, or v8.
  127. ex_0 raw 0x91 -> canonical 6 -> namespace ex.
  128.  
  129. 4. CRITICAL RAW/CANONICAL EXAMPLES
  130. Known mappings recovered directly from the executable:
  131. uk_0 raw 0x78 -> canonical 15 -> uk
  132. uk_1 raw 0x79 -> canonical 16 -> uk
  133. uk_2 raw 0x7A -> canonical 15 -> uk
  134.  
  135. bs_0 raw 0x7B -> canonical 15 -> uk
  136. bs_1 raw 0x7C -> canonical 15 -> uk
  137. bs_2 raw 0x7D -> canonical 15 -> uk
  138. bs_3 raw 0x7E -> canonical 16 -> uk
  139. bs_4 raw 0x7F -> canonical 16 -> uk
  140. bs_5 raw 0x80 -> canonical 16 -> uk
  141.  
  142. he_0 raw 0xC7 -> canonical 16 -> uk
  143. he_1 raw 0xC8 -> canonical 15 -> uk
  144.  
  145. ca_0 raw 0xD1 -> canonical 10 -> ko
  146. ex_0 raw 0x91 -> canonical 6 -> ex
  147.  
  148. fm_0 raw 20 -> canonical 2 -> vc
  149. fm_1 raw 21 -> canonical 5 -> bs
  150.  
  151. sc_0..sc_4 raw 209..213 -> canonical 10 -> ko
  152. sc_5..sc_9 raw 214..218 -> canonical 7 -> g4
  153.  
  154. g4_0..g4_9 raw 0..9 -> canonical 7 -> g4
  155. ko_0..ko_9 raw 135..144 -> canonical 10 -> ko
  156.  
  157. This proves that Cardata families may reuse completely different AI namespaces.
  158.  
  159. 5. MIXED-CLASS / VARIANT RULES THAT MATTER MOST
  160. - FM is not one AI namespace:
  161. fm_0 = Mustang '68 -> vc
  162. fm_1 = Mustang 2000 Cobra R -> bs
  163. - SC is not one AI namespace:
  164. sc_0..sc_4 = Koenig 2002 -> ko
  165. sc_5..sc_9 = Race Tuned GT40 -> g4
  166. - This matches file inspection:
  167. sc_0.big is mechanically identical to the KO Koenig package for mech.csv,
  168. SimMech.csv, int.ini, and dmg.ini.
  169. sc_7.big is a Ford GT40 / Race Tuned GT40 identity.
  170. - Do not create sc AIBs merely because the Cardata family is sc.
  171. - Do not create ca AIBs merely because Caliburn is labeled ca.
  172. - Cross-championship Cardata reuse is normal and not itself a problem.
  173.  
  174. 6. DRIVER CONFIGURATION FIELDS
  175. The driver parser around 0x443380:
  176. - loops "Driver %i"
  177. - runtime entry = config +0x1A40 + N*0x80
  178. - runtime_entry +0x60 = config +0x29B4 + N*0x78
  179. - reads "CarID" from string location around 0x5e2464
  180. - calls 0x43D460
  181. - writes raw CarID to driver record +0x44
  182.  
  183. Parsed AI fields:
  184. AIAggression -> +0x48
  185. AIControl -> +0x4C
  186. AIMistakes -> +0x50
  187. AISpeedIn -> +0x54
  188. AISpeedOut -> +0x58
  189. AIStartline -> +0x5C
  190. These are real parsed configuration fields, separate from AIB corner data.
  191.  
  192. 7. AIB BINARY FACTS
  193. Original archive:
  194. - 529 real original AIB files.
  195. - All 529 were checked and byte 10 matched nc with zero mismatches.
  196. - 6,485 real corner records were checked.
  197. - Corner record format:
  198. [4 zero bytes][speed uint16][tag uint16]
  199. - AIB header examples begin:
  200. 0c 00 00 00 08 00 00 00
  201. - AIB byte 10 is the true nc value (corner count).
  202. - Corner count is track-geometric and shared across classes.
  203. Example: Bathurst had 17 corners for 11 real class resources.
  204. - Byte 11 is separate and must not be casually modified.
  205. - AIB uint16 values are target-speed-related inputs, not simply "raw km/h".
  206. - Downstream consumer around 0x4084FC transforms the stored uint16 using runtime globals and 0x5D0278, with observed limits around min 40 (0x28) and max 400 (0x190) in the target path.
  207. - 0x40F1F0 interpolates vehicle response curves using values related to [esi] / [esi+4], with scaling involving 1/65536 and 3000.0; if current speed exceeds target, a zero-like response can result.
  208. - vehicle +0x144 contains current-speed-like data populated around 0x40BB11 using velocity * 3.6.
  209. - Exact physical units and full formula are still not completely resolved.
  210.  
  211. 8. MISSING ORIGINAL NAMESPACE FACT
  212. Six Cardata/classes had no dedicated pre-existing original AIB/RED/BRP resources anywhere in the original archive:
  213. ca, fm, he, ps, sk, sc
  214. This is NOT proof that those cars are unsupported by AI.
  215. The executable canonicalization shows they can resolve to existing namespaces.
  216.  
  217. 9. RESOURCE NAMING STRINGS IN .rdata
  218. Relevant strings:
  219. 0x5e0890 "%s_%s.qdr"
  220. 0x5e0898 "%s_%s_s.qdr"
  221. 0x5e08a0 "%s_s%s.red"
  222. 0x5e08a8 "%s_ps%s.red"
  223. 0x5e08c0 "bgraph.big"
  224. 0x5e08cc "%s.big"
  225. 0x5e08d4 "aib.big"
  226. 0x5e08dc "cars"
  227. 0x5e0910 "ai.ini"
  228. 0x5e0924 "%s_i.brp"
  229. 0x5e092c "%s_i_s.brp"
  230. 0x5e0934 "%s.brp"
  231. 0x5e093c "%s_s.brp"
  232. 0x5e0950 "%s%s"
  233. 0x5e0958 "%s_%s%s"
  234. 0x5e0960 "%s_%s_s%s"
  235. Class strings found include:
  236. xk ex lr fi us uo sl ma pi am cr cc mg bs vc ko ff f9 wg g9 g4 gt pg uk dt v8
  237. They establish naming families, but the executable mapping still decides which one is actually requested.
  238.  
  239. 10. FALLBACK BEHAVIOR — VERY IMPORTANT
  240. At 0x4106C0, after failed resource lookup, the missing-AIB branch begins around 0x410784.
  241. Original fallback writes decimal 40 (0x28).
  242. Diagnostic executable:
  243. RD2_fallback999.exe
  244. patched file offset:
  245. 0x10784
  246. original bytes:
  247. BF 28 00 00 00
  248. patched bytes:
  249. BF E7 03 00 00
  250. Original SHA-256:
  251. ce6bf4f1a8139eba3889dcb2d276aa931116cbfd72ffb9d5f3b64c6da74407c5
  252. Patched SHA-256:
  253. a838a758a6ae03e76a4cf8a29a7a5038de149c88e1e44c54f43af66cebd79f7f
  254.  
  255. Experimental result:
  256. - Changing fallback 40 to 999 causes obvious corner overshoot / altered AI behavior on unsupported combinations.
  257. Therefore fallback behavior is real and materially affects driving.
  258. The diagnostic EXE is NOT the desired mod-distribution solution. Native archive/resource supply remains the preferred implementation.
  259.  
  260. 11. NATIVE BIG ARCHIVE STRUCTURE
  261. Outer AIB archive observations:
  262. - header begins BIGF39.
  263. - outer archive had 57 entries in the examined original aib.big.
  264. - outer directory record = 24 bytes.
  265. - filename field = 12 bytes.
  266. - size at record +16.
  267. - offset at record +20.
  268. - nested BIG physical base was derived from the outer directory offset plus 0x800 in the observed archive layout.
  269.  
  270. Nested track BIG:
  271. - starts with BIGFxx (Eastern Creek example BIGF05; Hockenheim BIGF0A).
  272. - directory records are 24 bytes.
  273. - filename field = 12 bytes.
  274. - size +16.
  275. - offset +20.
  276. - physical payload = nested data-base + stored entry offset.
  277. - The tested nested BIGF layouts use 0x800-byte alignment conventions.
  278. Do not confuse a directory-relative/stored resource offset with the physical payload location.
  279.  
  280. 12. FIRST SUCCESSFUL NATIVE AIB RESOURCE INJECTION
  281. Reference:
  282. aib_eastern_creek_vc_test_v2.big
  283. SHA-256:
  284. cc7f3b0fef9013d1fbae862a16a524f1ad18ada0dbccd25122af9bfd0294c790
  285. Archive size:
  286. 4,067,328 bytes
  287.  
  288. Construction:
  289. - base = original aib.big
  290. - nested track wrapper = eas.big
  291. - corrected nested BIGF05 offsets were used
  292. - renamed only:
  293. eas_v8.aib -> eas_vc.aib
  294. eas_v8_s.aib -> eas_vc_s.aib
  295. - AIB payload bytes were unchanged.
  296. - exactly two bytes differed from the original archive.
  297. - changed absolute offsets:
  298. 1863721
  299. 1863745
  300. User tested it in-game successfully.
  301.  
  302. Meaning:
  303. - the unmodified game can resolve and consume a native AIB resource through the normal BIG archive path.
  304. - no DLL injection or EXE patch is required for this route.
  305. - this milestone proves namespace/resource selection, not yet custom numerical AIB generation.
  306.  
  307. 13. SUCCESSFUL ADDITIVE AIB INSERTION — STRUCTURAL BREAKTHROUGH
  308. Reference:
  309. aib_pacific_adelaide_generated_v8_additive_correct.big
  310. SHA-256:
  311. 2d5830f44ee1d851cece0e9789598d61209c1c201697164e3afdca8a4b723583
  312.  
  313. User result:
  314. - no crash
  315. - AI drives normally
  316.  
  317. Known tested construction:
  318. - target nested archive = ade.big
  319. - original entry count = 5
  320. - new entry count = 7
  321. - added:
  322. ade_pg.aib
  323. ade_pg_s.aib
  324. - new aligned slots:
  325. ade_pg.aib stored offset 0x6000
  326. ade_pg_s.aib stored offset 0x6800
  327. - original RED/AID/AIB resources were preserved.
  328. - nested size became 0x7800.
  329. - later outer resources were shifted by the exact nested-size increase.
  330. - final archive size = 4,069,376 bytes.
  331.  
  332. This disproves:
  333. "RD2.exe cannot consume newly added AIB entries."
  334. The native archive route can insert genuinely new AIB resources.
  335.  
  336. 14. EXACT ADDITIVE CONSTRUCTION RULES TO PRESERVE
  337. For an existing nested BIG:
  338. 1. Start from the original archive, not a malformed intermediate.
  339. 2. Parse the nested BIG header and directory exactly.
  340. 3. Preserve all existing records and payloads unchanged unless a test specifically calls for another change.
  341. 4. Increase directory count only by the number of truly new resources.
  342. 5. Add fixed 12-byte filename fields.
  343. 6. Allocate each new resource in its own 0x800-byte-aligned slot.
  344. 7. Keep the stored directory offset consistent with the nested data-base convention.
  345. 8. Compute physical payload placement separately from the stored directory offset.
  346. 9. Never overlap a new AIB slot with an existing AIB, RED, or AID payload.
  347. 10. Update nested size to cover all aligned new slots.
  348. 11. Rebuild/update outer archive offsets for later outer entries if the nested archive grows.
  349. 12. Preserve outer archive entry sizes correctly.
  350. 13. Leave RD2.exe unmodified for the final native resource route.
  351. 14. Verify resource names, directory count, offsets, physical positions, sizes, and payload bytes before testing.
  352. 15. Test the exact car/namespace combination that should request the new resource.
  353.  
  354. 15. AIB GENERATION METHOD THAT ACTUALLY WORKED AT BULK SCALE
  355. Successful bulk archive:
  356. aib_champ30_location_priority_bulk_v1.big
  357. Manifest:
  358. aib_champ30_location_priority_bulk_v1_manifest.txt
  359. Input:
  360. champ30 (location priority).big
  361. SHA-256:
  362. 2af5525fe07036d4924c468e9df276950e0f6deb014024e312e12a68b9cdb1dc
  363. Output size:
  364. 6,373,376 bytes
  365.  
  366. Required track/canonical pairs:
  367. 808
  368. Existing normal namespaces retained:
  369. 245
  370. Missing/new namespace pairs:
  371. 563
  372. New AIB resources:
  373. 1,126
  374. = 563 normal + 563 "_s"
  375.  
  376. Generation rule:
  377. - for each missing track + canonical namespace pair:
  378. 1. choose a same-track donor AIB;
  379. 2. prefer a donor with the modal/compatible corner count;
  380. 3. copy its entire payload;
  381. 4. scale each corner speed uint16 at payload offset 0x10 + 8*i by 0.97;
  382. 5. preserve all other payload bytes;
  383. 6. generate both normal and "_s" resources;
  384. 7. add them as new 0x800-byte-aligned entries;
  385. 8. never replace existing archive resources.
  386.  
  387. User validation:
  388. - approximately a dozen randomly sampled track/class combinations from the bulk archive were tested.
  389. - observed:
  390. 0 crashes
  391. 0 fallback cases
  392. all tested combinations had normal AI behavior.
  393.  
  394. This is the strongest practical validation of the current generator.
  395. It does NOT prove that every generated profile is optimally competitive on every track; it proves the method is safe/usable across a broad sample and successfully avoids fallback in that test set.
  396.  
  397. 16. GENERATION QUALITY / ANALYSIS RESULTS
  398. - Same-track donor shapes are much more useful than global flat models.
  399. - A broad flat class-scale x raw-curvature model was weak: approximately 55% error even when corner count/position were correct.
  400. - Template-based same-track donor generation using a global performance index from 14,029 real corner comparisons had median error around 10%.
  401. - Existing AIB values have meaningful local corner associations.
  402. - AIB experiments with all speeds=999 or all speeds=1 showed strong localized changes.
  403. - A single corner speed change can cause localized overshoot/slowdown, confirming per-corner association.
  404. - AIB values should not be casually interpreted as direct vehicle speed.
  405. - The current 0.97 generation factor is an empirical/conservative recipe that worked well enough for broad native use; its physical meaning is not fully proven.
  406.  
  407. 17. BEHAVIORAL AIB TESTS WORTH REMEMBERING
  408. - zan_g4.aib all speeds=999 -> GT40 overshoots corners frequently.
  409. - zan_g4 corner 0 speed=999 -> overshoot concentrated at first corner while other corners stayed comparatively normal.
  410. - zan_g4 all speeds=1 -> GT40 became very slow at corners.
  411. - An existing generated/modified Eastern Creek Mustang AIB with many corner values at 999 caused noticeably worse Mustang driving, proving injected numerical values matter.
  412. - A true original zan_g4 AIB caused normal GT40 behavior when used independently.
  413. - Setting every corner in zan_sc.aib to 999 produced no observable Supercar Cup change; this specifically means that file was not controlling that observed behavior, not that AIBs are irrelevant globally.
  414. - Earlier large generated AIB populations caused broad AI changes in some contexts; these should not be used as evidence that every namespace was correct because those tests predated the canonical resolver breakthrough.
  415.  
  416. 18. BRP / RED / AID STATUS
  417. Current project priority:
  418. PRIMARY = AIB
  419. SECONDARY / DEFERRED = BRP, RED, QDR
  420.  
  421. BRP tests:
  422. - g4.brp first 512 uint16 values set to 1 -> inconsistent hard braking / overshoot.
  423. - g4.brp second 512 values set to 1 -> essentially normal.
  424. - g4.brp first curve at 50% -> mostly normal.
  425. - fm68.brp first curve half -> similar to original.
  426. - fm68.brp first curve all 999 -> hard/slow corner braking persisted; more collisions/ramming but no clear solution.
  427. - brp_test1: original zan_g4 AIB with generated 999 version + original g4.brp -> overshoot, generally normal.
  428. - brp_test2: same + generated g4.brp -> more frequent overshoot / odd braking.
  429. - brp_test3: generated eas_fm.aib all 999 + generated fm.brp/fm_s.brp -> Mustangs improved from worse to neutral.
  430.  
  431. RED:
  432. - No convincing evidence has established that RED is required for competent AI when a correct AIB is found.
  433. - Many "missing class" resources may be solvable through canonical AIB reuse without custom RED.
  434.  
  435. AID:
  436. - .aid files are per-track, not per-class.
  437. - cat.big contains cat.aid, 21,772 bytes.
  438. - cat.aid header begins:
  439. 06 0d 01 20 00 05 3d 01 00 00 00 00
  440. - Section 1 = 1,585 float32 pairs = 12,680 bytes.
  441. - Section 2 = 1,135 uint32 + float32 records = 9,080 bytes, meaning still unknown.
  442. - AID should not be conflated with class-specific AIB.
  443.  
  444. 19. CHAMPIONSHIPS / CARDATA GROUND TRUTH
  445. The project documentation identifies 33 championships and their main vehicle identities:
  446.  
  447. 1 Sunshine Series -> Ford GT
  448. 2 Convertible Tour -> DB7 Vantage Volante; XKR Convertible; AC 289 CRS
  449. 3 '68 Mustang Challenge -> Ford Mustang 1968
  450. 4 Formula Ford -> Formula Ford
  451. 5 Pacific American -> Mitsubishi 3000 GT; Nissan Skyline GT-R R34
  452. 6 Supercopa -> Seat Leon Supercopa
  453. 7 Lighting 500 -> Ford SVT F-150 Lightning
  454. 8 SuperTruck Racing -> Ford 9000
  455. 9 Vintage Classic -> Mustang 1968; Jaguar E-Type Series-II; Aston Martin DB5
  456. 10 Euro Rally -> Subaru Impreza WRX; Mitsubishi Lancer Evolution VII
  457. 11 Duez Thropy -> Subaru Impreza WRX ice/snow
  458. 12 Bowler Rallycross -> Bowler Wildcat
  459. 13 Truman Stockcar -> Championship Stockcar
  460. 14 Global GT Lights -> Global GT Light Race Car
  461. 15 Coast To Coast -> Ford GT90
  462. 16 Mustang Challenge 2000 -> Ford 2000 Mustang Cobra R
  463. 17 DTM -> ABT-Audi TT-R; AMG-Mercedes CLK; Opel Astra V8 Coupe
  464. 18 UK Rallycross -> Subaru Impreza WRX; Mitsubishi Lancer Evolution VII
  465. 19 Street Series -> Subaru Impreza WRX; Mitsubishi Lancer Evolution VII
  466. 20 Koenig Speedfest -> Koenig Competition 2002
  467. 21 Excalibur Cup -> Aston Martin DB9 Coupe
  468. 22 XKR Series -> Jaguar XKR Race Car
  469. 23 V8 Supercars -> Holden Commodore VY/VX V8 Supercar; Ford Falcon BA/AU V8 Supercar
  470. 24 American 1000 -> Single Seater 1000 Race Car
  471. 25 World GT -> Jaguar XJ220; Koenig C62
  472. 26 Hotrod Streetrace -> 1934 Ford Hot Rod Coupe
  473. 27 Pacific Street -> Mustang 2000 Cobra R; Mitsubishi 3000 GT
  474. 28 Supercar Cup -> Koenig Competition 2002; Ford GT
  475. 29 Duez Cup -> Aston Martin V12 Vanquish; XKR Convertible ice/snow
  476. 30 Masters Grand Prix -> Masters Grand Prix Car
  477. 31 Caliburn Classic -> Aston Martin DB9 Coupe
  478. 32 Mamba Single Day -> AC Mamba
  479. 33 Speed Circus -> Nissan Skyline GT-R R34
  480.  
  481. 20. DETAILED CARDATA IDENTITY FAMILIES
  482. Known important mappings:
  483. ac_0..ac_2 = Subaru Impreza WRX 2003 / ICE / Ice-Racer
  484. ac_3 = Aston Martin V12 Vanquish
  485. ac_4 = Jaguar XKR
  486.  
  487. bs_0..bs_2 = Evo VII Street
  488. bs_3..bs_5 = Subaru Impreza WRX 2003 Street-Racer
  489.  
  490. ca_0..ca_4 = Aston Martin DB9 (AM803)
  491. cc_0..cc_1 = Aston Martin DB7 Volante
  492. cc_2..cc_3 = Jaguar XKR
  493. cc_4..cc_5 = AC Cobra 289 CRS
  494.  
  495. dt/dtb variants = Audi TT / Mercedes CLK / Opel Astra Coupe
  496.  
  497. ex_0..ex_6 = Aston Martin DB9 (AM803)
  498.  
  499. ff_0..ff_5 = Formula Ford
  500.  
  501. fi_0..fi_1 = Ford 1934 Coupe
  502.  
  503. fm_even = Ford Mustang '68
  504. fm_odd = Ford Mustang 2000 Cobra R
  505. specifically:
  506. fm_0,2,4,6,8 = 1968 Mustang
  507. fm_1,3,5,7,9 = Mustang 2000 Cobra R
  508.  
  509. ft_0..ft_3 = Supertruck 500 bhp
  510. g4_0..g4_9 = Ford GT40
  511. g9_0..g9_9 = Ford GT90
  512. gt_0..gt_7 = Global GT Light
  513.  
  514. he_0 = Subaru Impreza WRX 2003 / Scooby Rally
  515. he_1 = Evo VII Rally
  516.  
  517. ko_0..ko_9 = Koenig 2002
  518. lr_0..lr_2 = Bowler Wildcat
  519. ma_0..ma_4 = AC Mamba
  520. mg_0..mg_a = Formula One / Masters Grand Prix
  521. pg_0..pg_4 = Mitsubishi 3000
  522. pg_5..pg_9 = Nissan Skyline
  523. pi_0..pi_9 = Ford F150 Lightning
  524. ps_0..ps_2 = Mustang 2000 Cobra R
  525. ps_3..ps_5 = Mitsubishi 3000
  526. sc_0..sc_4 = Koenig 2002
  527. sc_5..sc_9 = Race Tuned GT40
  528. sk_0..sk_4 = Nissan Skyline
  529. sl_0 = Seat Leon Supercopa
  530. uk_0,uk_2 = Evo VII Rallycross
  531. uk_1 = Subaru Impreza WRX 2003 Rallycross
  532. uo_0..uo_9 = Open Wheel Series (OVAL)
  533. us_0..us_9 = Stock Car (Oval)
  534. v8 family = Holden / Ford Falcon variants
  535. wg = Jaguar XJ220 / Koenig C62 variants
  536. xk_0..xk_9 = Jaguar XKR Race Car
  537.  
  538. Special recurring edge cases:
  539. - Subaru Impreza and Mitsubishi Evo appear across rally, rallycross, and street families.
  540. - Aston Martin DB9 appears in both ca and ex Cardata families.
  541. - Same physical car may legitimately reuse data across multiple championships.
  542.  
  543. 21. GAINS FROM OTHER EXPERIMENTS / ARCHIVES
  544. - Eastern Creek nested archive:
  545. eas.big outer size = 32768 in the inspected wrapper.
  546. BIGF05 begins at relative offset 2048.
  547. data area begins at relative offset 4096.
  548. eas_v8.aib relative data offset 0, size 108.
  549. eas_v8_s.aib relative data offset 2048, size 108.
  550. eas.aid relative data offset 4096, size 0x5644.
  551. eas_psV8.red relative data offset 22528, size 0x624.
  552. eas_sV8.red relative data offset 26624, size 0x624.
  553. - Hockenheim:
  554. hoc.big outer record index 23.
  555. size 0xA800.
  556. directory offset 0x1DE800.
  557. nested physical base 0x1DF000.
  558. BIGF0A with 10 entries:
  559. hoc_am.aib 0x0000, size 0x6C
  560. hoc_dt.aib 0x0800, size 0x6C
  561. hoc_dt_s.aib 0x1000, size 0x6C
  562. hoc_s.aib 0x1800, size 0x6C
  563. hoc_v8.aib 0x2000, size 0x6C
  564. hoc.aid 0x2800, size 0x528C
  565. hoc_psdt.red 0x8000, size 0x71C
  566. hoc_sac.red 0x8800, size 0x718
  567. hoc_sdt.red 0x9000, size 0x71C
  568. hoc_sko.red 0x9800, size 0x718
  569. No original hoc_cr.aib / hoc_cr_s.aib were present.
  570.  
  571. 22. THREE-WAY CANONICAL VALIDATION — KEEP THE CORRECTION
  572. Initial three-way experiment:
  573. Pacific Street -> Hockenheim -> guessed uo
  574. Excalibur Cup -> Eastern Creek -> ex
  575. Seat Supercopa -> Adelaide -> sl
  576.  
  577. Results:
  578. Pacific/Hockenheim/uo -> no crash, fallback
  579. Excalibur/Eastern/ex -> no crash, normal AI
  580. Seat/Adelaide/sl -> no crash, normal AI
  581.  
  582. IMPORTANT LATER CORRECTION:
  583. The Pacific Street prediction of uo was wrong.
  584. Executable mapping gives:
  585. ps_0..ps_2 -> canonical 3 -> g9
  586. ps_3..ps_5 -> canonical 5 -> bs
  587. Therefore the uo fallback is not evidence of AIB generation failure.
  588. The correct Hockenheim namespaces for Pacific Street are:
  589. hoc_g9.aib
  590. hoc_g9_s.aib
  591. hoc_bs.aib
  592. hoc_bs_s.aib
  593.  
  594. 23. CHAMP30 LOCATION-PRIORITY BULK TEST
  595. Input:
  596. champ30 (location priority).big
  597. Output:
  598. aib_champ30_location_priority_bulk_v1.big
  599. Manifest:
  600. aib_champ30_location_priority_bulk_v1_manifest.txt
  601. SHA:
  602. 2af5525fe07036d4924c468e9df276950e0f6deb014024e312e12a68b9cdb1dc
  603.  
  604. Counts:
  605. required track/canonical pairs = 808
  606. existing normal namespaces retained = 245
  607. missing/new pairs = 563
  608. new AIBs = 1126
  609.  
  610. The bulk generator used the same-track donor / compatible corner-count / 0.97 uint16 speed scaling recipe above.
  611. User sampled roughly twelve generated combinations:
  612. 0 crashes
  613. 0 fallback
  614. all normal AI
  615.  
  616. This is currently the best empirical result in the project.
  617.  
  618. 24. FINAL RANDOMIZED CHAMP30 STATUS
  619. The user later supplied:
  620. champ30 (randomized).big
  621.  
  622. A working AIB/resource build for the randomized championship was also created during the continuation of the project. Its generated attachment was subsequently deleted from the conversation/session, but the user preserved a copy. Therefore:
  623. - Do NOT claim the randomized AIB is lost.
  624. - Do NOT claim a new randomized AIB still needs to be created from scratch.
  625. - The preserved randomized working AIB should be treated as a recovered project artifact for future comparison/reference.
  626. - The exact generated filename, SHA-256, and full resource inventory were not preserved in this final journal, so a future session should identify the preserved file before making any claims about its exact contents.
  627.  
  628. 25. OTHER CORRECTIONS THAT MUST NOT BE LOST
  629. - Earlier assumption that 59EA10 was the primary AIB consumer was corrected; the important downstream driving consumer is around 0x4084FC.
  630. - Earlier assumption that 4104D0 was the corner detector was corrected; 410930 is the clearer corner-indexing path.
  631. - Early Eastern Creek archive test v1 had filename fields patched at wrong relative positions and was invalid as a namespace test.
  632. - Correct Eastern Creek v2 changed exactly two filename bytes.
  633. - Several early Adelaide additive archives crashed because nested directory/data relationships were malformed, physical placement overlapped existing data, and one intermediate test had a filename field overflow risk.
  634. - A mistaken interpretation treated stored directory offsets as direct physical offsets from the nested BIG start. The correct relationship uses the nested data-base.
  635. - Earlier Caliburn Hockenheim tests using ex/v8/cr/lr were contaminated by wrong namespace hypotheses or malformed/replaced resources. The later direct mapping establishes:
  636. ca -> raw D1 -> canonical 10 -> ko
  637. so Caliburn's relevant AI namespace is ko, not ex.
  638. - Do not use the earlier guessed ex-based Caliburn result as evidence for the final mapping.
  639.  
  640. 26. OTHER PROJECT FACTS
  641. - gates.big is career progression/selection, not the primary AIB physics source.
  642. - bgraph.big appears in resource strings; no evidence currently makes it the critical AIB route.
  643. - The project should prefer normal archive modification over DLL injection.
  644. - The final target is not to globally change the fallback constant. The goal is to make the native resolver find an appropriate AIB so fallback is unnecessary.
  645.  
  646. A1- Short summary of the current chat related to the formal goal:
  647.  
  648. The project began as a search for a reliable way to expand TOCA Race Driver 2 championships without blindly duplicating AI resources. The investigation first decoded the native AIB binary format, then proved by controlled value changes that AIB corner data affects AI. The decisive breakthrough came from disassembling RD2.exe: 0x43D460 parses configuration identities into raw IDs, 0x43DA70 canonicalizes those IDs, 0x40FD50 maps canonical IDs to AI namespaces, and 0x410020 builds the requested AIB filename. This explained many apparently missing classes and mixed Cardata families. A native filename substitution succeeded, then a genuinely additive AIB resource was successfully inserted into a nested BIG archive. Finally, a bulk generator created 1,126 new AIB resources for 563 missing track/namespace pairs in champ30 (location priority); roughly a dozen user tests produced zero crashes and zero fallback cases. A working randomized-championship AIB was also created later and preserved by the user after its conversation attachment was deleted.
  649.  
  650. A2- Goal of the chat:
  651.  
  652. Formal goal:
  653. Create a durable, self-contained reverse-engineering and modding record for TOCA Race Driver 2 that allows a future session to:
  654. 1. Resolve the exact AIB namespace requested for a vehicle by following executable canonicalization.
  655. 2. Inspect a championship's actual vehicle/class combinations without assuming class-name = namespace.
  656. 3. Add missing native AIB resources to nested BIG archives safely.
  657. 4. Generate plausible AIB data using same-track donor geometry and conservative 0.97 scaling.
  658. 5. Verify that the new resources are actually found by the unmodified executable.
  659. 6. Avoid repeating failed archive-construction mistakes or obsolete namespace assumptions.
  660.  
  661. Sub-goals:
  662. - preserve all important executable addresses and mappings;
  663. - preserve binary/archive construction rules;
  664. - preserve the proven tests and their results;
  665. - distinguish proven facts from unproven interpretations;
  666. - document the exact bulk-generation recipe;
  667. - record the corrected status of the randomized-championship AIB.
  668.  
  669. A3- Relevant web sources:
  670.  
  671. None.
  672. The project conclusions come from local/uploaded RD2.exe, BIG archives, Cardata documentation, project journals, and in-game test observations. No web source was required for the core findings.
  673.  
  674. Section B:
  675.  
  676. B1: Summary of the entire chat:
  677.  
  678. The TOCA Race Driver 2 Modding Mayhem project evolved from behavioral guessing into executable-level reverse engineering. Early tests decoded the AIB format and showed that corner-speed values matter: changing one corner could make an AI car overshoot that specific corner, while setting values to very low numbers could make it extremely slow. Large blind AIB populations produced inconsistent side effects, so the project stopped treating every Cardata class as an independent AIB namespace.
  679.  
  680. Disassembly of RD2.exe then revealed the critical chain. The driver/configuration system parses identity strings through 0x43D460 into raw IDs. The executable canonicalizes those IDs at 0x43DA70 and maps canonical IDs to AIB namespaces at 0x40FD50. The loader around 0x4106C0 and filename builder at 0x410020 then construct names such as track_namespace.aib and track_namespace_s.aib. This showed that classes such as FM, SC, CA, PS, HE, and SK do not necessarily need their own AIB namespace. The most important variant results are fm_0 -> vc, fm_1 -> bs, sc_0..4 -> ko, and sc_5..9 -> g4. This matches the inspected car identities, including the mixed Supercar family.
  681.  
  682. The project also established that the normal archive route is enough. The first clean Eastern Creek namespace substitution succeeded in the unmodified game. Then a new AIB resource was physically added to Adelaide's nested BIGF05 archive with correct directory count, offsets, alignment, and outer-file relocation; the game loaded it without crashing. Failed Adelaide builds were traced to archive-construction mistakes rather than an engine limitation.
  683.  
  684. The final major practical result was the champ30 location-priority bulk generator. It identified 563 missing track/canonical combinations, created 1,126 new normal/_s AIBs, preserved the 245 existing normal namespaces, and used same-track donor AIBs with compatible corner counts and a 0.97 uint16 speed scale. Approximately a dozen user tests produced normal AI with zero crashes and zero fallback cases. The puzzling Pacific Street -> Hockenheim -> uo case was later corrected: Pacific Street actually maps to g9 and bs, so the fallback was caused by the wrong predicted namespace, not by the generator.
  685.  
  686. A working AIB for the randomized champ30 version was also created during the continuation after the location-priority work. Its conversation attachment was later deleted, but the user explicitly preserved the working copy. That preserved artifact should be recovered/identified before future modification or redistribution. The technical details of that randomized build were not consolidated into this journal, so its exact filename/hash should not be invented.
  687.  
  688. B2: Your thoughts about the chat or current project:
  689.  
  690. The central lesson is that RD2's resource identity system is more sophisticated than its Cardata folder names suggest. Canonicalization is the key to scaling the mod: once the exact namespace is known, native archive insertion works and broad AIB generation becomes a manageable data problem instead of an EXE-hook problem. The bulk result is strong evidence that the current same-track donor method is practical. The future work should stay disciplined: map first, generate second, validate third.
  691.  
  692. B3: Reference artifacts:
  693.  
  694. Critical references preserved in the project:
  695. - RD2.exe
  696. - TRD2 general info R2.txt
  697. - deeper cardata.txt
  698. - [skill-card] Memory Journal SR3.txt
  699. - aib_champ30_location_priority_bulk_v1.big
  700. - aib_champ30_location_priority_bulk_v1_manifest.txt
  701. - aib_eastern_creek_vc_test_v2.big
  702. - aib_pacific_adelaide_generated_v8_additive_correct.big
  703. - RD2_fallback999.exe
  704. - champ30 (location priority).big
  705. - champ30 (randomized).big
  706. - user-preserved randomized-championship working AIB (exact filename/hash to be recovered from the preserved copy)
  707.  
  708. Section C:
  709.  
  710. C1- Steps taken to reach the goal:
  711.  
  712. 1. Catalogued original AIB resources and established that 529 real files existed.
  713. 2. Verified byte 10 = nc across all 529 originals and inspected 6,485 corner records.
  714. 3. Identified AIB corner record layout as 4 zero bytes + speed uint16 + tag uint16.
  715. 4. Used deliberate AIB value changes at Zandvoort and Eastern Creek to prove per-corner AI effects.
  716. 5. Tested BRP curves and established that at least one BRP curve can materially affect braking behavior, while not proving a universal requirement for BRP.
  717. 6. Investigated large generated AIB populations and learned that blind namespace duplication could create broad unwanted behavior.
  718. 7. Inspected Cardata documentation and championship rosters to obtain real vehicle identities.
  719. 8. Disassembled RD2.exe and traced 0x443380 / 0x43D460 / 0x43DA70 / 0x40FD50 / 0x410020 / 0x4106C0 and related descriptor code.
  720. 9. Built the canonical namespace table and verified mixed-family examples such as SC and FM.
  721. 10. Traced the AIB-missing fallback at 0x4106C0 and experimentally changed its value to 999 in RD2_fallback999.exe, confirming fallback behavior can cause overshoot.
  722. 11. Decoded the nested BIGF05 structure inside eas.big and corrected an initial filename-offset mistake.
  723. 12. Created and successfully tested the clean Eastern Creek namespace substitution v2.
  724. 13. Built and successfully tested an additive Adelaide archive with genuinely new AIB entries.
  725. 14. Investigated and corrected failed additive archives caused by wrong offsets, data overlap, and filename-field errors.
  726. 15. Ran a three-way canonical-resource validation across Hockenheim, Eastern Creek, and Adelaide.
  727. 16. Corrected the Pacific Street -> uo assumption using the executable's actual raw/canonical mapping.
  728. 17. Built the champ30 location-priority bulk AIB archive using same-track donors, compatible corner counts, 0.97 speed scaling, and additive 0x800-byte slots.
  729. 18. User sampled roughly a dozen generated combinations with 0 crashes, 0 fallback, and normal AI.
  730. 19. Continued to the randomized champ30 file and created a working AIB/resource build for it; the conversation attachment was later deleted, but the user preserved the working copy.
  731.  
  732. C2- Mistakes and corrections:
  733.  
  734. 1. WRONG: treating the Cardata/championship abbreviation as the AIB namespace.
  735. CORRECTION: use raw CarID -> canonical ID -> 0x40FD50 namespace.
  736.  
  737. 2. WRONG: earlier temporary claim that ca_0 mapped to ex/am/v8.
  738. CORRECTION: ca_0 raw 0xD1 -> canonical 10 -> ko.
  739. ex_0 raw 0x91 -> canonical 6 -> ex.
  740.  
  741. 3. WRONG: predicting Pacific Street -> Hockenheim -> uo.
  742. CORRECTION:
  743. ps_0..2 -> g9
  744. ps_3..5 -> bs
  745. The uo fallback therefore does not invalidate the generator.
  746.  
  747. 4. WRONG: first Eastern Creek v1 filename-field locations.
  748. CORRECTION: actual inner filename fields were at the corrected positions; v2 changed only the two intended bytes.
  749.  
  750. 5. WRONG: treating stored nested-BIG entry offsets as direct physical offsets.
  751. CORRECTION: stored directory offset must be translated through the nested data-base before locating physical payload.
  752.  
  753. 6. WRONG: interpreting Adelaide crashes as proof of unsupported additive AIB insertion.
  754. CORRECTION: crashes were caused by malformed directory/data layout, overlapping data, and related construction errors. A corrected additive build works.
  755.  
  756. 7. WRONG: assuming 59EA10 was the main AIB corner-speed consumer.
  757. CORRECTION: primary downstream driving consumption is around 0x4084FC.
  758.  
  759. 8. WRONG: treating 4104D0 as the definitive corner detector.
  760. CORRECTION: 410930 is the clearer corner indexing routine.
  761.  
  762. 9. WRONG STRATEGY: considering a patched executable or DLL injection as the final delivery mechanism.
  763. CORRECTION: keep executable patching diagnostic-only; native BIG resource insertion is sufficient for the demonstrated AIB route.
  764.  
  765. 10. IMPORTANT LIMITATION: the bulk generator is proven safe/useful, not mathematically proven optimal. Its 0.97 factor is an empirical generation choice.
  766.  
  767. 11. RANDOMIZED-CHAMP30 STATUS CORRECTION:
  768. The randomized-championship AIB was in fact created successfully during the continuation. The generated conversation attachment was later deleted, but the user preserved a working copy. The journal must not describe that work as unfinished or lost.
  769.  
  770. C3- Proven, unproven and disproven facts:
  771.  
  772. PROVEN:
  773. - AIB resource selection uses an executable identity/canonicalization pipeline.
  774. - 0x43D460 parses identity strings into raw IDs.
  775. - 0x43DA70 maps raw IDs to canonical IDs.
  776. - 0x40FD50 maps canonical IDs to AI namespace strings.
  777. - 0x410020 builds track + namespace AIB filenames.
  778. - 0x4106C0 is a central AIB load/setup path.
  779. - Missing AIB resources enter an explicit fallback path using original value 40.
  780. - Changing that fallback to 999 can materially alter AI corner behavior.
  781. - Original AIB byte 10 equals nc for all 529 originals examined.
  782. - Original AIB corner records use the verified [4 zero][speed u16][tag u16] structure.
  783. - AIB corner values are used in later AI driving logic.
  784. - Native AIB resource substitution works in the unmodified executable.
  785. - Native additive AIB insertion works in at least the tested nested BIGF05 case.
  786. - New normal and "_s" AIB resources can be added as separate 0x800-byte-aligned slots.
  787. - The same-track donor + compatible corner count + 0.97 speed scaling recipe produced a bulk archive with 1,126 newly inserted AIB resources.
  788. - Approximately a dozen user tests of the champ30 location-priority bulk archive produced zero crashes and zero fallback cases with normal AI.
  789. - fm_0 -> vc and fm_1 -> bs are executable-derived mappings.
  790. - sc_0..4 -> ko and sc_5..9 -> g4 are executable-derived mappings.
  791. - ca_0 -> ko is executable-derived.
  792. - Pacific Street maps to g9 and bs, not uo.
  793. - Six classes lacked original dedicated AIB/RED/BRP resources but are not therefore unsupported.
  794. - A working AIB/resource build for champ30 (randomized) was created; the user preserved a copy after the conversation attachment was deleted.
  795.  
  796. UNPROVEN:
  797. - Exact physical units of the AIB uint16 corner values.
  798. - Complete closed-form conversion from AIB uint16 to final target speed.
  799. - Whether every generated AIB is competitively optimal on every vehicle/track pair.
  800. - Whether every track's nested BIG has identical internal layout details.
  801. - Exact runtime selection behavior for every possible canonical namespace.
  802. - Whether every BRP/RED/QDR resource is unnecessary in every gameplay situation.
  803. - Exact identity of the higher-level file/object containing the "Name" field parsed around 0x44357E.
  804. - Exact filename, SHA-256, and full inventory details of the preserved randomized working AIB are not recorded in this journal.
  805.  
  806. DISPROVEN / CORRECTED:
  807. - "A class named ca/fm/sc/etc. must have an identically named AIB namespace." Disproved by executable mapping.
  808. - "Fallback is probably irrelevant to driving." Disproved by the 999 fallback test.
  809. - "RD2.exe cannot load newly added AIB entries." Disproved by the successful Adelaide additive archive.
  810. - "Replacing an existing AIB is the only workable native method." Disproved by additive insertion.
  811. - "Adelaide crashes prove the new namespace/resources are unsupported." Disproved; archive construction was at fault.
  812. - "Pacific Street should use uo at Hockenheim." Disproved; ps maps to g9 and bs.
  813. - "59EA10 is the primary AIB speed consumer." Corrected.
  814. - "4104D0 is the definitive corner detector." Corrected.
  815. - "A patched EXE is required for the final solution." Disproved for the demonstrated AIB route.
  816. - "The randomized champ30 AIB work was unfinished/lost." Corrected: a working version was created and preserved by the user, although exact build metadata must be recovered.
  817.  
  818. C4- Step by step instructions to achieve the finished goal:
  819.  
  820. PART I — Determine the requested AIB namespace for a car/class
  821.  
  822. 1. Obtain the exact vehicle/Cardata identity used by the championship entry. Do not stop at the championship name.
  823. 2. Find the corresponding configuration identity string / CarID path used by RD2.
  824. 3. Parse the identity through the executable's logic equivalent to 0x43D460 to obtain the raw/internal ID.
  825. 4. Pass that raw ID through the canonicalization logic of 0x43DA70.
  826. 5. Use the canonical ID in the 0x40FD50 mapping to obtain the AI namespace.
  827. 6. Construct the requested resource names:
  828. <track>_<namespace>.aib
  829. <track>_<namespace>_s.aib
  830. 7. For mixed families, resolve every variant separately. Example:
  831. SC0..4 -> ko
  832. SC5..9 -> g4
  833. FM0 -> vc
  834. FM1 -> bs
  835. 8. Check the original archive for those exact resource names before creating anything.
  836. 9. If the resource exists, do not duplicate or replace it unless a controlled experiment explicitly requires that.
  837.  
  838. PART II — Determine the correct AIB donor
  839.  
  840. 1. Identify the target track's nested BIG archive.
  841. 2. Inventory existing AIBs for that track.
  842. 3. Parse each donor AIB's nc at byte 10.
  843. 4. Prefer a donor with the same corner count as the target geometry.
  844. 5. When multiple donors have the same corner count, prefer a donor whose per-corner shape is representative for the intended vehicle class/performance level.
  845. 6. The practical bulk recipe used the modal/compatible corner-count donor on the same track.
  846. 7. Copy the donor payload exactly as a starting template.
  847. 8. Preserve:
  848. header
  849. nc
  850. corner tags
  851. all non-speed bytes
  852. 9. Modify only the speed uint16 fields when generating the new profile.
  853.  
  854. PART III — Generate the AIB numerical payload
  855.  
  856. For a payload with nc corners:
  857. 1. Read each speed uint16 at:
  858. payload + 0x10 + 8*i
  859. for i = 0 .. nc-1.
  860. 2. Multiply the speed value by 0.97.
  861. 3. Round/clamp to a valid uint16 representation.
  862. 4. Leave the tag bytes and every other payload byte unchanged.
  863. 5. Create the normal payload and duplicate it for the "_s" resource unless a specific experiment has established a different source.
  864. 6. Do not confuse the 0.97 factor with a proven physical formula. It is the empirically successful broad-generation recipe used by this project.
  865.  
  866. PART IV — Add the AIB to the nested BIG
  867.  
  868. 1. Start from the original aib.big or a clean copy of the validated archive baseline.
  869. 2. Locate the target track's nested BIGFxx archive.
  870. 3. Parse:
  871. header
  872. entry count
  873. 24-byte directory records
  874. 12-byte filename fields
  875. stored entry offsets
  876. entry sizes
  877. 4. Preserve all existing entries and payloads.
  878. 5. Increase the entry count by the number of new resources.
  879. 6. Append a new directory record for each:
  880. <track>_<namespace>.aib
  881. <track>_<namespace>_s.aib
  882. 7. Store each filename within exactly 12 bytes; never overflow into adjacent metadata.
  883. 8. Allocate each new payload in a fresh 0x800-byte-aligned slot.
  884. 9. Remember:
  885. stored directory offset != automatically physical payload offset
  886. Use the actual nested BIG data-base to translate directory offset to physical location.
  887. 10. Place the generated payload at that calculated physical position.
  888. 11. Ensure no new slot overlaps:
  889. an existing AIB
  890. an existing AIB_s
  891. RED
  892. AID
  893. or directory data
  894. 12. Update nested archive size so the aligned slots are covered.
  895. 13. If the nested archive grows, shift later outer archive payloads by the exact size delta.
  896. 14. Update the corresponding outer BIG directory offsets for all later shifted entries.
  897. 15. Keep outer entry sizes correct.
  898. 16. Do not modify RD2.exe for the final native resource route.
  899.  
  900. PART V — Binary validation before game testing
  901.  
  902. Check all of the following programmatically:
  903. 1. Outer archive header remains valid.
  904. 2. Nested BIG header remains valid.
  905. 3. Nested entry count matches the number of directory records.
  906. 4. Every filename is correctly encoded and NUL padded within 12 bytes.
  907. 5. Every directory offset resolves to the intended payload.
  908. 6. Every payload begins where expected physically.
  909. 7. Every new payload is inside the nested archive bounds.
  910. 8. Every new payload is in its own 0x800-byte-aligned slot.
  911. 9. No new payload overlaps old payloads.
  912. 10. All old payload bytes remain identical unless deliberately changed.
  913. 11. New AIB byte 10 equals the target track's nc.
  914. 12. The number of corner records matches nc.
  915. 13. The payload length is sufficient for all records.
  916. 14. Outer offsets are structurally consistent after shifts.
  917. 15. Recalculate and store a SHA-256 for the finished archive.
  918. 16. Keep a manifest listing:
  919. target track
  920. target namespace
  921. donor
  922. donor nc
  923. generated nc
  924. scale factor
  925. directory offset
  926. physical offset
  927. payload size
  928. output SHA-256
  929.  
  930. PART VI — In-game validation
  931.  
  932. 1. Use the exact championship/vehicle that should request the resource.
  933. 2. Use the exact target track.
  934. 3. First check for:
  935. crash/no crash
  936. fallback/normal AI
  937. obvious abnormal braking
  938. obvious corner overshoot
  939. 4. Do not infer namespace correctness from behavior alone if the mapping can be derived from the EXE.
  940. 5. When possible, compare against an otherwise identical archive without the new resource.
  941. 6. If the AI is normal and no fallback occurs, record the exact resource name and archive hash.
  942. 7. Sample multiple tracks/classes before scaling up.
  943. 8. Keep known-good archives immutable as regression references.
  944.  
  945. PART VII — Bulk generation for a championship file
  946.  
  947. 1. Parse the championship BIG.
  948. 2. Enumerate every race/track and every vehicle/class actually present.
  949. 3. Resolve every vehicle entry to its canonical AIB namespace using the executable-derived mapping.
  950. 4. Build the required set:
  951. {track, canonical namespace}
  952. 5. Compare against existing native resources.
  953. 6. Remove already-present pairs from the generation set.
  954. 7. For each missing pair, select same-track donor AIB and compatible/modal nc.
  955. 8. Generate normal + "_s" payloads using the proven donor/0.97 procedure.
  956. 9. Add only missing resources.
  957. 10. Produce a manifest.
  958. 11. Binary-validate the complete archive.
  959. 12. Test a representative sample.
  960. 13. Only after a safe sample should the entire missing set be distributed.
  961.  
  962. PART VIII — Randomized champ30 continuation
  963.  
  964. A working randomized-championship AIB was already created during the continuation and the user preserved the copy after the conversation attachment was deleted.
  965.  
  966. Therefore the future workflow is NOT:
  967. start over and generate a randomized AIB blindly.
  968.  
  969. Instead:
  970. 1. Identify the preserved working AIB archive/file.
  971. 2. Record its exact filename and SHA-256.
  972. 3. Inventory its embedded AIB resources.
  973. 4. Compare its structure against the location-priority bulk archive.
  974. 5. Compare the randomized championship's actual track/class/canonical matrix with the archive's resource set.
  975. 6. Only generate or repair genuinely missing resources.
  976. 7. Preserve the user's working copy as the randomized regression baseline.
  977.  
  978. C5- Advice for your future self:
  979.  
  980. Never restart from "which class name should the AIB use?" Start from the executable chain.
  981.  
  982. The permanent mental model is:
  983. physical car / variant
  984. -> configuration identity
  985. -> raw ID
  986. -> canonical ID
  987. -> namespace
  988. -> track AIB filename
  989.  
  990. Treat every failed archive as a construction/debugging signal until binary validation proves the archive itself is correct. In particular, never reuse the old malformed Adelaide builds as templates.
  991.  
  992. Keep the following as immutable regression references:
  993. aib_eastern_creek_vc_test_v2.big
  994. aib_pacific_adelaide_generated_v8_additive_correct.big
  995. aib_champ30_location_priority_bulk_v1.big
  996. and their recorded SHA-256 hashes.
  997. Also preserve the user-held working randomized-championship AIB once its exact filename/hash is recorded.
  998.  
  999. The strongest finished recipe is:
  1000. same-track donor
  1001. + compatible/modal corner count
  1002. + multiply each speed uint16 by 0.97
  1003. + preserve all non-speed bytes
  1004. + create normal + _s
  1005. + add aligned 0x800-byte BIG slots
  1006. + verify nested/outer offsets
  1007. + test the exact canonical namespace
  1008.  
  1009. Do not call the 0.97 rule "the true formula." It is a validated generation heuristic.
  1010.  
  1011. Do not generate RED/BRP/QDR just because they are absent. So far, correct AIB resources are the primary requirement demonstrated by the project. Revisit auxiliary resources only when a controlled test gives a concrete reason.
  1012.  
  1013. Do not erase the distinction between the location-priority and randomized championship variants. The randomized version has a preserved working AIB artifact; identify that artifact before doing further generation.
  1014.  
  1015. Most importantly: preserve the canonical mapping table. That table eliminated the central source of confusion in the project and is the foundation for every future bulk operation.
  1016.  
  1017. ----------------------------------------------
  1018. END FINAL MEMORY JOURNAL
  1019. ----------------------------------------------
Tags: ai journal Memory
Add Comment
Please, Sign In to add comment