Results 1 to 7 of 7

Thread: IWTE - Changing Settlement effect lighting

  1. #1
    wilddog's Avatar Paintedwolves run free
    Join Date
    Jan 2005
    Location
    UK
    Posts
    2,337

    Default IWTE - Changing Settlement effect lighting

    OK, this is a basic tutorial to explain how to reset the effect related lighting in a settlement using IWTE (Parameters are all in IWTE_14_01_F)

    Background
    In a settlement you can add various types of effects (via IWTE) and Vanilla settlements contain lots of different effects. This tutorial is really only addressing the ones which are light emitting effects (i.e. not sound, smoke etc). The light emitting parameter is an attribute of the effect information held within the .world file.

    Relationship with complexes in the .world file
    These are the simple rules on how effects cast light :
    1. First is that a complex can only hold attributes for a maximum of 69 effects. If you add more effects they simply won't have any impact in terms of 'lighting' the buildings etc. If you take a shortcut when making .world files and only have 1 complex then that impact here is obvious.
    2. The next thing to understand is that the effects that do impact the complex do so by impacting the assigned vertices within the complex. Each vertex can only be impacted by a maximum of 3 effects.
    3. Each effect assigned to a vertex has its own intensity of light casting on that vertex.
    4. Each effect is assigned to a complex prioritised by the two column descriptions shown below (within a column its just by sequence in the effects lists)
    5. Animations also carry lighting information. If the complex has less lighting effects than the animation expects you will get a strange looking set of colours on the animated item. To counter this IWTE adds as many effects as it can up to the 69 maximum. The correct way to amend it is via individually lighted animations... but its too long winded to do to be practical.


    OK thats the basics so what does this mean. Here are some example snapshots of stone fort C with a very light texture in a night battle to show the basic impact of the vanilla effect lighting.

    NE stone fort C at night : shows example of
    A= Pixel lighting triangle that is not in direct line (i.e. pixel is but triangle isn't)
    B= Impact of torch object culling a vertex.
    Click image for larger version. 

Name:	OrigA.jpg 
Views:	64 
Size:	67.0 KB 
ID:	300182

    another example of type B
    Click image for larger version. 

Name:	origB.jpg 
Views:	61 
Size:	71.1 KB 
ID:	300183

    How can I amend the effect lighting with IWTE?
    In IWTE you need to first load a settlement (it always asks for all 3 files). Once loaded you need to go to the collisions tab and then press the Reset Complex Effects button. This will then display the following.

    Click image for larger version. 

Name:	effectsreen.jpg 
Views:	37 
Size:	112.0 KB 
ID:	300179

    Once this has been displayed you can amend the parameters and then either Cancel (nothing will happen) or press OK. This will then reset the Complex Effects data based on those parameters. This should take anything from about 10 seconds to 10 minutes depending on size of the world, number of effects and parameters. Obviously the larger for any of those the more time it will take. If you go crazy on the parameters it will take take a long long time.


    What do the various parameters mean?

    Column Heading classifications

    The parameters are split into two columns.
    1. Undamaged obj. Lights : These are the effects that have an impact when in an undamaged state eg the various lights/lanterns which are switched on at night.
    2. Damaged obj. Lights : these are the lights which only start to have an impact when the object they are assigned to has been damaged (i.e. it is now displaying object group level other than the first undamaged group). These are things like burning fires though not all fires are light emitting in vanilla settlements.

    Effects which do not cast lights are not involved in this process.


    Row parameters
    Maximum effect Distance
    This is simply the distance in metres from the effect to the vertex that a light can cast. If this is switched to a higher or lower value then all the lights assigned to this column will have their light casting amended to that distance. If you increase the default number this will significantly increase the time taken to calculate all the impacts.

    Example with distance extended (light impact is low as angle to the light impact increases).
    Click image for larger version. 

Name:	longdist.jpg 
Views:	27 
Size:	64.1 KB 
ID:	300191

    Example with default (less light on right hand side)
    Click image for larger version. 

Name:	angleintensitynorm.jpg 
Views:	57 
Size:	88.4 KB 
ID:	300180

    Prioritise effect Intensity
    This is a yes no switch.
    • No : Means that the first 3 effects that affect the vertex are assigned no matter their intensity assignment.
    • Yes : Means that once 3 effects have been assigned to a vertex the lowest intensity one will get replaced by an effect of higher intensity (until the complex limit is reached).


    Normally you should pick yes but you for the second columns effects you may decide to switch to no so they don't overwrite normal lights (remember the second columns refers to lights which only come on when something is damaged).

    Type of Culling
    This parameter has 3 parameters :
    • None : This means there is no culling at all and vertexes are selected on distance only (regardless of what may be in the way). You shouldn't normally want this other than when trying to speed up some testing.
    • Basic : This is as close to what I believe CA implemented in its vanilla settlements. It cross checks for an intervening triangle that is facing the light and therefore blocking the light reaching the vertex. If this is the case the vertex is culled and the effect has no impact.
    • Advanced : This carries out further tests and so is slower. It checks if there is an intervening triangle regardless of the way it faces. Its most important on the lighting in the second column as often CA didn't add an inward facing triangle for some of the damaged objects and consequently the lighting bleeds through. It also performs a further check on the vertex to check if its really just that point that's unblocked and the triangle is blocked within a short distance.


    NO culling
    Click image for larger version. 

Name:	noculling.jpg 
Views:	35 
Size:	67.4 KB 
ID:	300188

    Basic Culling - - Still shows type A issue but green arrow shows culling impact.
    Click image for larger version. 

Name:	basic.jpg 
Views:	34 
Size:	60.7 KB 
ID:	300190

    Advanced Culling Removes type A lighting and any back facing triangle issues (not shown on screen shot)
    Click image for larger version. 

Name:	angleintensitynorm.jpg 
Views:	57 
Size:	88.4 KB 
ID:	300180

    Culling exclusion
    This parameter is used to set a minimum distance at which any vertex encountered is not considered for the purposes of the culling tests. eg it is used to ignore the impact of the lit object in the first place. This removes unrequired blocking of light by the torch/lantern itself.

    Vanilla showing no exclusion (at point B)
    Click image for larger version. 

Name:	origB.jpg 
Views:	61 
Size:	71.1 KB 
ID:	300183

    with exclusion set to default
    Click image for larger version. 

Name:	cullexclusion.jpg 
Views:	28 
Size:	63.2 KB 
ID:	300184

    Angle Weighting
    The lighting Intensity is calculated both on distance and angle of impact. This weighting determines how much effect the angle has. The default seems reasonable though a purist may want the full value of 1.0. On the other hand if you have a lot of tall objects in a cave etc you may want to increase distance but need to reduce the angel impact for the distance to be noticeable (as obviously the angle will become more extreme as the length increases).

    Angle intensity set to default
    Click image for larger version. 

Name:	angleintensitynorm.jpg 
Views:	57 
Size:	88.4 KB 
ID:	300180

    Angle intensity set to zero
    Click image for larger version. 

Name:	angleintensnone.jpg 
Views:	45 
Size:	91.7 KB 
ID:	300181
    Last edited by wilddog; February 02, 2014 at 03:07 AM. Reason: added version info rest of thred tidied up

  2. #2
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Default Re: IWTE - Changing Settlement effect lighting

    fixed
    Last edited by leo.civil.uefs; February 01, 2014 at 04:35 PM.

  3. #3
    wilddog's Avatar Paintedwolves run free
    Join Date
    Jan 2005
    Location
    UK
    Posts
    2,337

    Default Re: IWTE - Changing Settlement effect lighting

    resolved
    Last edited by wilddog; February 02, 2014 at 03:04 AM.

  4. #4
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Default Re: IWTE - Changing Settlement effect lighting

    fixed
    Last edited by leo.civil.uefs; February 01, 2014 at 04:35 PM.

  5. #5
    wilddog's Avatar Paintedwolves run free
    Join Date
    Jan 2005
    Location
    UK
    Posts
    2,337

    Default Re: IWTE - Changing Settlement effect lighting

    resolved
    Last edited by wilddog; February 02, 2014 at 03:04 AM. Reason: clearing down

  6. #6
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Default Re: IWTE - Changing Settlement effect lighting

    fixed
    Last edited by leo.civil.uefs; February 01, 2014 at 04:35 PM.

  7. #7

    Default Re: IWTE - Changing Settlement effect lighting

    In addition to wilddog's information above, please note this info copied from my earlier post lost somewhere in the IWTE thread:

    The only effects that which will actually "switch on" lighting if they're assigned to a vertex in vanilla or by IWTE's new "reset complex effects" button are one's with
    type light as the type for one of their components; so in vanilla descr_burning_building.txt
    burning_building_new_medium_set will generate a cast light effect as it's code is
    Code:
    effect_set burning_building_new_medium_set
    
    {
    	lod 10000
    	{
    		flaming_particles_medium
    		fiery_smoke_medium
    		dense_smoke_medium
    		embers_medium
    		burning_building_light
    		burning_building_sound_medium
    		fire_flare_sound
    	}
    }
    which contains burning_building_light which is
    Code:
    effect burning_building_light
    {
    	type light
    	{
    			
    		keyframe_colour
    		{
    				0.00, 	238, 173,  140
    				0.05, 	238, 148, 108
    				0.15	236, 158,152
    				0.18, 	220, 151,  119
    				0.21, 	230, 165,  108
    				0.26, 	238, 177, 137
    				0.31, 	236, 158,152
    		}
    			
    		keyframe_radius
    		{
    				0.0, 	3		
    		}
    		
    		light_map_scale 0.05
    	}
    }
    with the type light bit



    window_fire_small doesn't generate a cast light effect even if referenced by a complex & vertex as its code is
    Code:
    effect_set window_fire_small
    
    {
    	lod 10000
    	{
    		;small_flame
    		flaming_particles_small
    		fiery_smoke_small
    		burning_building_sound_small
    	}
    }
    and if you look up all those included effects, flaming_particles_small etc, you'll see they are all "type particle"

    ********************************************************************************

    Effects that are actually capable of activating cast light, as explained above, should be added with the setting "1" in the dropdown box for "light emitting" when adding the Collision Effect line.
    Effects that aren't should have "0" in the dropdown box. Copies of the combined effects used for the little torches throughout vanilla that use "brazier_small_set" and "light" should have the "light" line set as light emitting, and the brazier line not... because it doesn't contain a light casting effect.

    If you add both as "light emitting" you'll be using up more light effect rows, which makes the Reset process take longer, and might mean you can't get all the effects you want to be activated for a Complex included within the 69 hard coded limit, or within the limit of 3 effects applying per vertex.

    ********************************************************************************
    To get the best possible result from IWTE's new lighting function you ideally need more than 69 light emitting effects in the entire .world, so that IWTE can select up to 69 for each Complex if required to fix an animation bug. (basically where the animation you copied may have referred to, for example, complex effect no.65, and if you then only have 45 complex effects, the animinstances chunk tries and fails to find no.65 and gives you some 'Disco Lighting' effects instead!)

    However you also should remember that only 69 effects can possible be applied to a Complex, so if you've got only one Complex and 90 lights, then 21 of them won't be able to cast light on the structure.

Tags for this Thread

Posting Permissions

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