Back to searchlights
Page 1 of 2 12 LastLast
Results 1 to 25 of 35

Thread: Back to searchlights

  1. #1
    Charter Member 2016 mongoose's Avatar
    Join Date
    Jun 2005
    Location
    Navigator, where are we??
    Age
    74
    Posts
    1,766

    Back to searchlights

    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?

    Cato said "Carthaginem esse delendam"
    I say "Carthago iam diu deleta,sed enim Bellum Alium adhuc aedificandum est"

  2. #2
    There was some work on this here a few years ago, but I don't know if it was ever finalized. WOFF has one.
    US Army, Major, Ret.

    Service To The Line,
    On The Line,
    On Time

    US Army Ordnance Corps.

  3. #3
    Kurier auf Stube...pauke! NachtPiloten's Avatar
    Join Date
    Jun 2005
    Location
    Hampstead, North Carolina, USA
    Age
    61
    Posts
    1,509

    Icon9 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 but placed the WOFF ones in an install to test and there were some issues with that IFRC?

  4. #4
    Charter Member 2016 mongoose's Avatar
    Join Date
    Jun 2005
    Location
    Navigator, where are we??
    Age
    74
    Posts
    1,766
    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?

    Cato said "Carthaginem esse delendam"
    I say "Carthago iam diu deleta,sed enim Bellum Alium adhuc aedificandum est"

  5. #5
    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.

  6. #6
    Quote Originally Posted by gecko View Post
    ... 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...

    ACC Member, ETO and PTO contributor & librarian

  7. #7
    Kurier auf Stube...pauke! NachtPiloten's Avatar
    Join Date
    Jun 2005
    Location
    Hampstead, North Carolina, USA
    Age
    61
    Posts
    1,509

    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

  8. #8
    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[i].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[i].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[i].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
    US Army, Major, Ret.

    Service To The Line,
    On The Line,
    On Time

    US Army Ordnance Corps.

  9. #9
    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.

  10. #10
    Kurier auf Stube...pauke! NachtPiloten's Avatar
    Join Date
    Jun 2005
    Location
    Hampstead, North Carolina, USA
    Age
    61
    Posts
    1,509

    Icon22 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 . Would love to share the load as many minds are better.

  11. #11
    SOH-CM-2017
    Join Date
    Jun 2005
    Location
    Aotearoa, New Zealand
    Age
    58
    Posts
    2,047
    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.

  12. #12
    Charter Member 2016 mongoose's Avatar
    Join Date
    Jun 2005
    Location
    Navigator, where are we??
    Age
    74
    Posts
    1,766
    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.

    Cato said "Carthaginem esse delendam"
    I say "Carthago iam diu deleta,sed enim Bellum Alium adhuc aedificandum est"

  13. #13
    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.

  14. #14
    Charter Member 2016 mongoose's Avatar
    Join Date
    Jun 2005
    Location
    Navigator, where are we??
    Age
    74
    Posts
    1,766
    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>

    Cato said "Carthaginem esse delendam"
    I say "Carthago iam diu deleta,sed enim Bellum Alium adhuc aedificandum est"

  15. #15
    Charter Member 2016 mongoose's Avatar
    Join Date
    Jun 2005
    Location
    Navigator, where are we??
    Age
    74
    Posts
    1,766
    Ted, I take it from you post elsewhere that all we need is the correct addition to the TeaxtureMagic. ini ?

    Cato said "Carthaginem esse delendam"
    I say "Carthago iam diu deleta,sed enim Bellum Alium adhuc aedificandum est"

  16. #16
    Kurier auf Stube...pauke! NachtPiloten's Avatar
    Join Date
    Jun 2005
    Location
    Hampstead, North Carolina, USA
    Age
    61
    Posts
    1,509

    Icon26 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?

  17. #17
    Great News!
    US Army, Major, Ret.

    Service To The Line,
    On The Line,
    On Time

    US Army Ordnance Corps.

  18. #18
    Charter Member 2016 mongoose's Avatar
    Join Date
    Jun 2005
    Location
    Navigator, where are we??
    Age
    74
    Posts
    1,766
    Quote Originally Posted by NachtPiloten View Post
    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?
    Are you joking! BTW what date do you have for your original copy?

    Cato said "Carthaginem esse delendam"
    I say "Carthago iam diu deleta,sed enim Bellum Alium adhuc aedificandum est"

  19. #19
    Kurier auf Stube...pauke! NachtPiloten's Avatar
    Join Date
    Jun 2005
    Location
    Hampstead, North Carolina, USA
    Age
    61
    Posts
    1,509
    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
    Attached Files Attached Files

  20. #20
    Charter Member 2016 mongoose's Avatar
    Join Date
    Jun 2005
    Location
    Navigator, where are we??
    Age
    74
    Posts
    1,766
    That came out as gobbledy gook! 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?

    Cato said "Carthaginem esse delendam"
    I say "Carthago iam diu deleta,sed enim Bellum Alium adhuc aedificandum est"

  21. #21
    Charter Member 2016 mongoose's Avatar
    Join Date
    Jun 2005
    Location
    Navigator, where are we??
    Age
    74
    Posts
    1,766
    Further to above, I have gone through a whole lot of different searchlights I have; I have yet to test all but did test ones called
    dr_searchlight_sb and dr_searchlight_sw
    Both use an effect <fx_searchlight ClassName="GroupEffect" Effect0="searchlight_halo" Effect1="searchlight_fireball" effect2="searchlight_reflected_light" effect3="searchlight_shockwave"/>
    which I note was in my effect file.

    tested in facility tk_flak_battery_1 replacing gc_searchlight_white in 2 different missions


    dr_searchlight_sb and gc_searchlight_white showed hardly visible light BUT illuminated the aircraft, mainly the top side, but somewhat on the correct underside.

    dr_searchlight_sw showed full lights which moved; quite erratically at first, but then somewhat tracked the aircraft BUT no illumination of the aircraft.


    I have yet to test a "g_searchlight" which uses an effect called

    <fx_ambientlight ClassName="GroupEffect" Effect0="Light_l"/>
    <Light_l ClassName="Lighting" LightType="Point" Lifetime="9000" InitialDelay="0" FadeInTime="0" FadeOutTime="3" StrobeInterval="0.01" StrobeRitm="1" PosX="0" PosY="2.1" PosZ="0" RotY="0" RotX="0.0" Diffuse0="0 0 0" Diffuse1="231 228 254" Specular0="0 0 0" Specular1="231 228 254" Ambient0="0 0 0" Ambient1="151 143 254" Range="12" FallOff="3" Attenuation0="1" Attenuation1=".01" Attenuation2="0" Theta="10" Phi="30"/>

    Cato said "Carthaginem esse delendam"
    I say "Carthago iam diu deleta,sed enim Bellum Alium adhuc aedificandum est"

  22. #22
    Illumination of aircraft works differently with Ankors shaders than with the original GC concept. I'll try to explain the differences.

    GC Searchlights
    -Model functions as a flak gun with the beam always pointing the same direction as the gun node.
    -Beam illumination is accomplished by making the beam out of highly reflective but mostly transparent material. Ambient lighting present with stock shaders was enough to get the beam model to reflect the light. This does not work as well in Ankor's shaders because the ever present ambient light source that illuminated the beam in the stock shaders has been removed in favor of more realistic lighting in Ankor's shaders.
    -Aircraft illumination is accomplished by having the gunstation in the model calling for a searchlight gun in the xdp that fires a shell that produces a lighting effect, but no damage or other visual effect. It does not necessarily light the aircraft from below through the beam, but from wherever the searchlight "flak shell" happens to burst (above, below, to the side, etc.)

    Ankor Shaders Searchlights
    -Model functions as a flak gun with the beam always pointing the same direction as the gun node, just as above. HOWEVER, the beam (and moving gun node) must also be aligned along the negative X axis, i.e. it starts near X = 0 and ends near X = -3000 or -5000 etc depending on desired length. Note: the beam in game will display at twice the length of the beam that is actually modeled.
    -Beam illumination is accomplished by mapping a semi-transparent texture to the beam. The name of this texture is added to the TextureMagic.ini in the shaders30 folder under the [Searchlight] section. Ankor's shaders will see the texture name and know to illuminate it.
    -Aircraft illumination is accomplished automatically by Ankor's shaders any time an aircraft passes through the beam. If the beam has been modeled as specified above, the light will always shine from the source at the searchlight itself, and only illuminate objects within the beam, and always from the correct direction. No lines need to be added to the effects.xml whatsoever to make this work. A searchlight gun is still required to be called in the xdp, but its only purpose is to give the AI gunner a weapon to point at you and try to shoot you with. It does not and should not contribute to the visual effect in any way.

    Hopefully that clears up some confusion about what we're trying to accomplish and what the components and requirements are. A successful searchlight will have to be modeled according to those specifications and track enemy aircraft reasonably aggressively and accurately, such as how current flak guns operate for us now.

    We successfully got the searchlight modeled correctly to produce the correct visual effects, but said searchlight failed to track targets as well as a flak gun in spite of being set up just like a flak gun. This has led me to wonder if there is a conflict with how Ankor's shaders require the beam to be on the negative X axis and whatever CFS3 needs in a model to make the gun track a target correctly, i.e. does CFS3 require the gun node to be aligned with a specific axis other than the negative X axis, (Y axis perhaps?) or can the gun node be aligned on any axis and still track targets correctly?

  23. #23
    According to the SDK, there are specific axes for guns:

    gun#_l_r
    gun rotation, Y-axis in line with barrel, blue arrow pointing up, red arrow pointing right and green arrow pointing towards the gunner

    gun#_fore_aft
    gun elevation, Z-axis to the right of the gunner, so blue arrow to the right of the gunner, red arrow pointing up and green arrow pointing towards the gunner, child of gun#_l_r,

    gun_grp#b#
    emitter for gun, child of gun_grp#b#, Y-axis points towards target

    ACC Member, ETO and PTO contributor & librarian

  24. #24
    Could it be that the searchlight.y and searchlight.x references in the code I posted above just need to be swapped? Or perhaps change float3 vec = worldPos.xyz - arrSearchLights[i].vWorldPos.xyz; to float3 vec = arrSearchLights[i].vWorldPos.xyz - worldPos.xyz;
    US Army, Major, Ret.

    Service To The Line,
    On The Line,
    On Time

    US Army Ordnance Corps.

  25. #25
    Thanks Joost, that seems to confirm my suspicions. It may be that this was intentional for WOFF, to prevent the searchlights from being accurate, as I don't think there was much in the way of technology to help direct them in WWI. By WWII there was much better technology in place to get the beams on target.

    Andy, I agree, somehow the shaders have to be changed to put the beam along the (positive?) Y axis rather than the negative X axis. Hopefully it's as you suggest with a simple edit of the .fx file.

Members who have read this thread: 0

Bookmarks

Posting Permissions

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