Boosting landing light range, altering its color, and reducing the illuminating power of the nav/landing lights upon the plane. The stock game wouldn't let me light up the field from as far away as shown here. Worth considering as the new standard in BAT?
The stock landing light range is a mere 1000m. Maybe fine for the Storch
, but awfully short for planes that have hotter landing speeds. Real lights were useful over a rather farther range than that. I've boosted this to 3000m. And I've made the illumination color on the ground a warm white, instead of the notably bluish hue. These two aspects are controlled in Aircraft.class, in the method updateLLights:
public void updateLLights()
{
pos.getRender(_tmpLoc);
if(lLight == null)
{
if(_tmpLoc.getX() < 1.0D)
return;
lLight = (new LightPointWorld[] {
null, null, null, null
});
for(int i = 0; i < 4; i++)
{
lLight[i] = new LightPointWorld();
lLight[i].setColor(0.96F, 0.98F, 0.8F); //(0.49411765F, 0.9098039F, 0.9607843F);
lLight[i].setEmit(0.0F, 0.0F);
try
{
lLightHook[i] = new HookNamed(this, "_LandingLight0" + i);
}
catch(Exception exception) { }
}
return;
}
for(int j = 0; j < 4; j++)
{
if(FM.AS.astateLandingLightEffects[j] != null)
{
lLightLoc1.set(0.0D, 0.0D, 0.0D, 0.0F, 0.0F, 0.0F);
lLightHook[j].computePos(this, _tmpLoc, lLightLoc1);
lLightLoc1.get(lLightP1);
/* lLightLoc1.set(1000D, 0.0D, 0.0D, 0.0F, 0.0F, 0.0F); */
lLightLoc1.set(3000D, 0.0D, 0.0D, 0.0F, 0.0F, 0.0F);
lLightHook[j].computePos(this, _tmpLoc, lLightLoc1);
lLightLoc1.get(lLightP2);
Engine.land();
if(Landscape.rayHitHQ(lLightP1, lLightP2, lLightPL))
{
lLightPL.z++;
lLightP2.interpolate(lLightP1, lLightPL, 0.95F);
lLight[j].setPos(lLightP2);
float f = (float)lLightP1.distance(lLightPL);
float f1 = f * 0.5F + 30F;
/* float f2 = 0.5F - (0.5F * f) / 1000F; */
float f2 = 0.5F - (0.5F * f) / 3000F;
lLight[j].setEmit(f2, f1);
} else
{
lLight[j].setEmit(0.0F, 0.0F);
}
continue;
}
if(lLight[j].getR() != 0.0F)
lLight[j].setEmit(0.0F, 0.0F);
}
}
Also of note in this screenie is the huge reduction in intensity of illumination from the nav lights. The stock lights bathe the plane in an obvious glow. But real nav lights are far subtler than that. This is fixable in AircraftState.class. First, in the method set(Actor actor, boolean bool) we can alter the color of the the nav lights and the landing light upon the plane. For the red and green nav lights I've made the hue very slightly less pure. For the landing light, I've given it the same color as for the spot it makes upon the ground, a warm white.
for (int i = 0; i < astateNavLightsEffects.length; i++) {
try {
astateEffectChunks[i + 18] = this.actor.findHook("_NavLight" + i).chunkName();
astateEffectChunks[i + 18] = astateEffectChunks[i + 18].substring(0, astateEffectChunks[i + 18].length() - 1);
Aircraft.debugprintln(aircraft, ("AS: Nav. Lamp #" + i + " attached to '" + astateEffectChunks[i + 18] + "' substring.."));
HookNamed hooknamed = new HookNamed(aircraft, "_NavLight" + i);
loc_2_.set(1.0, 0.0, 0.0, 0.0F, 0.0F, 0.0F);
hooknamed.computePos(this.actor, loc, loc_2_);
Point3d point3d = loc_2_.getPoint();
astateNavLightsLights[i] = new LightPointActor(new LightPoint(), point3d);
if (i < 2)
astateNavLightsLights[i].light.setColor(1.0F, 0.2F, 0.0F); //RED (1.0F, 0.1F, 0.0F)
else if (i < 4)
astateNavLightsLights[i].light.setColor(0.1F, 0.8F, 0.0F); //GREEN (0.1F, 1.0F, 0.0F)
else
astateNavLightsLights[i].light.setColor(0.85F, 0.8F, 0.75F); //WHITE (0.85F, 0.8F, 0.75F)
astateNavLightsLights[i].light.setEmit(0.0F, 0.0F);
this.actor.draw.lightMap().put("_NavLight" + i, astateNavLightsLights[i]);
} catch (Exception exception) {
/* empty */
} finally {
/* empty */
}
}
for (int i = 0; i < 4; i++) {
try {
astateEffectChunks[i + 24] = this.actor.findHook("_LandingLight0" + i).chunkName();
astateEffectChunks[i + 24] = astateEffectChunks[i + 24].substring(0, astateEffectChunks[i + 24].length() - 1);
Aircraft.debugprintln(aircraft, ("AS: Landing Lamp #" + i + " attached to '" + astateEffectChunks[i + 24] + "' substring.."));
HookNamed hooknamed = new HookNamed(aircraft, "_LandingLight0" + i);
loc_2_.set(1.0, 0.0, 0.0, 0.0F, 0.0F, 0.0F);
hooknamed.computePos(this.actor, loc, loc_2_);
Point3d point3d = loc_2_.getPoint();
astateLandingLightLights[i] = new LightPointActor(new LightPoint(), point3d);
/* astateLandingLightLights[i].light.setColor(0.4941176F, 0.9098039F, 0.9607843F); */
astateLandingLightLights[i].light.setColor(0.96F, 0.91F, 0.84F);
astateLandingLightLights[i].light.setEmit(0.0F, 0.0F);
this.actor.draw.lightMap().put("_LandingLight0" + i, astateLandingLightLights[i]);
} catch (Exception exception) {
/* empty */
} finally {
/* empty */
}
}
To alter the intensity of the nav lights upon the plane, we look to this method (in AircraftState.class), where I've reduced both the intensity (from 0.35 down to 0.09) and range (from * down to 6):
private void doSetNavLightsState(boolean flag)
{
for(int i = 0; i < astateNavLightsEffects.length; i++)
{
if(astateNavLightsEffects[i] != null)
{
Eff3DActor.finish(astateNavLightsEffects[i]);
astateNavLightsLights[i].light.setEmit(0.0F, 0.0F);
}
astateNavLightsEffects[i] = null;
}
if(flag)
{
new Loc(0.0D, 0.0D, 0.0D, 0.0F, 0.0F, 0.0F);
new Loc();
for(int j = 0; j < astateNavLightsEffects.length; j++)
{
Aircraft.debugprintln(aircraft, "AS: Checking '" + astateEffectChunks[j + 18] + "' visibility..");
boolean flag1 = aircraft.isChunkAnyDamageVisible(astateEffectChunks[j + 18]);
Aircraft.debugprintln(aircraft, "AS: '" + astateEffectChunks[j + 18] + "' is " + (flag1 ? "visible" : "invisible") + "..");
if(flag1)
{
bNavLightsOn = flag;
String s = "3DO/Effects/Fireworks/Flare" + (j > 1 ? j > 3 ? "White" : "Green" : "Red") + ".eff";
astateNavLightsEffects[j] = Eff3DActor.New(actor, actor.findHook("_NavLight" + j), null, 1.0F, s, -1F, false);
/* astateNavLightsLights[j].light.setEmit(0.35F, 8F); */
astateNavLightsLights[j].light.setEmit(0.09F, 6F);
}
}
} else
{
bNavLightsOn = flag;
}
}
And finally, for the landing light illumination intensity upon the plane, we go here:
private void doSetLandingLightState(boolean flag)
{
bLandingLightOn = flag;
for(int i = 0; i < astateLandingLightEffects.length; i++)
{
if(astateLandingLightEffects[i] != null)
{
Eff3DActor.finish(astateLandingLightEffects[i]);
astateLandingLightLights[i].light.setEmit(0.0F, 0.0F);
}
astateLandingLightEffects[i] = null;
}
if(flag)
{
for(int j = 0; j < astateLandingLightEffects.length; j++)
{
Aircraft.debugprintln(aircraft, "AS: Checking '" + astateEffectChunks[j + 24] + "' visibility..");
boolean flag1 = aircraft.isChunkAnyDamageVisible(astateEffectChunks[j + 24]);
Aircraft.debugprintln(aircraft, "AS: '" + astateEffectChunks[j + 24] + "' is " + (flag1 ? "visible" : "invisible") + "..");
if(flag1)
{
String s = "3DO/Effects/Fireworks/FlareWhiteWide.eff";
astateLandingLightEffects[j] = Eff3DActor.New(actor, actor.findHook("_LandingLight0" + j), null, 1.0F, s, -1F);
/* astateLandingLightLights[j].light.setEmit(1.2F, 8F); */
astateLandingLightLights[j].light.setEmit(0.3F, 9F);
}
}
}
}
I've reduced the intensity by about the same four-fold ratio as for the nav lights.
Now, I don't know if boosting the landing light range might have any untoward consequences. This would warrant some testing and careful observation. But the light color and illumination power aspects should be completely safe. Especially when decreasing values.