Back to searchlights

mongoose

SOH-CM-2023
Seeing the TextureMagic.ini and the search_light.dds input and yet not seeing any search_light.dds in my install, I am wondering where we are with a good searchlight? Does WOFF have one or do we?
 
There was some work on this here a few years ago, but I don't know if it was ever finalized. WOFF has one.
 
well.....

We tried to work on one a while back but ran out of steam. We struggled to get the texture alignment correct but we did with a nice fade out at the edge of the light's range. However, we ran into problems trying to get the light to track targets. We used the old ground crew model, spied on the WOFF ones; but alas we just failed to get the tracking down as we had earlier with the GC ones. So anyone that wants to jump in and help us sort this out it would be great to see new lights with Ankor's effects.

So if you have a model that tracks targets well send it my way and I'll map the revised textures and we'll see. I even have the original meshes too from several years ago, but again we were not satisfied with how they tracked the target if I remember correctly.

Don't say this too loudly:devilish: but placed the WOFF ones in an install to test and there were some issues with that IFRC? :dizzy:
 
Has anyone actually used the woFF searchlights in WOFF? I have it but never used it. I assume it is still a gun as in vehicles and weapons folders. What controlled the tracking thta semed to be different from the gc ones?
 
Well, the idea is to create an AA gun shaped like a searchlight, and there are a couple requirements for how the beam is set up to make it work with the shaders. Somehow we couldn't get the searchlight gun to shoot in the right direction, and thus the beam almost never pointed at an actual target, making it pretty much useless. Either there's some special modeling convention for AA guns we missed or there's a conflict between the modeling requirements for a working AA gun and the requirements to make the beam work in Ankor's shaders. As Ted said, we couldn't get it figured, despite numerous attempts.
 
... Somehow we couldn't get the searchlight gun to shoot in the right direction, and thus the beam almost never pointed at an actual target...

Daniel, what do you mean by this? Does the searchlight point in a completely different direction or 'in-the-general-direction-but-not-quite-right'?
I once modelled a 40mm Bofors gun and that works as it should. I don't know how the searchlight is created (the effects involved and what 'bullet/shell' characteristics it was given), but effective range and muzzle speed leap to mind as having something to do with it.

If the searchlight is coded as a 'gun', it probably leads the target (depending on range, muzzle speed and target altitude). So you may never see an AC in the light's beam as it always is in front of the target. I would try to give the gun a large effective range (otherwise it won't engage a target at high altitude - check what they did for the 88mm) and the shell the speed of light (it is light, after all). Then it should (theoretically) point directly at the target, as there is no need for leading.
But you might already have tried that and I could be wrong...
 
Attempts

