Lighting Influence System

Sometimes you need to check if actor is inside light or shadow. This can be usefull in stealth games or games where AI need to know how actors are influenced by lighting.

Lighting Influence is part of Game Dev Tools Plugin.

Features

  • Supports Point, Spot, Directional and Rectangle lights influence,
  • Directional light have own influence multiplier,
  • Actor can track its lighting influence,
  • Supports UE4 perception system: AI can use perception to catch see actors in light,
  • EQS for searching spots in light or in shadow,

Documentation

Example Maps

Plugins\GDMegaPack\Content\LightingInfluence\Maps\Showcase_LightingInfluence.umap – map to check how actors are influenced by lighting,

Plugins\GDMegaPack\Content\LightingInfluence\Maps\Showcase_LightingInfluenceAIPerception.umap – map to check how to configure AI to see Pawns in light using perception system, BT and EQS.

Lighting Influence Configuration

Your map need to have Lighting Influence Manager.

Manager keep track of each lights in map. You can change:

  • Update Interval
  • Directional Ammount To Add
  • Draw Debug Traces

Next your actors (which you want to keep track of) need to have Lighting Influence Receiver Component.

Component have two events InLight and InShadow. You can change trigger thresholds.

AI Perception Configuration

You can see example in GDShowcasePawnWithReceiver.h

Your Pawn or Character that you want to track need to have AISightTargetInterface implemented. Unfortinately currently (4.22) you can’t implement this interface in Blueprints. You need to override CanBeSeenFrom from this interface.

Another thing is to add LightingInfluenceReceiver Component to your Pawn or Character.

Now in CanBeSeenFrom implementation just use code to check lighting influence from receiver component.

Your AIController need to have AIPerception Component added. You can check example in BP_ShowcaseAIControllerWithLightInfluence.

You need to keep track of visible actors using OnTargetPerceptionUpdated function.

Then in some update function inform Behavior Tree about results.

Behavior Tree is straightforward just to show example.

FAQ