Page MenuHomeFeedback Tracker

Light with shadows attached to lighthouse causes client CTD
Awaiting internal Testing, NormalPublic

Description

When a shadow-casting light is attached to a lighthouse (Land_Lighthouse), it causes a client crash when the light is behind the camera at some distance. This bug did not exist in DayZ versions prior to 1.24 (possibly 1.23).

Code:

class ShadowCrashLight: SpotlightLight
{
	float m_ShadowCrash_Yaw;

	void ShadowCrashLight()
	{
		SetVisibleDuringDaylight(true);
		SetRadiusTo(500);
		SetCastShadow(true);	
		SetDiffuseColor(1, 1, 0.8);
		SetAmbientColor(1, 1, 0.8);
		SetAmbientAlpha(1);
		SetFlareVisible(true);
		SetSpotLightAngle(100);

		SetBrightnessTo(0.8);
		FadeIn(0.3);
	}

	override void OnFrameLightSource(IEntity other, float timeSlice)
	{
		m_ShadowCrash_Yaw += 25 * timeSlice;
		if (m_ShadowCrash_Yaw >= 360)
			m_ShadowCrash_Yaw = 0;

		SetOrientation(Vector(m_ShadowCrash_Yaw, 0, 0));
	}
}

class Land_Lighthouse: House
{
	ScriptedLightBase m_ShadowCrash_Light;

	override void DeferredInit()
	{
		super.DeferredInit();

	#ifndef SERVER
		m_ShadowCrash_Light = ScriptedLightBase.CreateLight(ShadowCrashLight, "0 0 0");
		m_ShadowCrash_Light.AttachOnObject(this, GetMemoryPointPos("cerveny pozicni blik"), "0 0 0");
	#endif
	}
}

Details

Severity
None
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
Modding
Steps To Reproduce
  1. Use the above code (or attached PBO ) which adds a light to lighthouse buildings.
  2. Go to the Skalisty island lighthouse (any other should be able to cause the same CTD, just an example)
  3. Look at the lighthouse, then turn around and walk away from the lighthouse, following the path inland (look away from the lighthouse, it needs to be behind camera).
  4. Game client will crash when you have reached a certain distance from the lighthouse.
Additional Information

If the light is altered to not cast shadows, i.e. by calling SetCastShadow(false), the crash does not occur.

Event Timeline

lava76 created this task.Feb 28 2024, 4:05 PM
lava76 edited Steps To Reproduce. (Show Details)
lava76 edited Steps To Reproduce. (Show Details)
lava76 edited Steps To Reproduce. (Show Details)Feb 28 2024, 4:26 PM

Minidump
Mods: @CF;@Community-Online-Tools

Geez changed the task status from New to Awaiting internal Testing.Feb 29 2024, 11:31 AM
lava76 added a comment.Mar 2 2024, 2:13 PM

A similar client CTD can be provoked by entering freecam and moving freecam close to or below ground while a nearby player is shooting, and I'm assuming it's due to the muzzle flash.

I've created a new ticket for the freecam freeze & CTD as I'm not sure if related. https://feedback.bistudio.com/T179875