Difference between revisions of "Car files"
m (→Car behaviour (car*.res): Table styling) |
|||
Line 17: | Line 17: | ||
The function of a large fraction of car*.res hex addreses was elucidated over the years, allowing modifications of many car aspects. Here is a quick reference for those addresses, adapted from the chart available at [http://www.kalpen.de/luke/4dinfo.html#cs Lukas Loehrer's site]. A more throughout discussion on the effects and quirks of the parameters is available at [[Car parameters]]; clicking on a parameter description will lead to the corresponding entry there. | The function of a large fraction of car*.res hex addreses was elucidated over the years, allowing modifications of many car aspects. Here is a quick reference for those addresses, adapted from the chart available at [http://www.kalpen.de/luke/4dinfo.html#cs Lukas Loehrer's site]. A more throughout discussion on the effects and quirks of the parameters is available at [[Car parameters]]; clicking on a parameter description will lead to the corresponding entry there. | ||
− | {| | + | {| class="wikitable" |
− | |||
− | |||
− | |||
|- | |- | ||
− | + | ! Byte offset !! Function | |
− | |||
|- | |- | ||
− | | | + | | 26h || [[Car_parameters#Number_of_gears|Number of gears]] |
− | | [[Car_parameters# | ||
|- | |- | ||
− | | | + | | 28h-29h || [[Car_parameters#Car_mass|Car mass]] |
− | | [[ | ||
|- | |- | ||
− | | | + | | 2Ah-2Bh || [[Car parameters#Braking effectiveness|Braking effectiveness]] |
− | | [[Car parameters# | ||
|- | |- | ||
− | | | + | | 2Ch-2Dh || [[Car parameters#Idle rpm|Idle rpm]] |
− | | [[Car parameters# | ||
|- | |- | ||
− | | | + | | 2Eh-2Fh || [[Car parameters#Downshift rpm|Downshift rpm (auto transm.)]] |
− | | [[Car parameters# | ||
|- | |- | ||
− | | | + | | 30h-31h || [[Car parameters#Upshift rpm|Upshift rpm (auto transm.)]] |
− | | [[Car parameters# | ||
|- | |- | ||
− | | | + | | 32h-33h || [[Car parameters#Maximum rpm|Maximum rpm]] |
− | | [[Car parameters# | ||
|- | |- | ||
− | | | + | | 37h-41h || [[Car parameters#Gear ratios|Gear ratios (odd offsets)]] |
− | | [[Car parameters# | ||
|- | |- | ||
− | | | + | | 46h-5Ch || [[Car parameters#Shifting knob positions|Shifting knob positions (even offsets)]] |
− | | [[Car parameters# | ||
|- | |- | ||
− | | | + | | 5Dh-5Eh || [[Car parameters#Aerodynamic resistance|Aerodynamic resistance]] |
− | | [[Car parameters# | ||
|- | |- | ||
− | | | + | | 60h-C7h || [[Car parameters#Torque curve|Torque curve]] |
− | | [[Car parameters# | ||
|- | |- | ||
− | | | + | | CAh-CBh || [[Car parameters#Grip|Grip]] |
− | | [[Car parameters# | ||
|- | |- | ||
− | | | + | | F6h-F7h || [[Car parameters#Car height|Car height on cockpit view]] |
− | | [[Car parameters# | ||
|- | |- | ||
− | | | + | | 110h-14Dh || [[Car parameters#Steering wheel dot movement|Steering wheel dot movement]] |
− | | [[Car parameters# | ||
|- | |- | ||
− | | | + | | 14Eh-223h || [[Car parameters#Speedometer needle movement|Speedometer needle movement]] |
− | | [[Car parameters# | ||
|- | |- | ||
− | | | + | | 150h-159h || [[Car parameters#Digital speedometer|Digital speedometer]] |
− | | [[Car parameters# | ||
|- | |- | ||
− | | 32Eh-EOF | + | | 224h-32Dh || [[Car parameters#Rev meter needle movement|Rev meter needle movement]] |
− | | [[Car parameters#Text data|Text data (car selection screen and high score table)]] | + | |- |
+ | | 32Eh-EOF || [[Car parameters#Text data|Text data (car selection screen and high score table)]] | ||
|- | |- | ||
|} | |} |
Revision as of 12:00, 22 April 2008
Stunts cars are made of four different resource files: st*.p3s, stda*.pvs, stdb*.pvs and car*.res ; where the * stands for an arbitrary 4-letter abbreviation shared by files of the same car. All of the car graphics are stored in the .p3s and .pvs files. The car*.res, which is the one of most concern when creating a tuned car, contains numerical and text parameters, including data about car performance.
Graphics files (.p3s/.pvs)
Different aspects of a car's appearance are stored in each of the graphic file:
- st*.p3s - 3d shape resource file that stores the graphical 3D model of the car, including its colour data.
- stda*.p3s - Bitmap resource file that contains the dashboard image, including the shifting stick's base. Movement of tachometer, speedometer and steering wheel dot is controlled by car*.res parameters.
- stdb*.p3s - Bitmap resource file that contains the shifting knob. For the Corvette, it also stores the digital speedometer graphics.
Graphic files of different cars can be mixed freely when constructing a new car (note that the car*.res may require adjustment so that the indicators work properly on a new dashboard). As for modification of the graphics themselves, until recently that was deemed impossible, for the lack of information about the format employed by the developers to compress the vector graphics. This first major obstacle, however, has been sorted out. (see Tools section below)
Car behaviour (car*.res)
All adjustable aspects of a car behaviour are stored in car*.res. Those include both physics data, such as power curves, and visual parameters, like car height in cockpit view or speedometer behaviour. Also, the file also contains the text data displayed at the car selection screen. Data in car*.res may be read and modified by any hex editor, or more conveniently by a specially-designed graphical editor (see the Tools section ahead).
The function of a large fraction of car*.res hex addreses was elucidated over the years, allowing modifications of many car aspects. Here is a quick reference for those addresses, adapted from the chart available at Lukas Loehrer's site. A more throughout discussion on the effects and quirks of the parameters is available at Car parameters; clicking on a parameter description will lead to the corresponding entry there.
Byte offset | Function |
---|---|
26h | Number of gears |
28h-29h | Car mass |
2Ah-2Bh | Braking effectiveness |
2Ch-2Dh | Idle rpm |
2Eh-2Fh | Downshift rpm (auto transm.) |
30h-31h | Upshift rpm (auto transm.) |
32h-33h | Maximum rpm |
37h-41h | Gear ratios (odd offsets) |
46h-5Ch | Shifting knob positions (even offsets) |
5Dh-5Eh | Aerodynamic resistance |
60h-C7h | Torque curve |
CAh-CBh | Grip |
F6h-F7h | Car height on cockpit view |
110h-14Dh | Steering wheel dot movement |
14Eh-223h | Speedometer needle movement |
150h-159h | Digital speedometer |
224h-32Dh | Rev meter needle movement |
32Eh-EOF | Text data (car selection screen and high score table) |
Version compatibility
Cars that use graphic files from Stunts 1.0 do not work properly on 1.1 versions, and vice-versa. Doing so causes a crash in the car selection screen. Although the car*.res files may be exchanged between versions, car performance won't be the same due to the known differences between game versions in that respect.
Tools
The car*.res files can be read and edited by any hex-editor or text editor able to display files in hexadecimal mode - HT and Vim are examples of each case). A more convenient alternative are graphical hex-editors designed especially for Stunts car hacking. Mark Nailwood's Car Blaster, by far the most used of those, has resources such as tags on useful bytes and comparison between cars. Other editors include Caredit and Winedit.
Modified cars are not recognized in the RPL Info tool, also created by Mark Nailwood.
In 2008, dstien created a tool named stunpack to unpack some files of the game. His project is registered here [1] and is still under development, but it looks really promising. the day when we will be able to change car shapes is approaching.