Results 1 to 5 of 5

Thread: Changing Battle Light Conditions

  1. #1

    Default Changing Battle Light Conditions

    I'm not really an expert here, but I would like to share all I have learnt before I forgot it.
    Sorry me if I don't use the right words when trying to describe the effect of each value. I would be glad if other people correct me.


    0.Related Files
    \data\descr_battle_map_lighting_and_fog_control.txt
    \data\descr_daytypes.txt
    \data\descr_skydome.txt
    \data\descr_solar_system.txt
    \data\descr_pallete.txt


    1.descr_battle_map_lighting_and_fog_control.txt
    BI has additional lines in this file not present in RTW nor ATW. But I have verified they work for ATW.

    Lighting
    Only affects the landscape, not the units.

    -min_light_intensity: This is the darkness of the shadows, and the main reason I have wrotten this tutorial.
    I'm almost sure this is a minimum (not a multiplier), so by increasing it, your are removing (not reducing) the shadow effects when the light is under that value.
    Vanilla value is 1.0 and so they have dissabled completely the shadowing of the landscape... I can't understand it.
    Most mods uses values between 0.7 and 1.0, and I think it really improves the battlemap aspect, but only for morning sunlight.
    If you want to see full shadowing at evening, sunset or sunrise, I suggest to reduce it to at least 0.4. But no less than 0.2 if you want to see something at night.

    The problem with this value is that it reduces the lighting for all the enviroment, and there is no way, at least I have not found it, to increase the brightness of the enviroment. Even when there are hundreds of ways to reduce it.

    -max_light_intensity: this one is the opposite to previous one, it controls the brightness of light zones.
    Be carefull with high values greater than 1.5, because fog at day could look like ufos coming.

    Between those 2 values, it seems you can control the contrast of the enviroment.

    Screens using vanilla daytypes, at sunset/sunrise, just changing min_light_intensity=0.2. Enviroment textures and vegetation are from vanilla RTW (with The_Lordz NTW2 skies, Prometheus grass, and resized vegetation).


    Same values at evening/morning: min_light_intensity=0.2.


    Same values this time at middle day: min_light_intensity=0.2.



    -ambient_reduce_proportion: Values starting by "ambient" seems to affect only the sunlight modifications defined in the files: \data\descr_daytypes.txt and \data\descr_skydome.txt.
    It seems this one changes the light reduction in the shadowed areas, but I'm not sure. The effect over the landscape is minimal.
    If your daytype reduces the sun light, this "ambient" value seems to multiply this effect.

    -ambient_color_increase_proportion: It is a multiplier to each color component (RGB). I guess it just multiplies the corresponding RGB value defined in daytypes and skydome.


    Unit Lighting
    Same values than the landscape lighting, this time only for units. If the values are too different to those in the landscape, then the units do not seem placed there. But I think it is important for gameplay that units are always more bright than the enviroment.

    -unit_ambient_reduce_proportion: This effect is more clear in the units than the landscape. Increase it if you want the units darker in the side where they do not receive sunlight.
    -unit_ambient_multiplier and unit_diffuse_multiplier: I have always used the same value for both, like vanilla rtw.
    It seems they affect how much the unit is iluminated in the side they receives the sun light. Increase it if you want units shining from sun side, very obvious compared to the other side.

    Fog
    -enable_gloom: This enables the gloom effect of the fog. I like more the visual aspect with this option dissabled (this line removed), or at least reducing his effect in the line:
    gloom_fog_exponential 0.005 to 0.002 or lower.

    -I have not modified the other values, but there is at least one value very important when you are designing your "daytypes":
    Code:
    haze_to_fog_transition_exponential			0.0004
    When the fog value defined in descr_daytypes.txt is higher than that (no matter if you defined it for a foggy or a clear day), then:
    -If at day, the sky clouds are not used, and replaced by a grey sky
    -If at night, there are no starts, but a black sky, and the fog is black so it can simulate perfectly the darkness of the night.

    I have found this weatherevent to be the most realistic way to create a night battle, copied from the file
    descr_daytypes.txt:
    Code:
    weatherevent night_fog
    		cloud			heavy	;not used due to fog value
    		precipitate		none		;can be enabled without affecting the light conditions
    		wind			calm		;I think not used unless raining
    		fog				light		0.0006	;the "light" word do not sems to have much effect, the numeric values is the importatn one: the fog density
    Of course, you need values of "min_light_intensity" lower than 0.5 for it to look dark (darker the less this value). And you can control the reduction of the light with the distance, by increasing the fog value in the weatherevent (fog value = ammount of black gloom).

    First screen using min_light_intensity=0.4 and fog=0.0008 (no sky). Second one using min_light_intensity=0.4 and fog=0.0002 (sky with clouds)


    Same night lighting, this time with torches:


    Rome TW landscapes were the bigger dissapointment when I upgraded my computer and I played with full graphics for first time. And now, I have seen it is not the engine, nor even the textures, but the lack of shadows what make it so dissapointing.
    I would like to know if other people also see these changes as an improvement, so I share here my current file in case you want to test it and comment it here . Note most of the values are the same than vanilla.

    Spoiler Alert, click show to read: 
    Code:
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;
    ; general
    ;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    ;enable_gloom
    
    sun_below_horizon_night_lighting_out		-7.0
    sun_below_horizon_night_lighting_full		2.0
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;
    ; lighting
    ;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    min_light_intensity							0.4
    max_light_intensity							1.4
    ambient_reduce_proportion					0.75
    ambient_red_increase_proportion				0.25
    ambient_green_increase_proportion			0.25
    ambient_blue_increase_proportion			0.5
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;
    ; unit lighting
    ;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    unit_min_light_intensity					0.9
    unit_max_light_intensity					1.4
    unit_ambient_reduce_proportion					0.25
    unit_ambient_red_increase_proportion		0.25
    unit_ambient_green_increase_proportion		0.25
    unit_ambient_blue_increase_proportion		0.5
    unit_ambient_multiplier							1.1
    unit_diffuse_multiplier							1.1
    
    unit_night_min_light_intensity					0.8
    unit_night_max_light_intensity					1.3
    unit_night_ambient_reduce_proportion			0.25
    unit_night_ambient_red_increase_proportion		0.30
    unit_night_ambient_green_increase_proportion	0.30
    unit_night_ambient_blue_increase_proportion		0.35
    unit_night_ambient_multiplier					1.1
    unit_night_diffuse_multiplier					1.1
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;
    ; fog
    ;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    settlement_exponential_modifier				0.0002			
    camera_height_exponential_modifier			-0.00025		
    camera_exponential_modifier_max_height		100.0
    min_fog_exponential							0.00015
    min_fog_intensity							0.0
    haze_to_fog_transition_exponential			0.0004
    haze_to_fog_transition_exponential_range	0.00005
    gloom_fog_exponential						0.005
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


    2.descr_daytypes.txt
    This file already includes a detailed description of each parameter. But it is hard to understand the real effect of some parameters until you test them. I'll try to describe the effect of those values.

    Spoiler Alert, click show to read: 
    Code:
    ;Part 2 : daytypes are different kind of days which can occur in different climates
    ;	and seasons, allowing control over the lighting settings of the game in widely
    ;	differing environments
    ;
    ;	daytype {type_id}
    ;
    ;		climates		{climates that this daytype is applicable to - space seperated list}
    ;		seasons			{seasons that this daytype is applicable to}
    ;		weatherevents	{weather events that can occur coupled with weight indicating chance of happening - space seperated list}
    ;		next_day		{space seperated list of days that can follow this type}
    ;
    ;		event
    ;			time			{24hr value for time event starts}
    ;			sun_colour		r g b
    ;			sunlight		{diffuse}
    ;			moonlight		{full diffuse} {new diffuse}
    ;			haze_colour		r g b
    ;			cloud_colour	{east r g b} {west r g b}
    ;
    ;		event
    ;			....


    The most important when you define a new daytype is to know that the possition of the sun and the moon in the sky is hardcoded (or at least I have not found any file to change it), they are automatically placed in the sky depending on the time of the day.
    And the shadows and lights you see in the enviroment are mostly based on sun possition. All you can do with the values of this file is to change the colour and to reduce the intensity of the light, not the position of the source.

    Also, those values are RGB mutipliers, as well as the values you will find in descr_skydome.txt. And it seems the base values are hardcoded, because no matter if you change all the values in those files to "1", the light will still be darker at sunrise and sunset, with the maximum at midday.

    -time: 24hr value for time event start

    -sun_colour: this is the color of the circle that represents the sun itself. All zeros "0 0 0" would look like an eclipse.

    -sunlight: this is the light of the enviroment when the sun is above the horizon. It affects to both the landscape and the units.

    -moonlight: this is the light of the enviroment when the sun is below the horizon. It affects to both the landscape and the units.

    -haze_colour: this is the colour of the fog if the fog density is greater than 0, no matter if it is a clear or hazy or foggy day. (fog density is defined in the weatherevent, Part 1 of this descr_daytypes.txt)

    -cloud_colour: this is the color of the sky. I think it does not affect the lighting of the enviroment nor the units. Only the visual aspect of the clouds in the sky.


    Example of new daytype:
    Spoiler Alert, click show to read: 
    Code:
    daytype	sub_arctic
    
    	climates		sub_arctic
    	seasons			summer winter
    	weatherevents	hazy 0.5, light_fog 0.3, heavy_fog 0.10, rain_summer_shower 0.05, rain_drizzle 0.05
    	next_day		sub_arctic 1.0									
    
    ; night
    	event 
    		time			0
    	
    		sun_colour		0.2		0.2		0.1
    		sunlight		1		1		1
    		moonlight		0.2		0.2		0.2			0.20 	0.045		0.05
    		haze_colour		0.16		0.15		0.15
    		cloud_colour	0.15		0.12		0.12		0.17		0.12		0.1
    
    ; sunrise
    	event
    		time			7
    	
    		sun_colour		0.4		0.4		0.3
    		sunlight		0.9		0.9		0.9
    		moonlight		0.3		0.3		0.3			0.20 	0.045		0.05
    		haze_colour		0.16		0.15		0.15
    		cloud_colour	0.15		0.12		0.12		0.17		0.12		0.1
    
    ; straight after sunrise
    	event
    		time			8
    	
    		sun_colour		0.4		0.4		0.3
    		sunlight		0.7		0.7		0.7
    		moonlight		0.3		0.3		0.3			0.20 	0.045		0.05
    		haze_colour		0.16		0.15		0.15
    		cloud_colour	0.3		0.25		0.25		0.35		0.25		0.20
    
    ; midday
    	event
    		time			12
    	
    		sun_colour		0.4		0.4		0.3
    		sunlight		0.5		0.5		0.5
    		moonlight		0.3		0.3		0.3			0.20 	0.045		0.05
    		haze_colour		0.16		0.15		0.15
    		cloud_colour	0.3		0.25		0.25		0.35		0.25		0.20
    
    ;afternoon
    	event
    		time			16
    	
    		sun_colour		0.4		0.4		0.3
    		sunlight		0.7		0.7		0.7
    		moonlight		0.3		0.3		0.3			0.20 	0.045		0.05
    		haze_colour		0.16		0.15		0.15
    		cloud_colour	0.3		0.25		0.25		0.35		0.25		0.20
    
    ; sun going down
    	event 
    		time			18
    	
    		sun_colour		0.4		0.4		0.3
    		sunlight		0.9		0.9		0.9
    		moonlight		0.3		0.3		0.3			0.20 	0.045		0.05
    		haze_colour		0.16		0.15		0.15
    		cloud_colour	0.15		0.12		0.12		0.17		0.12		0.1
    
    ; night
    	event 
    		time			21
    	
    		sun_colour		0.2		0.2		0.1
    		sunlight		1		1		1
    		moonlight		0.2		0.2		0.2			0.20 	0.045		0.05
    		haze_colour		0.16		0.15		0.15
    		cloud_colour	0.15		0.12		0.12		0.17		0.12		0.1


    That looks like this: (1st screen at midday, 2nd at sunset)



    3.descr_skydome.txt
    This file includes RGB multipliers similar to those in descr_daytypes.txt. You can define here the horizontal colour variation for different times of the day. They affect to all climates, but you can define different values for each season.


    I hope people more experienced with those files can help me to correct and increase the info.
    By the way, I have recently discovered the file \data\descr_pallete.txt, and I guess it includes many of the parameters that I thought hardcoded... I'll keep testing.
    Last edited by Bardo; November 26, 2009 at 03:27 AM.

  2. #2
    Hakomar's Avatar Ordinarius
    Join Date
    May 2009
    Location
    England.
    Posts
    776

    Default Re: Changing Battle Light Conditions

    This will be quite nice when it is finished. You may want a person who is better at English (No offence, it is a very good what you have done with it, I certainly couldn't master another language to an extent people do, and I hear English is a difficult language) to help you correct some errors. I am not perfect, but could help with that in some time. Anyway, off of the grammar side, this will be quite useful when finished.

  3. #3

    Default Re: Changing Battle Light Conditions

    No offense, I know my english isn't good, and I will be glad if someone correct it.
    I'll try to finish the daytypes this week. The other files are rather simple, and I have not modded them much.

  4. #4

    Default Re: Changing Battle Light Conditions

    I have just discovered it is possible to use extra parameters in descr_battle_map_lighting_and_fog_control.txt, that were never used in vanilla RTW or BI:
    Code:
    night_ambient_red_increase_proportion		0.1
    night_ambient_green_increase_proportion		0.1
    night_ambient_blue_increase_proportion		0.2
    I have verified those new values are only used at night, while the standard parameters are use at day:
    Code:
    ambient_red_increase_proportion			0.25
    ambient_green_increase_proportion		0.25
    ambient_blue_increase_proportion		0.5
    For example, it allows to make night battles as blue as you want without affecting daylight conditions.

    EDITED: It seems those are the only values that works by adding "night_" at the start, it has no effect when used with fog parameters nor max and min_light_intensity.
    Last edited by Bardo; November 15, 2010 at 03:33 PM.

  5. #5

    Default Re: Changing Battle Light Conditions

    Well, look what we have here, Bardo posting another excellent piece of modding stuff. Well done, dude, I'll certainly make a good use of this thread
    There are none so enslaved as those who falsely believe they are free

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •