Difference between revisions of "Time cycle"

From GTAMods Wiki
Jump to navigation Jump to search
m
Line 1: Line 1:
{{Cleanup-rewrite}}
+
{{Research}}{{TocRight}}The '''timecyc.dat''' [[DAT|data file]] contains the most important settings about the game's appearance. Basicly it stores important information like colors and lightning for different [[hardcoded]] weather situations for almost each time of day. The settings themselfes are constant and build a cycle around the whole day. So the exact name of the setting is ''time cycle''.
  
The '''timecyc.dat''' file contains the information for how to display the sky, weather effects and time of day. It is split into the many sections. There is one line of data per hour in the game, per weather type. In the [[Vice City]] timecyc.dat, there is an extra section at the bottom of the file named "EXTRACOLOURS". These extra colours are used for building interiors, but should function the same.
+
In the [[GTA VC|Vice City]] the <code>timecyc.dat</code> file additionally stores settings for different interior appearances. There are '''24''' of those extra settings in one extra section (internally called '''"EXTRACOLOURS"'''). Each game hour represents one constant setting.
 +
<br><br><br><br>
  
A comment in the <code>timecyc.dat</code> file is preceded by a series of slashes ("//") and they will precede each type of weather, and time of day in the file.
+
== File format ==
 +
{{I|Information about [[GTA_4|GTA IV]] is missing|Some effects need confirmation.}}
 +
