← Home SEEBIE90 DOCS
Download PDF
The GTG Thermal Framework mod is published under the Arma Public License (APL)Example code is free to useSuggestions: Discord to the author

GTG Thermal Framework

Heat that follows the clock Changed

A thermal picture that looks the same at midnight and at noon is wrong. The materials let the engine run its own heat simulation with the game time, and the component picks the window that fits.

In plain wordsThe thermal picture runs with the in-game time: ground cools at night and warms in the sun. The infantry window follows the time of day by itself until the player picks a window.

The simulation settingsChanged

The thermal effect has a simulation of its own: it computes surface temperatures from the sun, the air, the sky and the water. The engine runs it with the game time between a minimum (night) and a maximum (noon, clear sky). Where the numbers come from is decided by one line in the material:

Example code – free to useGTG_ThermalFilter_*.emat (simulation block, the same in all 40)
 SimOverrideValues 0
 SimSunIrradianceMin 0
 SimSunIrradianceMax 1000
 SimTemperatureAirMin 12
 SimTemperatureAirMax 28
 SimTemperatureSkyMin -15
 SimTemperatureSkyMax -15
 SimTemperatureWaterMin -100

With SimOverrideValues 1 the material forces its own numbers on the world, and no scenario can make the thermal picture warmer or colder. Up to version 1.1.0 the framework worked that way. Since 1.2.0 the line is 0: the numbers come from the world, from the temperature and sun overrides of the TimeAndWeatherManagerEntity. The framework writes them on the server at start, from a file, and a Game Master can change the air during the session. The other Sim lines are the old calibration and stay in the file for reference. See Climate per server.

Value in the worldDefaultMeaning
Sun0 / 1000 W/m²Sun at night and at noon. Fixed, the same on every server.
Air12 / 28 °CAir at night and at noon. From the server file, or from the Game Master.
Sky−15 / −15 °CFollows the air: 27 below the air minimum, 43 below the air maximum.

How the defaults were found: a constant sun of 2000 made the ground hotter than 70 degrees; 600 made soldiers impossible to tell from their surroundings; 1000 constant gave grass at 40 and soldiers at 55, right by day and wrong at night. The time-dependent range 0 to 1000 fixed both. Air 12 to 28 is the calibrated look; with other air values the same windows show a warmer or a colder world.

One block, everywhereAll 40 materials carry the same simulation lines. Keep the block identical across a set of your own: changing the window should change only the slice you look at, never the world behind it. And decide once whether your materials take the world’s values (0) or force their own (1). With 1, neither the server file nor the Game Master changes your picture.

The infantry window picks itself

Soldiers are the hardest thing to show: their skin stays at a constant warmth, and their clothes follow the sun. At night mostly heads and hands show; at noon the whole figure. Two windows cover that, and the component chooses between them by the game time, taken from the sunrise and sunset of the world:

Night and morning→Window 2 (17 – 47)→From 4.5 h after sunrise→Window 3 (27 – 57)→From 0.5 h after sunset→Window 2 again
Example code – free to useGTG_SOFLAM_VisionModeComponent.c (excerpt)
protected static const float GTG_INF_WARM_AFTER_SUNRISE = 4.5;	// hours after sunrise from which the ground is warm
protected static const float GTG_INF_WARM_AFTER_SUNSET = 0.5;	// hours after sunset until it counts as cold again
protected static const int GTG_INF_LEVEL_COLD = 2;
protected static const int GTG_INF_LEVEL_WARM = 3;

protected int GTG_InfLevelNow()
{
	ChimeraWorld chimeraWorld = ChimeraWorld.CastFrom(GetGame().GetWorld());
	if (!chimeraWorld)
		return GTG_INF_LEVEL_COLD;

	TimeAndWeatherManagerEntity tm = chimeraWorld.GetTimeAndWeatherManager();
	if (!tm)
		return GTG_INF_LEVEL_COLD;

	float sunrise = 6;
	float sunset = 20;
	tm.GetSunriseHour(sunrise);
	tm.GetSunsetHour(sunset);

	float now = tm.GetTimeOfTheDay();
	if (now >= sunrise + GTG_INF_WARM_AFTER_SUNRISE && now <= sunset + GTG_INF_WARM_AFTER_SUNSET)
		return GTG_INF_LEVEL_WARM;

	return GTG_INF_LEVEL_COLD;
}

The window is “automatic” as long as a display has never had a window chosen by hand: its stored level is -1. While thermal is running, an automatic window follows the clock; if the player turns time forward, the window moves with it. A hand setting (Shift + wheel) ends that for this display. The numbers sit in a few constants at one place.

Time (clear sky)Measured
NightGround under 20; soldiers 25–29, mostly heads and hands
Morning, 09:00Ground still cold; soldiers clearly warmer than the grass
Noon, 12:00Bare soil and sand hot, sand saturated; the whole figure shows
15:00 and 18:00Soldiers white or yellow against purple grass (Ironbow)
Vehicles, engine runningHood about 40–48, exhaust 55–75 and more (engine degrees)
Measure everythingClear and overcast skies differ strongly. The first measurements were all taken in overcast weather and gave a picture that was too cold; the simulation range above was set with both in mind. Measure at night, morning, noon and evening, in clear and in overcast weather before you trust a number.
Example code on this page is free to use in your own projects (credit appreciated). The GTG Thermal Framework mod is published under the Arma Public License (APL). Suggestions: Discord. Arma Reforger / Enfusion are trademarks of Bohemia Interactive.
Impressum · Privacy Policy