Difference between revisions of "Opponent files"

From Stunts Wiki
(→‎Opponent performance: Correctly attributing Opponent Blaster to Robert Riebisch)
Line 46: Line 46:
  
 
In addition to sped, opp?.pre also contains '''path''', a much larger (186 bytes) numerical data resource which function is not yet understood.  
 
In addition to sped, opp?.pre also contains '''path''', a much larger (186 bytes) numerical data resource which function is not yet understood.  
 +
 +
Starting from revision 59, [[stressed]] is able to modify the opponent performance parameters, as well as the other resources in opp?.pre/res .
  
 
[[Category:Modding]]
 
[[Category:Modding]]

Revision as of 00:36, 7 March 2010

Data corresponding to the Stunts opponents is stored by a number of resource files, namely sdosel.pvs and the multiple opp?win.pvs, opp?lose.pvs and opp?.pre. As denoted by their extensions, the opp?.pre files store control parameters and text data, while the .pvs files contain bitmaps. A vanilla installation of Stunts 1.1 uses compressed opp?.pre files, while Stunts 1.0 has them uncompressed, as opp?.res. The contents of each file will be described below, organized by function of the resources.

Opponent selection

All the images used for composing the opponent selection menu are within sdosel.pvs. Bitmap resources opp0 to opp6 are opponent portraits (opp0 is actually the chronometer for the time trial option); scrn and the auxiliary overlay clip form the background. Text for the opponent profiles is sourced from text resources in the opp?.pre (there are six of these, one for each opponent).

Opponent animations

Win/lose animations are made from individual bitmaps in opp?win.pvs or opp?lose.pvs. The bitmap resources are named op01 to op08 - the actual number of frames within a file varies from 3 to 8. The animations are controlled through simple, unstructured resources in opp?.pre named winn and lose. Each byte in these NULL-terminated resources is a numerical index to the op01 ... op08 bitmaps, and the overall sequence is the succession of frames.

Opponent performance

The primary adjustable parameters which determine opponent skills are maximum speeds for different track elements. These parameters are in an unstructured resource within opp?.pre called sped. sped is 15 bytes long for Stunts 1.0 and 16 bytes long for 1.1 . Each byte corresponds to the speed in mph for a track element, as described below:

Byte (in 1.1) Track element Observations
1 - 3 paved, dirt and icy road respectively
4 - 6 paved, dirt and icy small corner respectively
7 - 9 paved, dirt and icy large corner respectively
10 banked corner absent in 1.0
11 bridge
12 slalom
13 cork u/d
14 chicane
15 loop
16 cork l/r

Opponent Blaster, a Robert Riebisch program, allows for edition of sped parameter from Stunts 1.0 opp?.res files. The program can't open compressed opp?.pre files from 1.1 without prior unpacking with stunpack. Even after unpacking, the addition of the banked corner parameter and the reordering of the resource list in the 1.1 files means Opponent Blaster is unable to parse them correctly. In fact, it turns out that 1.0 and 1.1 opponent data files are not interchangeable at all.

In addition to sped, opp?.pre also contains path, a much larger (186 bytes) numerical data resource which function is not yet understood.

Starting from revision 59, stressed is able to modify the opponent performance parameters, as well as the other resources in opp?.pre/res .