A comment in the <code>timecyc.dat</code> 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 3|GTA III]] and ''Vice City'' (representing one for each ingame hour) and a multiple of '''8''' for [[GTA SA|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.
 +
<br><br><br><br>
  
== File Format ==
+
=== Data types ===
The following lists describe format of the timecyc.dat in each game.
+
The file uses the following different data types directly or indirectly on an abstract level inside structures:
  
=== GTA 3 ===
+
* '''INT8/UINT8''' - signed/unsigned 8 bit integer ''(1 byte)''
{{Incomplete}}
+
* '''INT32/UINT32''' - signed/unsigned 32 bit integer ''(4 byte)''
 +
* '''FLOAT''' - single precision floating point number ''(4 byte)''
 +
* '''TColor''' - UINT8[3] ''(3 byte)''
  
=== Vice City ===
+
=== File hierarchy ===
 +
As mentioned above each setting consists out of a constant number of entries seperated by whitespaces. The following table lists the entries and their descriptions in the order they appear:
  
{|{{Prettytable}} class="collapsible"
+
{|{{Prettytable}} width="100%"
!Column Name
+
!width="12px"|{{Icon|3}}
!Data Type
+
!width="12px"|{{Icon|VC}}
 +
!width="12px"|{{Icon|SA}}
 +
!width="20%"|Name
 +
!width="10%"|Data type
 
!Description
 
!Description
 
|-
 
|-
|'''Amb''' ||Color|| Controls amount of ambient color on static map objects, like most buildings, structures and landmasses.
+
|colspan="3"|<center>X</center>||Static ambience color||TColor||The color of ambient light on map objects ''(see [[Item Placement|IPL]])''.
 
|-
 
|-
|'''Amb_Obj''' ||Color|| Controls the amount of ambient light on dynamic objects, like pedestrians and vehicles.
+
|colspan="3"|<center>X</center>||Dynamic ambience color||TColor||The color of ambient light on dynamicly created objects like [[PEDS|pedestriants]] and [[CARS|vehicles]].
 
|-
 
|-
|'''Amb_Bl''' ||Color|| Effect unknown, changing produces no visible results.
+
|colspan="2"|<center>X</center>||<center>&ndash;</center>||Static ambience blur color||TColor||Blurrig color value for static ambience color.
 
|-
 
|-
|'''Amb_Obj_bl''' ||Color|| Effect unknown, changing produces no visible results.
+
|colspan="2"|<center>X</center>||<center>&ndash;</center>||Dynamic ambience blur color||TColor||Blurrig color value for dynamic ambience color.
 
|-
 
|-
|'''Dir''' ||Color|| Controls amount of direct light on pedestrians and vehicles.
+
|colspan="3"|<center>X</center>||Direct light color||TColor||The color of direct light on dynamicly created objects like ''pedestriants'' and ''vehicles''.
 
|-
 
|-
|'''Sky top'''||Color|| Color of the top of the sky.
+
|colspan="3"|<center>X</center>||Sky top color||TColor||The color of the top of the [[wikipedia:Skybox_(video_games)|skysphere]].
 
|-
 
|-
|'''Sky bot'''||Color|| Color of the bottom of the sky.
+
|colspan="3"|<center>X</center>||Sky bottom color||TColor||The color of the bottom of the ''skysphere''.
 
|-
 
|-
|'''SunCore''' ||Color|| Color of the sun's core image.
+
|colspan="3"|<center>X</center>||Sun core color||TColor||The color of the core [[wikipedia:Sprite_(computer_graphics)|sprite]] of the sun.
 
|-
 
|-
|'''SunCorona''' ||Color|| Color of the sun's corona image.
+
|colspan="3"|<center>X</center>||Sun corona color||TColor||The color of the corona ''sprite'' of the sun.
 
|-
 
|-
|'''SunSz''' ||float|| Size of the sun's corona sprite.
+
|colspan="3"|<center>X</center>||Sun core size||FlOAT||The size of the core ''sprite'' of the sun.
 
|-
 
|-
|'''SprSz''' ||float|| Size of the sun's core sprite.
+
|colspan="3"|<center>X</center>||Sun corona size||FLOAT||The size of the corona ''sprite'' of the sun.
 
|-
 
|-
|'''SprBght''' ||float|| How bright sprites will be.
+
|colspan="3"|<center>X</center>||Sprite brightness||FLOAT||The the brightness of the above mentioned ''sprites''.
 
|-
 
|-
|'''Shdw''' ||integer|| Intensity of pedestrian, vehicle, and lamp shadows. 0 is transparent, 100 seems to be about "normal", and values past that make the shadow darker and darker. 500 will produce almost pure black shadows.
+
|colspan="3"|<center>X</center>||Shadow intensity||INT32||The intensity of the shadows of objects like ''pedestriants'', ''vehicles'' or poles.
 
|-
 
|-
|'''LightShd''' ||integer|| The cast light alpha on traffic signals and lampposts. changing produces no visible results.
+
|colspan="3"|<center>X</center>||Light shading value||INT32||Value used [[wikipedia:Shading|shading algorithm]] of ''pedestirants'' and ''vehicles''.
 
|-
 
|-
|'''PoleShd''' ||integer|| Lamppost shadow alpha. changing produces no visible results.
+
|colspan="3"|<center>X</center>||Pole shading value||INT32||''Shading'' value for map objects with [[Ide#IDE_Flags|flag 32768]].
 
|-
 
|-
|'''FarClp''' ||float|| The clipping plane that limits maximum visibility. Setting the value to a smaller number produces a short visibility range, wheras larger numbers mean you can see further. If the number is set too low (i tried 20.0), the game will get glitchy, and may not load textures! The average value for this entry is 2000.0 and most of the map is visible with this value.
+
|colspan="3"|<center>X</center>||Far clipping offset||FLOAT||The distance of the [[wikipedia:Clipping_(computer_graphics)|far clipping plane]] from the camera.  
 
|-
 
|-
|'''FogSt''' ||float|| Fog start position relative to camera? Negatives allowed. Untested.
+
|colspan="3"|<center>X</center>||Fog start offset||FLOAT||The range of the distance fog from the camera.  
 
|-
 
|-
|'''LightOnGround''' ||float|| Effect unknown, changing produces no visible results.
+
|colspan="3"|<center>X</center>||Light on ground||FLOAT||Amount of light on the ground of the sea ''(?)''.
 
|-
 
|-
|'''LowCloudsRGB''' ||Color|| Sets colour for low thin clouds.  Untested.
+
|colspan="3"|<center>X</center>||Lower clouds color||TColor||Color of the lower clounds.
 
|-
 
|-
|'''TopCloudRGB''' ||Color|| Sets colour for topside of large clouds. Untested.
+
|colspan="2"|<center>X</center>||<center>&ndash;</center>||Upper clouds top color||TColor||Color of the top of the upper clouds.
 
|-
 
|-
|'''BottomCloudRGB''' ||Color|| Sets colour for underside of large clouds. Untested.
+
|colspan="3"|<center>X</center>||Upper clouds bottom color||TColor||Color of the bottom of the upper clouds.
 
|-
 
|-
|'''BlurRGB''' ||Color|| RGB values for Trails. If you have not somehow enabled trails on your game, then the values will not be noticable. 0 for no trails, 255 for a pure white screen. If your going to change them, follow the pattern R* set with their setup, as a little bit goes a very long way.
+
|colspan="2"|<center>X</center>||<center>&ndash;</center>||Blur color||TColor||The color of trails.
 
|-
 
|-
|'''WaterRGBA''' ||Color|| Controls the color of the water. On the pc version of the game, the water texture is greenish-blue. It needs to be converted to grayscale to fully see the effect of changing the water color in the timecyc.dat, as the colors defined in this file, are multiplied by the water texture color ingame. The last part of RGBA, the A, is the alpha channel and it controls the level of transparency for the water. 0, will make the water totally transparent, while 255 will make the water as opaque as the game will allow.
+
|colspan="3"|<center>X</center>||Water color||TColor||Color of the water vertices.
|}
 
 
 
=== San Andreas ===
 
In [[San Andreas]] the format is nearly the same, but some of the sections are left out.
 
 
 
{|{{Prettytable}} class="collapsible"
 
!Column Name
 
!Data Type
 
!Description
 
 
|-
 
|-
|'''Amb''' ||Color|| Controls amount of ambient color on static map objects, like most buildings, structures and landmasses.
+
|colspan="3"|<center>X</center>||Water alpha level||UINT8||Alpha level for water vertices.
 
|-
 
|-
|'''Amb_Obj''' ||Color|| Controls the amount of ambient light on dynamic objects, like pedestrians and vehicles.
+
|colspan="2"|<center>&ndash;</center>||<center>X</center>||Color correction 1 alpha||UINT8||Alpha level for first color correction value.
 
|-
 
|-
|'''Dir''' ||Color|| Controls amount of direct light on pedestrians and vehicles.
+
|colspan="2"|<center>&ndash;</center>||<center>X</center>||Color correction 1||TColor||First color correction value.
 
|-
 
|-
|'''Sky top'''||Color|| Color of the top of the sky's gradient.
+
|colspan="2"|<center>&ndash;</center>||<center>X</center>||Color correction 2 alpha||UINT8||Alpha level for second color correction value.
 
|-
 
|-
|'''Sky bot'''||Color|| Color of the bottom of the sky's gradient.
+
|colspan="2"|<center>&ndash;</center>||<center>X</center>||Color correction 2||TColor||Second color correction value.
 
|-
 
|-
|'''SunCore''' ||Color|| Color of the sun's core image.
+
|colspan="2"|<center>&ndash;</center>||<center>X</center>||Lower clouds alpha level||UINT8||Alpha level for lower clouds.
 
|-
 
|-
|'''SunCorona''' ||Color|| Color of the sun's corona image.
+
|colspan="2"|<center>&ndash;</center>||<center>X</center>||Upper clouds alpha level||UINT8||Alpha level for upper clouds.
 
|-
 
|-
|'''SunSz''' ||float|| Size of the sun's corona sprite.
+
|colspan="2"|<center>&ndash;</center>||<center>X</center>||Unused clouds alpha level||UINT8||Usually 0.
|-
 
|'''SprSz''' ||float|| Size of the sun's core sprite.
 
|-
 
|'''SprBght''' ||float|| How bright sprites will be.
 
|-
 
|'''Shdw''' ||integer|| Intensity of pedestrian, vehicle, and lamp shadows. 0 is transparent, 100 seems to be about "normal", and values past that make the shadow darker and darker. 500 will produce almost pure black shadows.
 
|-
 
|'''LightShd''' ||integer|| The cast light alpha on traffic signals and lampposts. changing produces no visible results.
 
|-
 
|'''PoleShd''' ||integer|| Lamppost shadow alpha. changing produces no visible results.
 
|-
 
|'''FarClp''' ||float|| The clipping plane that limits maximum visibility. Setting the value to a smaller number produces a short visibility range, wheras larger numbers mean you can see further. If the number is set too low (i tried 20.0), the game will get glitchy, and may not load textures! The average value for this entry is 2000.0 high numbers can cause draw distance problems.
 
|-
 
|'''FogSt''' ||float|| Fog start position relative to camera. Negatives allowed. High numbers can cause draw distance problems
 
|-
 
|'''LightOnGround''' ||float|| Effect unknown, changing produces no visible results.
 
|-
 
|'''LowCloudsRGB''' ||Color|| Sets colour for low thin clouds.  Untested.
 
|-
 
|'''BottomCloudRGB''' ||Color|| Sets colour for underside of large clouds. Untested.
 
|-
 
|'''WaterRGBA''' ||Color|| Controls the color of the water. This value multiplies the texture's color and the last value 'A' is the alpha: 0, will make the water totally transparent, while 255 will make the water as opaque as the game will allow.
 
|-
 
|'''Alpha1''' ||integer|| Alpha for RGB1.
 
|-
 
|'''RGB1''' ||Color|| Color correction 1
 
|-
 
|'''Alpha2''' ||integer|| Alpha for RGB2 value
 
|-
 
|'''RGB2''' ||Color|| Color correction 2
 
|-
 
|'''CloudAlpha''' ||Color|| Defines alpha level of the clouds:<br>0 - no clouds<br>255 - opaque clouds.
 
 
|}
 
|}
 
=== GTA 4 ===
 
{{Incomplete}}
 
  
 
== Tools ==
 
== Tools ==
Line 129: Line 95:
 
* [[G-Tools#G-CYC|G-CYC]]
 
* [[G-Tools#G-CYC|G-CYC]]
  
== External Link ==
+
== External links ==
{{GTAF|255093|Modding timecyc.dat for Vice City}}
+
* {{GTAF|255093|Modding timecyc.dat for Vice City}}
  
{{N|4|SA}}
+
{{N|4|SA|VC}}
[[Category:Map Formats]][[Category:GTA 3]][[Category:GTA VC]]
+
[[Category:Map Formats]][[Category:GTA 3]]

Revision as of 09:41, 24 September 2010

The timecyc.dat data file contains the most important settings about the game's appearance. Basicly it stores important information like colors and lightning for different hardcoded weather situations for almost each time of day. The settings themselfes are constant and build a cycle around the whole day. So the exact name of the setting is time cycle.

In the Vice City the timecyc.dat file additionally stores settings for different interior appearances. There are 24 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] (3 byte)

File hierarchy

As mentioned above each setting consists out of a constant number of entries seperated by whitespaces. The following table lists the entries and their descriptions in the order they appear:

GTA III Vice City San Andreas 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 dynamicly created objects like pedestriants 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.
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 shading algorithm of 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
Upper clouds alpha level UINT8 Alpha level for upper clouds.
X
Unused clouds alpha level UINT8 Usually 0.

Tools

External links