Into TheTimecycle I - the fundamental concepts which make up the in-game atmosphere


Are you interested in learning how to create your own server-side weather types? Don't know where to start? This article is a good place to become familiar with how the weather system works. Once you understand how it works in rough lines, you will be able to create your own weather types. This will be covered in the next part.

Table of contents

  1. The timecycle
    • Explanation
  2. Post-processing effects
  3. GTA: UG additions to the system


The timecycle

First of all, everyone knows that the game comes with numerous weather types. These types are hardcoded, and it is not possible to create new ones by simply editing the files. The data these weathers use can however largely be modified in a file named timecyc.dat. Every in-game weather type has a fixed set of parameters for each in-game hour. This is how the data looks in the game files:


Explanation

As you can see, there are a lot of parameters. All of them have to be set for each in-game hour. The columns in timecycle.dat directly correlate to the weather parameters defined here. This detail will be important later. The game uses these hour-based parameters to bilinearly interpolate the data on each frame, thus the the interpolation between weather types is always smooth.


Post-processing effects

The timecycle data isn't the only part of the equation, however. The post-processing effects also play a big role. There's a colour filter which uses the postfx colour parameters from the timecycle file which is drawn over the entirety of the screen. This filter is hardcoded in stock GTA:SA (and a different one is used in other 3D era games). Furthermore, GTA:SA and GTA:VCS both have a radiosity effect, which are also hardcoded. All of this isn't hardcoded in GTA:UG, however. More on this in the next paragraph


GTA: UG additions to the system

GTA: Underground makes numerous modifications to the game code to allow greater control over what you can customize. The introduction of several weather-wide parameters, to be precise. These are assigned in weather.dat for UG's standard weather types. For server-side weathers you'll have to pass these to CreateExtraWeather when creating your server-side weather. These extra parrameters include:

  • Assigning a so-called colour filter type. This type controls which post-processing effects are used when the weather type is applied. See the COLORFILTER_* constants for more info.
  • Setting the weather base type. You use this to tell the game if the weather type is rainy, for example. See the WEATHERTYPE_* constants for more info.
  • Assigning additional effects to your weather such as heat haze, no cloud coverage, etc. See the WEATHERPARAM_FLAG_* constants for more info.
  • Telling the game how to interpret all of the timecycle data. More on this in the next part(s). See the WEATHER_HANDLING_* constants for more info.