Ace Combat 3: Skies

Let’s have a look at the skies in Ace Combat 3.

Skyboxes

Each mission comes as a packed archive (ULZ-compressed). Files in that archive can either be files, or other archives. The result is some kind of hierarchical file system.

The very first file in each mission describes the sky. It contains several colors:

The exact definition is:

// PlayStation color; “x” unused
struct PSXRGB {
	uint8_t r, g, b, x;
};

// Little Endian!
struct SkyboxFile {
	uint8_t  unknownA[4];
	PSXRGB   groundColor;
	PSXRGB   horizonColor;
	uint32_t unknownB;
	uint32_t unknownC;
	PSXRGB   skyColor1; // slightly above horizon
	PSXRGB   skyColor2;
	PSXRGB   zenithColor;
	uint32_t unknownD;
	PSXRGB   sunColor;
	PSXRGB   ambientColor;
};

The color values can be used to build a skybox. The angles relative to zenith seem to be:

Note that AC3, for vertices close to the Sun, mixes the Sun color into the sky color at 80°. This makes the east sky appear red during sunsets. I don’t know where the game gets the sun position from.

Also interesting: The ground color starts below the horizon, because otherwise AC3’s short draw distance couldn’t cover it with terrain.

One of Ace Combat 3’s skyboxes.

It’s hard to reproduce the color gradients exactly, as they depend heavily on the PSX’s blending and gamma curve. The conversion of PSXRGB to sRGB and proper interpolation could probably fill another article. But these are pretty close for all Japanese missions:

All skyboxes from the Japanese version of Ace Combat 3.

Clouds

Clouds and sun flares are stored as textures and blended onto the skybox. The according TIM files can be found in the 15ᵗʰ archive of the mission.

Contrast is pretty low. We can assume that they are placed on billboards and rendered with additive blending over the sky. (The PlayStation does not support other blending modes that could be useful here.)

Textures for clouds and sun flares

Exceptions to the Rule

All missions have the files mentioned above, but not all actually make use of them. Electrosphere and the space mission Zero Gravity are good examples: There is no sky in outer space!

In this case, the game uses hard-coded special effects instead.

If these two missions used their skyboxes instead, their background would be hazy with a red horizon towards the sun!

The unused skybox for the “Electrosphere” mission.

Mystery Data

The skybox file contains more data. I’m not sure what it is, but it could be vertex positions for the actual polygons of the skybox. Or vectors for the position of Sun/Moon.

It could also be stars. Ace Combat 3 does have stars in its skies. Just a few during dusk/dawn, but many at night. However, I don’t know if these are stored per mission, or hard-coded in the executable.

I will have a look some time later!