Difference between revisions of "Time cycle"
(→timecyc.dat and timecycp.dat) |
|||
Line 92: | Line 92: | ||
=== timecyc.dat and timecycp.dat === | === timecyc.dat and timecycp.dat === | ||
− | The PS2, PC and Xbox versions of San Andreas ship two time cycle files: <code>timecyc.dat</code> and <code>timecycp.dat</code>. | + | The PS2, PC and Xbox versions of San Andreas ship two time cycle files: <code>timecyc.dat</code> and <code>timecycp.dat</code>. |
+ | Both console games ship with the same two files and load <code>timecyc.dat</code> in the NTSC version and <code>timecycp.dat</code> in the PAL version. The PC and mobile port load <code>timecyc.dat</code>, which is different from the PS2/Xbox file. The PC port also ships the console PAL file but does not load it. The difference between the console NTSC and PAL files are minute, only a single color is actually different and it's not clear why R* distinguishes the video modes at all. | ||
− | Another difference in the PC <code>timecyc.dat</code> are the postfx alpha values. It's the only file that uses the standard alpha range (255 = opaque), while all other files use the PS2 alpha range (128 = opaque). To convert from the PS2 to standard range, all games (except the PS2 game naturally) double those alpha values after reading them. This can be considered a bug in the PC and mobile games as the alpha values already are in standard range. | + | The PC <code>timecyc.dat</code> on the other hand differs more and is actually broken in three ways: RAINY_COUNTRYSIDE 8PM starts with '255' instead of '22 22 22' which causes the whole line to be parsed incorrectly. Furthermore the last column (directionalMult) is missing in all lines and consequently interpreted as zero. This causes the main directional light (normally used on peds and vehicles) to be effectively turned off. It is unclear whether this is intentional, but as a substitute for the disabled dynamic directional light a hardcoded fixed light that doesn't change color is used for vehicle rendering. If the directional multiplier is set to 1.0, vehicles will then become too bright and in addition the vehicle light will cause problems because it overrides D3D light 0 (this has been fixed in [[Fixes and restorations|SilentPatch]]). |
+ | |||
+ | Another difference in the PC/mobile <code>timecyc.dat</code> are the postfx alpha values. It's the only file that uses the standard alpha range (255 = opaque), while all other files use the PS2 alpha range (128 = opaque). To convert from the PS2 to standard range, all games (except the PS2 game naturally) double those alpha values after reading them. This can be considered a bug in the PC and mobile games as the alpha values already are in standard range. | ||
In conclusion, all games expect a PS2 <code>timecyc(p).dat</code> file, so it's not recommended to use the PC <code>timecyc.dat</code> file at all. | In conclusion, all games expect a PS2 <code>timecyc(p).dat</code> file, so it's not recommended to use the PC <code>timecyc.dat</code> file at all. |
Revision as of 10:24, 20 August 2017
Article issues | |||
---|---|---|---|
|
The timecyc.dat data file contains the most important settings about the game's appearance. Basically it stores important information like colors and lighting for different hardcoded weather situations for each time of day. The settings themselves are constant and build a cycle around the whole day. So the exact name of the setting is time cycle.
In Vice City the timecyc.dat
file additionally stores settings for different interior appearances. There are 23 of those extra settings in one extra section (internally called "EXTRACOLOURS"). Each game hour represents one constant setting.
File format
A comment in the timecyc.dat
file is preceded by a series of slashes ("//"). The game's parser simply ignores comments so that the number of uncommented lines must be a multiple of 24 for GTA III and Vice City (representing one for each ingame hour) and a multiple of 8 for San Andreas (representing 00am, 05am, 06am, 07am, 00pm, 07pm, 08pm and 10pm in the order they appear). Each value of one entry gets interpolated with the previous and the next setting of the current ingame weather.
Data types
The file uses the following different data types directly or indirectly on an abstract level inside structures:
- INT8/UINT8 - signed/unsigned 8 bit integer (1 byte)
- INT32/UINT32 - signed/unsigned 32 bit integer (4 byte)
- FLOAT - single precision floating point number (4 byte)
- TColor - UINT8[3] representing the red, green and blue level (in the order they appear) of a color. (3 byte)
File hierarchy
As mentioned above each setting consists out of a constant number of entries separated by whitespaces. The following table lists the entries and their descriptions in the order they appear:
Name | Data type | Description | |||
---|---|---|---|---|---|
X | Static ambience color | TColor | The color of ambient light on map objects (see IPL). | ||
X | Dynamic ambience color | TColor | The color of ambient light on dynamically created objects like pedestrians and vehicles. | ||
X | – | Static ambience blur color | TColor | Blurrig color value for static ambience color. | |
X | – | Dynamic ambience blur color | TColor | Blurrig color value for dynamic ambience color. | |
X | Direct light color | TColor | The color of direct light on dynamicly created objects like pedestriants and vehicles. Present in the timecyc.dat of GTA SA, but not loaded and unused by the game. | ||
X | Sky top color | TColor | The color of the top of the skysphere. | ||
X | Sky bottom color | TColor | The color of the bottom of the skysphere. | ||
X | Sun core color | TColor | The color of the core sprite of the sun. | ||
X | Sun corona color | TColor | The color of the corona sprite of the sun. | ||
X | Sun core size | FLOAT | The size of the core sprite of the sun. | ||
X | Sun corona size | FLOAT | The size of the corona sprite of the sun. | ||
X | Sprite brightness | FLOAT | The the brightness of the above mentioned sprites. | ||
X | Shadow intensity | INT32 | The intensity of the shadows of objects like pedestriants, vehicles or poles. | ||
X | Light shading value | INT32 | Value used for the shading algorithm on pedestirants and vehicles [?]. | ||
X | Pole shading value | INT32 | Shading value for map objects with flag 32768. | ||
X | Far clipping offset | FLOAT | The distance of the far clipping plane from the camera. | ||
X | Fog start offset | FLOAT | The range of the distance fog from the camera. | ||
X | Light on ground | FLOAT | Amount of light on the ground of the sea [?]. | ||
X | Lower clouds color | TColor | Color of the lower clounds. | ||
X | – | Upper clouds top color | TColor | Color of the top of the upper clouds. | |
X | Upper clouds bottom color | TColor | Color of the bottom of the upper clouds. | ||
X | – | Blur color | TColor | The color of trails. | |
X | Water color | TColor | Color of the water vertices. | ||
X | Water alpha level | UINT8 | Alpha level for water vertices. | ||
– | X | Color correction 1 alpha | UINT8 | Alpha level for first color correction value. | |
– | X | Color correction 1 | TColor | First color correction value. | |
– | X | Color correction 2 alpha | UINT8 | Alpha level for second color correction value. | |
– | X | Color correction 2 | TColor | Second color correction value. | |
– | X | Lower clouds alpha level | UINT8 | Alpha level for lower clouds. | |
– | X | Highlight min intensity | UINT8 | Intensity limit for PS2 radiosity effect. | |
– | X | Water fog alpha. | UINT8 | Water fading to white, amount of white light on water. Usually 0. | |
– | X | Directional multiplier | FLOAT | Multiplier for the main directional light. Always 1.0, but missing in PC timecyc.dat |
timecyc.dat and timecycp.dat
The PS2, PC and Xbox versions of San Andreas ship two time cycle files: timecyc.dat
and timecycp.dat
.
Both console games ship with the same two files and load timecyc.dat
in the NTSC version and timecycp.dat
in the PAL version. The PC and mobile port load timecyc.dat
, which is different from the PS2/Xbox file. The PC port also ships the console PAL file but does not load it. The difference between the console NTSC and PAL files are minute, only a single color is actually different and it's not clear why R* distinguishes the video modes at all.
The PC timecyc.dat
on the other hand differs more and is actually broken in three ways: RAINY_COUNTRYSIDE 8PM starts with '255' instead of '22 22 22' which causes the whole line to be parsed incorrectly. Furthermore the last column (directionalMult) is missing in all lines and consequently interpreted as zero. This causes the main directional light (normally used on peds and vehicles) to be effectively turned off. It is unclear whether this is intentional, but as a substitute for the disabled dynamic directional light a hardcoded fixed light that doesn't change color is used for vehicle rendering. If the directional multiplier is set to 1.0, vehicles will then become too bright and in addition the vehicle light will cause problems because it overrides D3D light 0 (this has been fixed in SilentPatch).
Another difference in the PC/mobile timecyc.dat
are the postfx alpha values. It's the only file that uses the standard alpha range (255 = opaque), while all other files use the PS2 alpha range (128 = opaque). To convert from the PS2 to standard range, all games (except the PS2 game naturally) double those alpha values after reading them. This can be considered a bug in the PC and mobile games as the alpha values already are in standard range.
In conclusion, all games expect a PS2 timecyc(p).dat
file, so it's not recommended to use the PC timecyc.dat
file at all.
Weather types
GTA III
Type | Enum | Image |
---|---|---|
0 | WEATHER_SUNNY | |
1 | WEATHER_CLOUDY | |
2 | WEATHER_RAINY | |
3 | WEATHER_FOGGY |
Vice City
Type | Enum | Image |
---|---|---|
0 | WEATHER_SUNNY | |
1 | WEATHER_CLOUDY | |
2 | WEATHER_RAINY | |
3 | WEATHER_FOGGY | |
4 | WEATHER_EXTRA_SUNNY | |
5 | WEATHER_HURRICANE | |
6 | WEATHER_EXTRA_COLOURS |
San Andreas | Liberty City Stories | Vice City Stories | GTA V | ||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
This section is incomplete. You can help by fixing and expanding it.
Weather lists
Weather is actually not random in GTA 3D Trilogy. Every game hour, the games go through the list of weather types to determine the upcoming weather.
GTA III
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 01 02 02 01 00 00 00 01 03 03 01 00 00 01 01 00 00 00 00 00 00 00 00 01 01 02 02 01 02 01 00 00 00 00 00 00 00 00 00 00 03 03 00 00 00 02 01
This array for v1.0 starts at 0x5FFBC8 in memory.
Vice City
No hurricane
04 04 04 04 04 04 04 04 00 00 00 04 04 04 00 00 00 04 04 04 04 00 00 04 04 04 04 04 04 04 04 04 04 04 00 00 00 00 00 00 00 00 00 01 02 02 02 02 01 00 00 00 00 04 04 04 04 04 04 04 04 04 04 04
This array for v1.0 starts at 0x699EE4 in memory.
Hurricane
04 04 04 04 04 04 04 04 00 00 00 04 04 04 00 00 00 04 04 01 05 05 01 00 04 04 04 04 04 04 04 04 04 04 00 00 00 00 00 00 00 00 00 00 01 05 05 05 01 00 00 00 00 04 04 04 04 04 04 04 04 04 04 04
This array for v1.0 starts at 0x699F64 in memory.
San Andreas
In San Andreas the map is divided into weather regions whose boundaries are hardcoded. These regions roughly cover major game cities and countryside locations. Each weather region has its own set of unique weathers listed below.
Countryside
13 13 13 13 13 13 13 13 14 15 09 09 15 14 13 14 14 13 13 13 13 14 14 13 13 13 13 13 13 13 13 13 13 13 14 14 14 14 14 14 15 09 09 15 16 16 16 16 15 14 14 14 14 13 13 13 13 13 13 13 13 13 13 13
This array for v1.0 starts at 0x8D5EB0 in memory.
Los Santos
02 02 00 00 00 02 02 02 03 00 03 02 00 00 03 03 03 04 04 00 00 01 01 00 02 02 02 02 02 02 02 02 02 02 03 03 03 03 03 03 02 02 03 03 00 00 16 00 04 01 01 01 01 00 00 02 02 02 02 02 02 02 02 02
This array for v1.0 starts at 0x8D5EF0 in memory.
San Fierro
05 05 05 05 05 07 07 09 09 07 05 05 05 05 05 07 07 07 08 08 07 07 05 05 05 05 06 06 05 07 09 09 07 05 05 07 05 05 06 06 05 05 05 07 07 08 08 07 07 09 09 05 05 06 06 06 05 05 06 07 07 06 06 05
This array for v1.0 starts at 0x8D5F30 in memory.
Las Venturas
11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 10 10 10 10 10 11 11 11 11 11 11 11 11 11 10 11 11 11 11 10 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 10 10 12 12 10 12 10 10
This array for v1.0 starts at 0x8D5F70 in memory.
Bone County
17 17 17 19 19 17 17 17 17 17 17 17 17 17 17 17 17 17 17 18 18 18 18 18 17 17 17 17 17 17 17 17 17 17 17 17 17 19 19 19 17 17 17 17 17 17 17 17 17 17 18 18 18 17 17 17 17 17 17 17 19 19 19 17
This array for v1.0 starts at 0x8D5FB0 in memory.
Liberty City Stories
00 04 00 01 01 00 00 00 04 04 00 02 00 00 01 01 03 01 00 00 00 01 02 03 01 01 00 04 00 00 01 03 02 03 01 00 00 01 05 01 00 04 04 00 00 00 00 04 00 00 01 03 01 00 01 01 00 04 01 05 01 00 00 04
Mission script
01B5 | forces the upcoming weather type | |
01B6 | forces the weather type immediately | |
01B7 | releases the forced weather type | |
0251 | stores the weather state | |
0252 | restores the weather state | |
04F9 | sets the extra colors | |
04FA | clears the extra colors | |
057C | allows hurricane weather |
Tools
External links
- GTAForums: Modding timecyc.dat for Vice City
Grand Theft Auto IV | |
---|---|
File Formats | .dat • .gxt • .ide • .img • .ipl • .nod • .sco • .rpf • .rrr • .wad • .wbd/.wbn • .wdd • .wdr • .wft • .whm • .wpl • .wtd |
Documentation | Audio • Bink Video • Cryptography • Cutscenes • GXT Text • Image listing • Keycodes • Map Listing • Native functions • Paths • Radar Blips • Radio Stations • Saves • Scenarios • VTable • Weapons |
Tools | ASI Loader • ENBSeries • G-Texture • GIMS IV • Ingame WPL Editor • IV Needle • OpenIV • SparkIV • XLiveLess • WPL Manager • X Mod Installer Alice • C++ Script Hook • .NET Script Hook • Scocl |
Tutorials | Importing Textures with OpenIV • Importing Textures with SparkIV |
Modifications | GTA Connected • Gostown IV • Four Multiplayer • IV Multiplayer • CitizenMP:IV Reloaded |
Useful links | Community portal • Discussion forums • Modding forums • Mods on GTAGarage.com |