We used the old ground crew models that work just fine in CFS3 w/o the shaders and they would not track when the shaders were in use. We also used (don't say this too loudly) another sim's versions and they to were problematic at best. So it is not that we don't have the parameters set since we used the all the files that we had from previous working guns, so if I have time i'll go back and see. Easy enough to find out go in ETO w/o shaders, place some lights (ones we already have) and see if they track. Then use the shaders and see what happens.

Ted
 
I just looked at the code in light.fx. related to searchlights. There is a limit of no more than 8.

What it appears to be calculating is the lighting effect on the target aircraft, and nothing related to tracking is in there. The intensity of the lighting effect is dependent on the range defined for the searchlight, with the intensity falling off based on the point to point distance the aircraft is from the searchlight.

float2 calcSearchLights(float3 worldPos, float3 normal, bool bSpecularEnable, float fPower)
{
float2 searchlight = 0; // x = diffuse, y = specular
for(int i = 0; i < iNSearchLights; i++)
{
float3 vec = worldPos.xyz - arrSearchLights.vWorldPos.xyz;
float radiusSq = dot(vec, vec);
if(radiusSq < SearchLightRange*SearchLightRange)
{
float vecLength = sqrt(radiusSq);
float range = vecLength/SearchLightRange;
float dist = length(cross(vec, arrSearchLights.vWorldDir));
float inner = lerp(0.5, SearchLightCone, range);
float falloff = 10;
float outer = inner + falloff;
if(dist < outer)
{
float NdotL = saturate(dot(normal.xyz, -vec/vecLength));
float lightAmount = saturate((outer - dist)/falloff) * (2-range*2) * NdotL;
searchlight.x += lightAmount * 2; // diffuse
if(bSpecularEnable)
{
float3 H = normalize(arrSearchLights.vWorldDir - normalize(worldPos.xyz));
float HdotN = saturate(dot(H, normal.xyz));
searchlight.y += pow(HdotN, fPower) * (fPower + 2) / 8 * lightAmount; // specular
}
else
{
searchlight.y = 0;
}
}
}
}
return searchlight;
}

I wonder if the searchlights you were testing might actually still be working as they did without the shaders, but the effect is now so dim you can't tell. If that's the case then changing the SearchLightRange, Falloff rate, or LightAmount multiplier might help
 
It wasn't a matter of the beam fading out too soon. At one point I used the stock 88mm flak gun instead of the searchlight gun in the xdp and added tracers so I could see where the gun was trying to fire. It would often fire at a random patch of sky, even with me as the only aircraft in the sky.
 
lights

Ok, well that was always the case with the lights they would converge TOWARD a plane but rarely stay on target except for a brief period (talking about the GC lights we had several years ago). What would happen is that the lights would randomly search the sky and when the plane was very near the light source the beams would attempt to find the plane, get close, and at times shine directly onto the plane. It was not always a perfect lighting but the planes would be caught in the beam for a while. So I guess the issue is that the nature of the flak gun and the imprecision coded into their operation may be the cause. Now, as with the turret gunners on planes, can the rate be changed and if this works like the turret guns accuracy improves greatly. I think I have some time later this week and next to shed some light onto this :biggrin-new:. Would love to share the load as many minds are better.
 
I think you need a very low "noise" parameter for the searchlight gun. This is the setting from the MAW searchlight gun:

<Gun GunType="flak_gun" TargetCategory="wheeled,tracked,ships,aircraft" Range="8000" Tracer="0" Rate="100" MuzzleVelocity="30000" TimeAlive="10" Noise="0.000001" usesmallflash="1" DefaultWeapon="searchlight_light"/>

I think the "rate" parameter is inactive - the gunstations setting in the relevant vehicle should have a ratelimit setting which is moderate, say 40.

For the weapon searchlight_light.xml, the weapontype needs to be flak_gun as well. Here is the weapon parameter set from MAW:

<Weapon WeaponType="flak_gun" ImpactDice="0" ImpactDieSize="0" ImpactOffset="0" BlastDice="0" BlastDieSize="0" BlastOffset="0" BlastRadius="0" FireDice="0" FireDieSize="0" FireOffset="0" ExplodeEffect="flak_search_illumination" GroundEffect="flak_search_illumination" MissEffect="flak_search_illumination" AirEffect="flak_search_illumination" WaterEffect="flak_search_illumination" />

Having said all that, I cannot spot a searchlight vehicle in MAW which uses the searchlight gun? Instead, the searchlight vehicles use an 88mmflak_gun with no ammo, and a track effect fx_searchlight. So I don't understand what the gun and weapon xdps are for if they are not used for the searchlight vehicle.

In the MAW mission Wellingtons to Napoli, the vehicle "dr_searchlight_sw" is used as a ground formation. The gun on the vehicle is the 88mm, the searchlight.xml gun is not used?

The searchlight system used for the mission looks ok from a distance. Don't know if aircraft get illuminated.

So don't know that I've been much help. The searchlight gun and weapon xmls in MAW do not appear to have been utilised on a land vehicle. Perhaps they are used on a ship, I have not looked.
 
Meanwhile comparing gc_dsearchlights with the 'other' (includes relevant effects from effects.xml) with shaders30 and no shaders and will pass details later to those concerned. However with shaders have already noticed the following using the 'other'-serchlights

- very bright and nice from far away
- shine up to just 20k feet
- no noticeable movement; just straight up
- aircraft is however illuminated, but mainly topside and in cockpit.

Teds/gc lights

- hardly visible but must be there as illuminates aircraft better.

No shaders

- 'other' basically invisible

gc as before; tracks quite well

I need to do a few more tests in different installs to see what other differences there may be. More later.
 
What I was describing wasn't related to noise or accuracy since the shells indicating where the gun was pointed were bursting in a random part of the sky not close to anything. This is not how standard AA guns work, which still manage to shoot in your general direction. This is what led me to the conclusion I stated earlier.

If someone has the source for an AA gun that is known to be working correctly, I suggest modeling a beam onto it per Ankor's instructions and see if we can get better results.
 
In my trials in a Mossie at 20K ft using a gun/light combined facility the guns were very accurate! ( the Mossie was normally damaged sooner or later ) That was true for both versions as I just changed the lights. Only the other lights were not tracking; even though they periodically seemed to illuminate the ac.

<Facility Type="tk_searchlight_battery" Flags="" OuterDistance="10">
<Units>
<Unit Type="g_88mm" Position="-401.89 -400.99" Angle="0.00"/>
<Unit Type="g_88mm" Position="404.84 700.00" Angle="0.00"/>
<Unit Type="g_88mm" Position="404.84 -400.99" Angle="0.00"/>
<Unit Type="g_88mm" Position="404.84 -696.15" Angle="0.00"/>
<Unit Type="g_88mm" Position="702.95 -696.15" Angle="0.00"/>
<Unit Type="g_88mm" Position="702.95 -400.99" Angle="0.00"/>
<Unit Type="g_88mm" Position="404.84 404.84" Angle="0.00"/>
<Unit Type="g_88mm" Position="702.95 404.84" Angle="0.00"/>
<Unit Type="g_88mm" Position="702.95 700.00" Angle="0.00"/>
<Unit Type="g_88mm" Position="-700.00 700.00" Angle="0.00"/>
<Unit Type="g_88mm" Position="-401.89 700.00" Angle="0.00"/>
<Unit Type="g_88mm" Position="-401.89 404.84" Angle="0.00"/>
<Unit Type="g_88mm" Position="-700.00 404.84" Angle="0.00"/>
<Unit Type="g_88mm" Position="-700.00 -696.15" Angle="0.00"/>
<Unit Type="g_88mm" Position="-401.89 -696.15" Angle="0.00"/>
<Unit Type="g_88mm" Position="-700.00 -400.99" Angle="0.00"/>
<Unit Type="gc_searchlight_blue" Position="0.00 0.00" Angle="0.00"/>
<Unit Type="gc_searchlight_white" Position="-1000.00 1000.00" Angle="0.00"/>
<Unit Type="gc_searchlight_white" Position="-1000.00 0.00" Angle="0.00"/>
<Unit Type="gc_searchlight_white" Position="-1000.00 -1000.00" Angle="0.00"/>
<Unit Type="gc_searchlight_white" Position="0.00 -1000.00" Angle="0.00"/>
<Unit Type="gc_searchlight_white" Position="1000.00 -1000.00" Angle="0.00"/>
<Unit Type="gc_searchlight_white" Position="1000.00 0.00" Angle="0.00"/>
<Unit Type="gc_searchlight_white" Position="1000.00 1000.00" Angle="0.00"/>
<Unit Type="gc_searchlight_white" Position="-3.76 1000.00" Angle="0.00"/>
</Units>
<GroundPlanes/>
<Routes/>
</Facility>
 
Ted, I take it from you post elsewhere that all we need is the correct addition to the TeaxtureMagic. ini ?
 
Woot!

Ok, I found my original copy of the ground crew lights and found that the current ETO effects file is missing a few lines that once placed in the file - wunderbar! The planes are now light up periodically and it seems for much better. Anyone interested?:wavey:
 
Ok, I found my original copy of the ground crew lights and found that the current ETO effects file is missing a few lines that once placed in the file - wunderbar! The planes are now light up periodically and it seems for much better. Anyone interested?:wavey:

Are you joking!:wavey: BTW what date do you have for your original copy?
 
Try the attached- ETO has all the vehicle, guns. weapons files but lacks the effects code. Just add that and use the gc_XXXX search lights facilities in the mission builder to see what happens. Of course delete the ".txt" extension
 

Attachments

  • GC_Searchlights_Vers_1.1.zip.txt
    47.6 KB · Views: 0
That came out as gobbledy gook!:pop4: Must be corrupted. was this what you meant?

<Effects>
<flak_search_illumination ClassName="Lighting" LightType="Point" Lifetime="2" InitialDelay="0" FadeInTime="0" FadeOutTime=".98" StrobeInterval=".99" StrobeRitm="1" PosX="0" PosY="-20.0" PosZ="0.0" RotY="0" RotX="0.0" Diffuse0="185 225 253" Diffuse1="244 241 215" Specular0="185 225 253" Specular1="238 243 24" Ambient0="185 225 253" Ambient1="185 225 253" Range="350" FallOff="0.6" Attenuation0="1" Attenuation1=".01" Attenuation2="0" Theta="10" Phi="30"/>
<flak_search_illumination_blue ClassName="Lighting" LightType="Point" Lifetime="2" InitialDelay="0" FadeInTime="0" FadeOutTime=".98" StrobeInterval=".99" StrobeRitm="1" PosX="0" PosY="-20.0" PosZ="0.0" RotY="0" RotX="0.0" Diffuse0="141 205 249" Diffuse1="169 189 253" Specular0="134 130 224" Specular1="238 243 24" Ambient0="185 225 253" Ambient1="143 129 245" Range="350" FallOff="0.6" Attenuation0="1" Attenuation1=".01" Attenuation2="0" Theta="10" Phi="30"/>
</Effects>

FURTHER EDIT: I do in fact already have those 2 lines in my TOW effect file which also has Shaders30. What I have been emailing you is based on that. Could you send some pics of what you are seeing?
 
Back
Top